-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: add in guide generation using remark #5408
Conversation
*Do not merge.* I did not commit in node_modules. This intends to generate guides, it is related to #4866. This generates HTML from MD and implements highlight.js.
mdast = processor.run(mdast); | ||
const html = processor.stringify(mdast, remarkOptions); | ||
// Locate YAML front matter | ||
if (mdast.children[0] && mdast.children[0].type === 'yaml') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use a YAML parser such as js-yaml? Currently this code wouldn't support the full YAML specification, which could be confusing for people expecting to be able to write true YAML within the docs.
Regarding node_modules, I'd suggest
Of course, the less dependencies and files, the better :) |
Of course, we could also go the route of requiring the user to install the dependencies if these guides are not part of the release build. |
I'm inclined to prefer not having them checked in, so long as the website build is able to work with that. |
I think we can actually leave YAML parsing out of this entirely for now. It's mainly for eventually replacing the reference doctool that we want YAML frontmatter for. We can get to that later though. For now, we just want something that can build only the guide files in a way that it can be delivered with each release build to the website. |
What's the status on this one? |
@kahwee Are you able to continue working on this? I can volunteer some time next week to help get this ready to merge, if you aren't able to get it finished up yourself. |
7da4fd4
to
c7066fb
Compare
@Qard will you find some time to pick this up? I guess it's blocking a lot of new doc stuff. Also we would need to continue discussion where guids will go on the website afterwards, right? cc @nodejs/documentation |
I'll see what I can do. I don't have a ton of time available at the moment though, so I'd appreciate any help I can get. If other docs people could review this PR and see if they can put together any of the other modules we might need, that'd be a big help. |
Alright. No pressure. I think I got some time tomorrow. |
Okay I have picked this up.
|
Do not merge.
I did not commit in node_modules. This intends to generate guides, it is related to #4866. This generates HTML from MarkDown and implements highlight.js.
Currently it generates
building-node-with-ninja.md
into corresponding HTML.To run it:
This differs from #4866 by being group processing Markdown guide files.
CC: @nodejs/documentation
By the way, if I commit in
node_modules
, there are a lot of files going in. Is this an approach we should proceed with?