remarkjs / remark-contributors Goto Github PK
View Code? Open in Web Editor NEWplugin to generate a list of contributors
Home Page: https://unifiedjs.com
License: MIT License
plugin to generate a list of contributors
Home Page: https://unifiedjs.com
License: MIT License
Otherwise it appends the block to any Markdown file!
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 a simple match
option, so one can match any other heading than the english word "contributors".
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".
The regular expression passed to this option should determine the heading under which remark-contributors
generates the contributors info.
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.
I think that's because, in that case, heading
is 0 here:
Should the check be if (heading === null && !opts.appendIfMissing)
? @wooorm
See stack trace at more at remarkjs/remark#543
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.