I have an edge case where I want to link from a Remark document to a static HTML file in the local source directory, and that file links to other files in the source directory via relative paths. Naturally, gatsby-remark-copy-relative-linked-files copies the file linked directly from the Remark document, but ignores the supplementary files.
A few suggestions, others welcome:
Detect when linking to a file with a .html suffix, then recursively scan that file for links (maybe limited to relative links in the same directory) in anchor and media tags and copy those files as well.
Detect a manifest file in the directory of a Remark file and copy those files as well as the linked file.
Support a Remark syntax extension (such as a tagged code fence) in the file itself where additional files to copy can be listed without generating visible content.
See [this generated report](report.html) for more information.
```copyfiles
report.css
diagram.png
gatsby-remark-table-of-contents does this tagged code fence trick, not sure how popular it is. It requires appearing before PrismJS in the plugin list.
Also note that I think gatsby-remark-copy-relative-linked-files is a good candidate for this feature request because it makes a named directory. If all files end up in the same relative path, then relative links do not need transformation.
I have an edge case where I want to link from a Remark document to a static HTML file in the local source directory, and that file links to other files in the source directory via relative paths. Naturally, gatsby-remark-copy-relative-linked-files copies the file linked directly from the Remark document, but ignores the supplementary files.
A few suggestions, others welcome: