-
Notifications
You must be signed in to change notification settings - Fork 282
[chore] [editoral] switch to md front matter #2971
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
base: main
Are you sure you want to change the base?
[chore] [editoral] switch to md front matter #2971
Conversation
|
Build issue due to current toc generator having known issues with front matter syntax & isn't mantained. Will need to be addressed by switching to https://www.npmjs.com/package/doctoc |
f200c55 to
b48a142
Compare
1f2059f to
2c6b739
Compare
|
@chalin finally found a way to keep the build process happy. The one thing which i am not sure on is if the aliases in resource-and-entities.md are still valid. If not we could switch to a redirect |
|
Nice! Thanks @thompson-tomo. I'll get back to you as soon as I can (it's a very busy EOM). |
|
No worries, I will fix the formatting which is causing the build to fail very soon. |
f94d5a8 to
3b3827b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates documentation front matter from HTML comment syntax (<!--- ... --->) to standard YAML front matter delimited by ---. This change enables better tooling support, makes front matter metadata visible during reviews, and allows enabling the first-line h1 markdown lint check. The migration affects over 140 markdown files across the documentation and 3 Jinja2 templates.
Key changes:
- Converts all front matter from HTML comments to YAML format (delimited by
---) - Updates CONTRIBUTING.md documentation to reflect new front matter syntax
- Enables
first-line-h1markdownlint rule (previously disabled) - Adds Makefile commands to ensure proper formatting after front matter closing delimiter
Reviewed changes
Copilot reviewed 161 out of 161 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| templates/registry/markdown/*.j2 | Convert template front matter to YAML format |
| docs/**/*.md | Convert all documentation front matter from HTML comments to YAML |
| CONTRIBUTING.md | Update front matter documentation example |
| .markdownlint.yaml | Enable first-line-h1 check |
| Makefile | Add awk/sed commands to format documents after TOC generation |
can these be done in a follow-up PR? if so, please revert those changes to keep this large mechanical PR easy to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first few questions and comments:
- Spec and semconv folks expressedly asked me to include the comment "Hugo front matter used to generate the website version of this page" so that all contributors know why the front matter is there (and hopefully realize that it's important to keep it up to date). Maybe this preference has changed. I'll let @open-telemetry/specs-maintainers @open-telemetry/specs-semconv-maintainers comment about this. I'm ok either way.
- Why not keep the (inline) array syntax for aliases?
Yes the alias is valid, but I'd rather keep the inline array syntax, esp. in these cases that have a single entry. |
|
FYI, I haven't had the time to look into this more, but in support of #1821 and open-telemetry/opentelemetry.io#6101. We probably will need to have a I'm wrapping up and will be OOO so I won't be able to get back to this until the new year (FYI). |
The issue I ran into was that this causing issues with the toc plugin. If necessary I can look to put it back and hope the current awk/sed commands keep it happy or possibly extend it.
This is being caused by the necessity to process the docs with awk/sed after toc generation to keep linting happy. I would've preferred to keep them unchanged as well.
Yeap am aware and that would be tackled by seperate PR. |
OMG, the last update was 8 years ago in NPM. doctoc seems like an interesting choice; https://npm-compare.com/doctoc,markdown-toc Maybe it would be worth switching toc tools before working further on this PR? /cc @vitorvasc |
|
I certainly am open to switching tools. If I remember correctly there was issues using do toc. What I found was:
So doctoc would only work if we removed comments from front matter then & also remove the h1. Note doc toc also has not had a release in years. |
|
Hmm. Ok, maybe another tool then. |
|
Let's see if I can a feature into doctoc to ignore level 1 headings as i wasn't having much luck finding an alternative. |
|
Btw, if you still need to massage the files, rathr than awk & sed, I'd suggest using Perl because it is more portable across OSs and container environments in my experience (esp. if you avoid Perl modules that don't ship with Perl). |
3b3827b to
2f2c7d9
Compare
Closes #1976
Progresses #1821
Changes
This switches to use github front matter syntax rather than embedding the front matter in comments. Currently these comments need to be processed before they can be used on the website version.
This change will also help in reviews as the link title etc are front and center.
By switching to front matter directly it enables turning on the first line h1 check.
Note the awk/sed command are necessary so that the document still passes the lint rules and we don't have a formatter to format it.
Question's:
Do we need to keepHas been removed due to TOC issues and needing to use grep/awk for formatting# Hugo front matter used to generate the website version of this page? Or can it be removed?Important
Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.
Merge requirement checklist
[chore]