Skip to content

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

Merged
merged 40 commits into from
Mar 18, 2024

Conversation

TrialDragon
Copy link
Member

@TrialDragon TrialDragon commented Mar 11, 2024

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 the docs-* 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 a docs-* 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).

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.
@TrialDragon TrialDragon added C-Feature A new feature, making something new possible A-Build-System C-Usability labels Mar 11, 2024
TrialDragon and others added 6 commits March 10, 2024 23:04
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.
Copy link
Member

@BD103 BD103 left a 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

@TrialDragon
Copy link
Member Author

Ah, I see. The old solution just thru away the info, it just needs to be reordered. I'll fix that later.

Copy link
Member Author

@TrialDragon TrialDragon left a 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.
@BD103 BD103 mentioned this pull request Mar 13, 2024
7 tasks
@alice-i-cecile alice-i-cecile requested a review from BD103 March 16, 2024 13:25
TrialDragon and others added 12 commits March 16, 2024 13:36
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.
@alice-i-cecile alice-i-cecile requested a review from BD103 March 17, 2024 02:00
Copy link
Member

@BD103 BD103 left a 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]>
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review Ready for a maintainer to consider for merging label Mar 18, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 18, 2024
Merged via the queue into bevyengine:main with commit 0889cb6 Mar 18, 2024
@TrialDragon TrialDragon deleted the make_error_pages_valid branch March 18, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System C-Feature A new feature, making something new possible C-Usability S-Ready-For-Final-Review Ready for a maintainer to consider for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants