Skip to content

doc: fence code blocks #4726

Description

@silverwind

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.

Activity

  1. added
    docIssues and PRs related to Node.js documentation.
    on Jan 16, 2016
  2. Fishrock123 commented on Jan 17, 2016

    @Fishrock123
    Contributor

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

  3. eljefedelrodeodeljefe commented on Jan 17, 2016

    @eljefedelrodeodeljefe
    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?

  4. silverwind commented on Jan 17, 2016

    @silverwind
    ContributorAuthor

    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.

  5. eljefedelrodeodeljefe commented on Jan 17, 2016

    @eljefedelrodeodeljefe
    Contributor

    Alright. Will likely send in feedback today.

  6. eljefedelrodeodeljefe commented on Jan 17, 2016

    @eljefedelrodeodeljefe
    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.

  7. eljefedelrodeodeljefe commented on Jan 18, 2016

    @eljefedelrodeodeljefe
    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.

  8. added a commit that references this issue on Jan 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions