-
Notifications
You must be signed in to change notification settings - Fork 63
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
Feature request: Allow overriding base header levels for embedded #62
Comments
This is an interesting suggestion. The ability to customize the level feels particularly useful for embedding scenarios, especially since the levels are mostly hardcoded right now and would have to be changed in multiple places. A couple questions:
|
My primary use case is embedding in the repo root readme, so really only one level is sufficient. Including the docs in
I think I looked at this and decided it wouldn't be trivial, but it's been long enough that I don't recall. Our use case is targeting a |
Super interested in this! For inspiration there is a similar CLI parameter in the terraform-docs project which also can generate markdown (based on terraform code) and allows embedding into other markdown files. They call it injecting instead of embedding and the parameter is called An example, which adds a reference section in your hand written README:
# My module
Some hand written prose
## Reference
<!-- BEGIN_TF_DOCS -->
<!-- END_TF_DOCS --> Then you can run $ terraform-docs markdown . --output-file README.md --indent 3 |
Use case:
We have a markdown README like:
... and would like for either the CLI, or preferably the embed comment itself to allow for overriding the
.Level
of the headers inserted within.Bonus feature request: Allow for skipping the
{{- header .Level .Name -}}
and{{- codeBlock "go" .Import -}}
sections of thepackage
template since they're a bit redundant in that context.Proposal
Ideally, some kind of context to the tagging (it gets parsed with a regex, I've seen), e.g.:
<!-- gomarkdown:embed:--no-header,--no-import,--level=3 -->
... with parity in the CLI:
gomarkdoc --verbose --output '{{ .Dir }}/README.md' --embed --embed-no-header --embed-no-import --embed-level=3 ./...
The text was updated successfully, but these errors were encountered: