2 ms·
I feel comfortable with fenced code blocks. Using heredocs all the time, not so much. ```js title="/root/server.js" console.log('test') ``` or
by benatkin 3y ago
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 <<EOF cat >/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 3y agoThe 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.
- bionhoward 3y agoBrilliant idea. Single markdown file for a whole app stack?
- benatkin 3y agoMultiple markdown files, presenting code more like gists where you can read them top to bottom, plus with docs in between...