Skip to content
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: fence code blocks #4726

Closed
silverwind opened this issue Jan 16, 2016 · 6 comments
Closed

doc: fence code blocks #4726

silverwind opened this issue Jan 16, 2016 · 6 comments
Labels
doc Issues and PRs related to the documentations.

Comments

@silverwind
Copy link
Contributor

Currently, we use 4-space indent to mark code blocks in the docs. It'd be better if we could replace them with backtick fences like js` or c++`. This has two benefits:

  1. It's required for syntax highlighting to work on GitHub
  2. It allows the code samples to be linted with tools like eslint-plugin-markdown

Because this would be another "churn" commit, I'd like to ask for opinions first.

@silverwind silverwind added the doc Issues and PRs related to the documentations. label Jan 16, 2016
@Fishrock123
Copy link
Contributor

It's docs, churn doesn't exist like that imo

@eljefedelrodeodeljefe
Copy link
Contributor

I agree. Also it's clearer while editing the docs for the eye, imo, and for markdown syntax highlighters. I'd offer some time to do it. Are there any blockers?

@silverwind
Copy link
Contributor Author

I'd say go for it. One thing that needs to be checked beforehand is that the HTML output of make doc is showing correctly highlighted code blocks with the fences in place.

@eljefedelrodeodeljefe
Copy link
Contributor

Alright. Will likely send in feedback today.

@eljefedelrodeodeljefe
Copy link
Contributor

@silverwind I added three commits. The code block change is really big of course. I wanted to take some time on a bigger screen to review it tomorrow. I am pretty sure everything is alright though. Do have a look at the commit message for known issues.

I also added one to rename .markdown files, which has implications on tools and the makefile. Please do regard this as optional. I think the only reason no-one has changed this, is because it requires the change in 4 places.

@eljefedelrodeodeljefe
Copy link
Contributor

@silverwind if you like, do have a look at Rods remarks on the PR. If you want to take this further, I am happy to change stuff accordingly.

rvagg pushed a commit that referenced this issue Jan 25, 2016
This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.

JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.

Known issues:
* Not every JSON / object notation has been improved. Should
  make another run for this.
* Some example functions break hightlighting due to various
  combinations of brackets. However changing them means leaving
  the code style.

Fixes: #4726
PR-URL: #4733
Reviewed-By: Roman Reiss <me@silverwind.io>
MylesBorins pushed a commit that referenced this issue Feb 22, 2016
This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.

JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.

Known issues:
* Not every JSON / object notation has been improved. Should
  make another run for this.
* Some example functions break hightlighting due to various
  combinations of brackets. However changing them means leaving
  the code style.

Fixes: #4726
PR-URL: #4733
Reviewed-By: Roman Reiss <me@silverwind.io>
MylesBorins pushed a commit that referenced this issue Feb 22, 2016
This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.

JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.

Known issues:
* Not every JSON / object notation has been improved. Should
  make another run for this.
* Some example functions break hightlighting due to various
  combinations of brackets. However changing them means leaving
  the code style.

Fixes: #4726
PR-URL: #4733
Reviewed-By: Roman Reiss <me@silverwind.io>
MylesBorins pushed a commit that referenced this issue Mar 2, 2016
This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.

JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.

Known issues:
* Not every JSON / object notation has been improved. Should
  make another run for this.
* Some example functions break hightlighting due to various
  combinations of brackets. However changing them means leaving
  the code style.

Fixes: #4726
PR-URL: #4733
Reviewed-By: Roman Reiss <me@silverwind.io>
scovetta pushed a commit to scovetta/node that referenced this issue Apr 2, 2016
This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.

JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.

Known issues:
* Not every JSON / object notation has been improved. Should
  make another run for this.
* Some example functions break hightlighting due to various
  combinations of brackets. However changing them means leaving
  the code style.

Fixes: nodejs#4726
PR-URL: nodejs#4733
Reviewed-By: Roman Reiss <me@silverwind.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

No branches or pull requests

4 participants