Description
Feature request
Import Code Snippets support is great, but from what I have seen in the docs and related issues fetching the snippet file from external sources is not supported. It would be great if this could be extended to import code snippets from files within other repos (or if I have missed something update the docs with an example of this).
What problem does this feature solve?
If I have a docs sites at orgname/docs-site-repo
and examples at orgname/examples-repo
I could then import snippets from my examples repo into the docs-site repo and not need to maintain two sets of the same code.
This would also allow reusing existing code samples.
What does the proposed API look like?
# local files
<<< @/filepath{highlightLines}
# external files
<<< https://url/file.extension{highlightLines}
How should this be implemented in your opinion?
The existing API would need to support the import string starting with https
and a Promise return value so it can fetch.
Are you willing to work on this yourself?
I could certainly help, but am unsure where to start given the number of open issues wanting to change this functionality.
related:
- extend functionality of Code Snippets Import #612
- Feat: Enhance code snippets import continuation of #538 #750
- Import Code Snippets: specify the language #1189
- Add language import specification to code snippet imports #1191
- adapt/change syntax to Import Code Snippets #1474
additionally
I believe #750 is adding support for code-fencing, which is highly desired 👍