-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
beta.5 docs tags feature - better validation for malformed tags #5478
Comments
frontMatterTags.map is not a function
frontMatterTags.map is not a function
frontMatterTags.map is not a function
question: is this behavior you want or are you fine with a very strict format of docs tags? |
For some reason this shows up in my inbox... As I mentioned in #5433 (comment), the Markdown front matter conforms to YAML syntax. Per YAML spec there are two ways to define an array: ---
# Block style
- Item 1
- Item 2
- Item 3
---
# Inline style
[Item 1, Item 2, Item 3]
--- So comma-separated list without the square brackets isn't even valid YAML. It's not something Docusaurus can gracefully handle without significantly tweaking the YAML parser or we taking over the parsing job ourselves (which is probably not worth the effort). Maybe in the end we should document the latter use case explicitly and assume less knowledge of Markdown front matter syntax from the user? I thought using the inline style elsewhere would be enough to inform readers of this possibility I noticed that
|
hmm i see and hear you. yes lets do the validation. I'm not for extending YAML, i'm just in favor of nice errors so that when people make common mistakes we help them get back on track. |
fix: add docs tag validation to solve facebook#5478
We should definitively add nice validation messages. That's why I added a strict fail-fast validation step but Joi is a bit painful to use and default messages are not always nice, so I always prefer to add tests about validation messages. I also plan to add a method like |
🐛 Bug Report
Description
when i upgraded my docs repo temporalio/documentation#619 to beta.5 i got a new error.
this is because the new docs tag feature (#3646) expects this format:
and doesnt gracefully handle:
or:
we were already using tags in our own way so our errors arent important, but i do think the comma separated tags experience is important that helpful/good errors are important.
Have you read the Contributing Guidelines on issues?
yep
Steps to reproduce
temporalio/documentation#619
Expected behavior
clean upgrade process, elegant handling of tags
The text was updated successfully, but these errors were encountered: