-
Notifications
You must be signed in to change notification settings - Fork 712
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
Support regions and line numbers within @includeCode
tag reference
#2814
Comments
You can almost completely do this with just TypeDoc today. TypeDoc supports including additional markdown documents as of 0.27: https://typedoc.org/documents/External_Documents.html This can be combined with the |
Thanks for such a quick response :) This is great, but I was hoping to find a way to include only parts of a file, not the full file. I tried:
but neither works. If this is something that Typedoc can't currently do but which you'd be open about, I could try my hand at a PR, although I would appreciate being pointed in the right direction… |
Oh, ew... I can see why you want that, but that's a really unfortunate thing to need.... The The All the logic for the include plugin is in src/lib/converter/plugins/IncludePlugin.ts, PR welcome! |
Sounds a bit like a feature request somebody once had for my plugin: krisztianb/typedoc-plugin-replace-text#4 Maybe this helps you. |
@includeCode
tag reference
Search terms
@knodes/typedoc-plugin-code-blocks, [email protected], [email protected], @codeblock
Question
Back in typedoc 0.23, I could use the
@knodes/typedoc-plugin-code-blocks
plugin to include bits of code from other files into markdown files which would end up as doc pages thanks totypedoc-plugin-pages
.For example, consider a source file
examples/basic-usage.ts
:and a markdown file
pages/basic-usage.md
:Then, in typedoc.json, I would have:
Well, it seems the
@knodes/typedoc-plugin-code-blocks
plugin isn't compatible with more recent versions of typedoc…Is it still possible do achieve something like this, perhaps using a different plugin? I tried using
typedoc-plugin-include-example
, but that seems only to work in typescript files and not in markdown files.The reason I want this is because I want to include thoughtfully composed guides in my docs (hence the markdown) which include code samples that are taken directly from example files which I actually run in my tests. This ensures that the code samples in the docs never fall out of sync with the actual code and are all tested.
The text was updated successfully, but these errors were encountered: