Quantcast
Channel: Active questions tagged code-formatting - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 180

Give a code block a filename

$
0
0

It's relevant and useful to include the name of the file that a code block should go in. For example, an update to a Next configuration would go in the next.config.js file, an NPM script would go in the package.json file and so on..

Specifying the filename is already done in answers, and visually it would make sense to more closely couple this information with the code block.

For example, in my most recent answer I did this:

Enter image description here

A more digestible and compact way to do this would be to stick that information in the top-right corner of the code block:

Enter image description here

A proposed Markdown syntax for this could be

````js, next.config.js

A Markdown syntax update would probably be the biggest blocker on this feature request.


Viewing all articles
Browse latest Browse all 180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>