-
Notifications
You must be signed in to change notification settings - Fork 381
Rewrite generate-errors
and improve learn/errors
#1089
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
Rewrite generate-errors
and improve learn/errors
#1089
Conversation
This allows for getting the content of the error pages for use in the Zola pages.
It felt more appropriate for this specific tool to be more like the book or migration guides in how it's formatted. Would be more readable and searchable as well.
The original markdown files already have a title, but Zola will ad its own, so it was creating duplicate level one headers for the title which looked wrong.
The prior URL now redirects to the proper page causing an odd white flash briefly. This minimizes this by putting the proper link instead.
That way they're not littering useless folders on the user's system.
We now use the docs-section and docs-page template, so the old errors template is now vestigial and can be deleted.
Decided that output_path and errors_path made more sense than content_path and bevy_repo_path.
Not sure if this is an actual typo, but I think it reads better.
Noticed an area which could get confusing without context. Also figured stuff should be capitalized for readability.
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.
Good work, this is definitely needed!
This seems to break syntax highlighting in the generated pages. I believe it's due to should_panic
and the order of the code block attributes.
Generated with your branch, broken:
```rust,should_panic
Generated with main, works:
```rust
You can also fix it by making rust
last:
```should_panic,rust
Ah, I see. The old solution just thru away the info, it just needs to be reordered. I'll fix that later. |
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.
Personal notes questioning yesterday's me's decisions.
I keep confusing assets with errors mentally; this is just the one I didn't catch before commit.
It's simpler than the odd way I was doing it before.
Before it was in an invalid ordering where annotations were added after the language.
Co-authored-by: BD103 <[email protected]>
Co-authored-by: BD103 <[email protected]>
Co-authored-by: BD103 <[email protected]>
Co-authored-by: BD103 <[email protected]>
Co-authored-by: BD103 <[email protected]>
Forgot to import the macro when it was added.
Before they relied on the same folder which could be deleted in the middle of one test by another. Now they use different folders to avoid stepping on each others toes.
These ones don't need formatting, so it's safe to make them constant.
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.
Please update the .gitignore
for the separate content folders, but beyond that it looks good!
Co-authored-by: BD103 <[email protected]>
Part of #789 and touches #1059
This removes the use of invalid pages the
learn/errors
section had and stops using a section as a page which is bad practice.Now
learn/errors
uses thedocs-*
templates and is more like the book or migration guides or quick start guide. This feels better imo since you don't have to scroll one long page to find your specific error; you now have specific pages for errors.I ended up rewriting the whole
generate-errors
tool because the old one was poorly documented, seemingly esoteric / maybe over-engineered in it's ways of doing things making it hard to work on, and just a bit hard to retrofit to work as adocs-*
based page rather than the bad practice section as a page.Tl:dr: Was easier to rewrite than fix the old.
At least it has documentation now. (Speaking of which please mention anywhere the documentation may be lacking; I don't want this to be hard to work with in the future potentially).