-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Description
Is your feature request related to a problem? Please describe.
Problem space: There does not appear to be a way to embed the source text of a local file into the Markdown files of the API docs.
Context: I'm trying to include a JS code sample in API docs Markdown that would exist in a different file. It would be preferable if it could pass a few validation & lint-style checks prior to being embedded and disseminated. I mentioned the desire for this in a previous comment, which follows.
Ideally these samples would live in their own files and be subject to typechecking and linting prior to being embedded into the docs via a templating engine otherwise you inevitably end up providing bad samples to users, which isn't uncommon.
After further thought and a new PR, re-implementation of this test fixture (presently inert & obsoleted), re-purposing it, and re-integrating it as a code sample supporting the prose of a new loader example seems most logical. However, as @devsnek pointed out, code samples intended for docs shouldn't exist in test/ (with doc/ potentially being more appropriate as an idea fielded on IRC).
Describe the solution you'd like
After a cursory look, @Trott and myself are under the impression that the documentation generator (tools/doc/) is not presently capable of performing this feature and it was suggested that there may be value in opening an issue for discussion.
Therefore, (pointed out to me by @Trott) this is solvable in a number of different ways as is apparent in the following StackOverflow question and may benefit from discussion.
https://stackoverflow.com/questions/4779582/markdown-and-including-multiple-files
Any thoughts/suggestions are welcome and would be highly appreciated! :)
/cc @rubys and @vsemozhetbyt as have been relevant prior contributors to tools/doc/
/cc @wooorm as has been helpful with previous @unifiedjs tooling workflows
/cc @GeoffreyBooth as is likely interested in the discussion and outcome
/cc @nodejs/documentation as would likely be the relevant team