bob
bob copied to clipboard
Add link to source files
It happens frequently when you want to update an example that you have to search through the interactive examples repository to find the correct source files. Given we're templating the output, it would be convenient to add links to sources somewhere, even if this is hidden / not reader visible.
Some options for CSS could be:
<span><a href="https://github.com/mdn/interactive-examples/blob/main/%example-css-src%">CSS Source></a></span>
<a href="https://github.com/mdn/interactive-examples/blob/main/%example-css-src%" style="display: none;">CSS Source></a>
Or some variations on that. Linking to the directory if it contains multiple files (CSS/JS) would already be helpful.
- CSS examples template: https://github.com/mdn/bob/blob/main/editor/tmpl/live-css-tmpl.html
- Example meta: https://github.com/mdn/bob/blob/main/live-examples/css-examples/animation/meta.json
edit: If this was combined with Yari improvements, we could display hints to authors only when on localhost, for instance, via CSS class or something.