New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include a file name for code blocks #645
Comments
That's a good idea, although we probably shouldn't use a whole new line for it. i wonder if we could/should include a download button to go with the file name. |
How about in the lower right corner? Having the file name in the same position with the text might mess up copy-pasting though.
Generating a download via JS is technically possible, see FileSaver.js. Unlike #629, this should definitely be optional, since there probably isn't any value in downloading small code excerpts. |
Perhaps it is OK to do it as in the screenshot, as the filename is going to be optional and will not be present in most cases.
Yes, that should be optional too, only for cases where the user is meant to save the file locally and do something with it. In fact, probably should be a very low priority feature, if we are going to do it at all. |
Hi, I'm interested in picking this up. Can I clarify if by 'code block' you mean https://markbind.org/userGuide/formattingContents.html#code ? This also applies to #646 |
Yes for both. |
Also, should we generalize this beyond filenames? There might be other information the author might want to show e.g., |
If we make this a general While it is a bit of extra work, authors can show the code language by simply adding a heading. |
Good idea, @nbriannl what do you think? Since with #646 authors must specify whether to have the indicator enabled or not, I think we might as well just let the authors be able to customize the content of the heading entirely. |
@nbriannl this issue is done, right? |
@damithc Yes. |
Tell us about your environment
Rationale: Developer documentation usually includes not only code excerpts, but also sample code files. It can be a nice visual reminder for the reader if we include the file name for a given sample code block, especially if that code file needs to have a fixed name (eg. configuration files like
.travis.yml
).Example: From Travis CI documentation:
The text was updated successfully, but these errors were encountered: