Skip to content

Add @include tag#193

Draft
EliTheGingerCat wants to merge 5 commits intoevaera:masterfrom
EliTheGingerCat:feature-include-tag
Draft

Add @include tag#193
EliTheGingerCat wants to merge 5 commits intoevaera:masterfrom
EliTheGingerCat:feature-include-tag

Conversation

@EliTheGingerCat
Copy link
Copy Markdown
Contributor

Adds a tag @include <path> which adds the content of the file at path to the doc entry description. The tag is allowed to appear multiple times.

This pull request also moves diagnostic stuff around a bit so doc entries always gather all their diagnostics before returning an Err. Due to diagnostics being instantiated before looping through tags, I thought there was no benefit to waiting to add diagnostics for unused tags (as previously the diagnostics vector would only be created if there were any unused tags), so I have also inlined unused tag diagnostics.

Todo

  1. Currently, the @include tag path is assumed to be based from the current working directory, meaning it checks the cached folder. The extractor should really check from the base path, the one provided via the --base flag. I am not sure about the best way to go about this. main.rs passes the base path to generate_docs_from_path which uses it for getting human-readable paths, and that is it. Sharing the base path in a module would not even work really since the base path only exists if the extract subcommand is used.
  2. I have not added tests yet. There is also an issue of what path tests should use — perhaps a file in /extractor/test-input/.

Closes #185

@YetAnotherClown YetAnotherClown added enhancement New feature or request extractor labels Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request extractor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@include tag

2 participants