Lurker News

Comments (173) 27 threads

Show all comments

Showing thread 17 of 27

benatkin2 replies#
I feel comfortable with fenced code blocks. Using heredocs all the time, not so much.

    ```js title="/root/server.js"
    console.log('test')
    ```
or

    `/root/server.js`

    ```js
    console.log('test')
    ```
vs

    RUN </root/server.js
    console.log('test')
    EOF
However the Markdown one is better if the syntax highlighting theme makes the code fence a color that doesn't stick out - either monochrome or closer to the background color.
pushedx#
The file is a Dockerfile with a shebang line that ignores the comments with a regex. Code fences would not be valid.

The point of this isn't to share this code, it's a demo of the clever shebang line.

bionhoward1 reply#
Brilliant idea. Single markdown file for a whole app stack?
benatkin#
Multiple markdown files, presenting code more like gists where you can read them top to bottom, plus with docs in between...