-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Inconsistent use of plaintext code fencing in docs #32938
Comments
If someone feels strong about this and want to open a PR to add a linting rule to enforce one form (preferably I think there are 2 instances of node/doc/guides/contributing/issues.md Line 42 in 46ec9ab
node/doc/guides/contributing/pull-requests.md Line 254 in 46ec9ab
IMHO both should stay as is, it is valid markdown syntax and therefore should be syntax highlighted as markdown (supported by highlight.js BTW). Regarding the use of Lines 506 to 512 in 46ec9ab
Lines 3470 to 3474 in 46ec9ab
|
There's a discussion going about code fences in GitHub Flavored Markdown (GFM) going at #32916. I also have a PR open about adding more GFM over at #32944. /to @Trott Progress on this issue would be valuable to inform us on what lint rules (if any) should be added to the Markdown files located in the Specs: |
This issue seems to need |
I think |
Agreed. Markdown is a distinct language that benefits from syntax highlighting as opposed to Plaintext, which does not. Here are all the languages supported by highlight.js: https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md Therefore, |
There is a semantic difference and I do not believe they should be consolidated into a single label (info string). Allow me to demonstrate.
Rather than Demo Using
Using $ node
> process.report.writeReport();
Writing Node.js report to file: report.20181126.091102.8480.0.001.json
Node.js report completed
> Therefore, |
Thanks @DerekNonGeneric. I've incorporated your feedback in #33028 |
I had commented in the PR w/ my pre-deep-dive thoughts. With a better understanding, it turns out they're more relevant to this thread and we had been overlooking several pertinent details.
I agree that there is an issue here and that the PR will fix it, although I normally see this type of thing handled in a single commit that also prevents it from re-occurring. These Markdown lint rules aren't defined in this repo though (they're in remark-preset-lint-node), so I imagine this will play out differently than what I'm accustomed to. Looking forward to seeing this come to fruition! |
My 2 cents on this: I think we should enforce using |
Maybe we can start small and do this incrementally? I imagine it would be uncontroversial as a first step to standardize on |
(This would also allow us to implement lint restrictions incrementally.) |
Believe it or not …
Line 90 in 94e5b5c
node/doc/api_assets/sh_main.js Line 513 in 94e5b5c
|
Correction: there is a way to prevent code blocks from being highlighted. 😌 node/doc/api_assets/sh_main.js Lines 522 to 525 in 94e5b5c
Assuming …
|
(Previous comment deleted. Wrong issue. Obviously. Sorry.) |
Since the Markdown lint rules are in remark-preset-lint-node, we are going to need to normalize the info strings prior to version bumping node-lint-md-cli-rollup to include the latest ruleset. These version bumps have been happening independently and would not include changes that make the documents comply w/ the newest version of the ruleset. Therefore, the PR to resolve this issue (#33028) should be good to go at this point. We will just need to wait for #33442 to land until code blocks are actually preventable from being highlighted. |
Hey party people!
I'm working on a project that parses all the markdown files in the doc directory of this repo, and I've come across a number of instances of inconsistent naming of the plaintext info string (i.e. the language) in GitHub Flavored Markdown code fencing:
text
txt
fundamental
markdown
raw
I'm currently using this hack to sanitize all the incoming markdown before converting it to HTML:
Here's what the current documentation style guide says about code blocks:
There's no mention of what the canonical language should be for plaintext, but I'd suggest standardizing on one of the following:
text
is the most commonly used plaintext info string in this projectplaintext
is what the popular highlight.js syntax highlighting library expectsI don't have a strong opinion about what the info string should be as long as it's used consistently across the docs. I'd be happy to open a pull request to clean these up, but wanted to open an issue first for discussion.
Things that might need to be done to resolve this:
cc @nodejs/documentation 👋
The text was updated successfully, but these errors were encountered: