Skip to content
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

docs(parser): share oxc_parser module docs with oxc::parser #5832

Conversation

DonIsaac
Copy link
Collaborator

@DonIsaac DonIsaac commented Sep 17, 2024

What This PR Does

Moves oxc_parser module documentation to a README.md file so that the
oxc crate can benefit from it as well.

The downside of this PR is that it breaks example inclusion with
#![doc include_str(..)], since macros in loaded files are not run. I'm
not 100% sure that the tradeoffs are worth it, but this is worth
discussing.

Copy link
Collaborator Author

DonIsaac commented Sep 17, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @DonIsaac and the rest of your teammates on Graphite Graphite

@DonIsaac DonIsaac added the C-docs Category - Documentation. Related to user-facing or internal documentation label Sep 17, 2024 — with Graphite App
@DonIsaac DonIsaac marked this pull request as ready for review September 17, 2024 17:08
@github-actions github-actions bot added the A-parser Area - Parser label Sep 17, 2024
Copy link

graphite-app bot commented Sep 17, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@DonIsaac DonIsaac force-pushed the 09-17-docs_parser_add_module_and_struct_level_documentation branch from 8091873 to 0f382ba Compare September 17, 2024 21:17
@DonIsaac DonIsaac force-pushed the 09-17-docs_parser_share_oxc_parser_module_docs_with_oxc_parser_ branch from ba67ef6 to 7148cdf Compare September 17, 2024 21:17
Copy link

codspeed-hq bot commented Sep 17, 2024

CodSpeed Performance Report

Merging #5832 will not alter performance

Comparing 09-17-docs_parser_share_oxc_parser_module_docs_with_oxc_parser_ (174c0dc) with main (3148d4b)

Summary

✅ 29 untouched benchmarks

@Boshen Boshen changed the base branch from 09-17-docs_parser_add_module_and_struct_level_documentation to graphite-base/5832 September 18, 2024 03:07
@Boshen Boshen force-pushed the 09-17-docs_parser_share_oxc_parser_module_docs_with_oxc_parser_ branch from 7148cdf to a5e0c7a Compare September 18, 2024 06:31
@Boshen Boshen changed the base branch from graphite-base/5832 to main September 18, 2024 06:32
@Boshen Boshen force-pushed the 09-17-docs_parser_share_oxc_parser_module_docs_with_oxc_parser_ branch from a5e0c7a to 95b63f9 Compare September 18, 2024 06:32
@overlookmotel
Copy link
Collaborator

since macros in loaded files are not run

Did you mean examples in loaded files are not run?

@DonIsaac
Copy link
Collaborator Author

since macros in loaded files are not run

Did you mean examples in loaded files are not run?

I did not.

Given this README:

Here's a description for some stuff 

## Example
'''rust
#![doc = include_str!("../examples/foo.rs")]
'''

note: using single quotes instead of backticks above as to not break formatting of this comment

When this gets loaded in as documentation in lib.rs

#![doc = include_str!("../README.md")]

then the macro invocation in README.md (include_str!("../examples/foo.rs")) wiil not be invoked, and will instead be displayed as-is.

@overlookmotel
Copy link
Collaborator

Ah. Now I understand. Thanks for explaining.

@DonIsaac DonIsaac force-pushed the 09-17-docs_parser_share_oxc_parser_module_docs_with_oxc_parser_ branch from 95b63f9 to d1bda46 Compare September 18, 2024 15:05
DonIsaac and others added 2 commits September 18, 2024 19:32
What This PR Does

Moves `oxc_parser` module documentation to a README.md file so that the
`oxc` crate can benefit from it as well.

The downside of this PR is that it breaks example inclusion with
`#![doc include_str(..)]`, since macros in loaded files are not run. I'm
not 100% sure that the tradeoffs are worth it, but this is worth
discussing.
@DonIsaac DonIsaac force-pushed the 09-17-docs_parser_share_oxc_parser_module_docs_with_oxc_parser_ branch from d1bda46 to 174c0dc Compare September 18, 2024 23:44
@Boshen
Copy link
Member

Boshen commented Sep 19, 2024

This seems confusing, maybe just a docs.rs link to the actual crate should suffice?

@DonIsaac DonIsaac closed this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area - Parser C-docs Category - Documentation. Related to user-facing or internal documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants