auth0/styleguide

Code snippets should have dedicated element for file path

chenkie opened this issue · 1 comments

Explicitly stating the file path for where a given code snippet should go is helpful to many docs readers. Right now most of the snippets have the file path as a comment at the top. For example:

// src/app/myFile.js

function stuff() {
...

However, some types of files do not support comments and will cause errors if a user copies the snippet and doesn't remove the commented file path. This happens in JSON files for example.

We should create an element that can sit at the top of the snippets which lists the file path for that snippet. Here's an example from the Ember docs:

image

We can work with auth0-docs to populate the file path header by doing something like this in the markdown:

``` src/app/myFile.js

Where the file type for the snippet can be inferred from the extension used in the path.

Hi, I'd like to take this on. Is this still on the roadmap, considering this issue is almost 2 years old?