Giter VIP home page Giter VIP logo

remark-contributors's People

Contributors

hughsk avatar niftylettuce avatar nnmrts avatar pke avatar vweevers avatar wooorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remark-contributors's Issues

Missing required `path` on `file` / `file.dirname` is undefined

A file object in v5.0.0 looks like this:

file VFile {
  data: {
    remarkValidateLinksReferences: {},
    remarkValidateLinksLandmarks: { '': [Object] }
  },
  messages: [],
  history: [],
  cwd: '/Users/jack/Projects/lad.sh',
  contents: <Buffer 23 20 51 75 69 63 6b 20 53 74 61 72 74 0a 0a 57 65 20 73 74 72 69 63 74 6c 79 20 73 75 70 70 6f 72 74 20 4d 61 63 20 61 6e 64 20 55 62 75 6e 74 75 2d ... 2130 more bytes>
}

As you can see, it does not contain a file.dirname property, that your new commit in v5.0.0 is referencing here dafb61c#diff-168726dbe96b3ce427e7fedce31bb0bcR26.

Therefore an exception will be thrown like this:

[03:40:31] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:117:11)
    at Object.resolve (path.js:980:7)
    at transform (/Users/jack/Projects/lad.sh/node_modules/remark-contributors/index.js:26:39)
    at wrapped (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:25:19)
    at next (/Users/jack/Projects/lad.sh/node_modules/trough/index.js:57:24)
    at done (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:55:16)
    at then (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:62:5)
    at wrapped (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:45:9)
    at next (/Users/jack/Projects/lad.sh/node_modules/trough/index.js:57:24)
    at done (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:55:16)
    at then (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:62:5)
    at wrapped (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:45:9)
    at next (/Users/jack/Projects/lad.sh/node_modules/trough/index.js:57:24)
    at done (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:55:16)
    at then (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:62:5)
    at wrapped (/Users/jack/Projects/lad.sh/node_modules/trough/wrap.js:45:9)

This logic also does not check if there's a package.json in the root of the repository.

Thanks @wooorm just let me know when it's fixed/released.

Add `heading` option to match custom headings

Subject of the feature

Add a simple match option, so one can match any other heading than the english word "contributors".

Problem

Currently you can't use remark-contributors on multilingual (or just any other language than english) readmes. This would fix it, but probably other use cases exist as well. For example, one could prefer a heading like "Contributors Table" or "Contributing People".

Expected behavior

The regular expression passed to this option should determine the heading under which remark-contributors generates the contributors info.

Alternatives

The only alternative solution to this would be to use your own plugin, which is what I considered at first. But I think this can't be a just a "me-issue".

Inspired by remarkjs/remark-license#12.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.