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

Add: markdown code block langs #1773

Closed
wants to merge 2 commits into from

Conversation

mattmundell
Copy link
Contributor

@mattmundell mattmundell commented Nov 29, 2024

What:

Add languages to ``` blocks in Markdown files in the Rust tree. Also remove no_run from these files.

Why:

Enables syntax highlighting.

From what I can see no_run is only for comments in Rust code.

@mattmundell mattmundell marked this pull request as ready for review November 29, 2024 16:11
@mattmundell mattmundell requested a review from a team as a code owner November 29, 2024 16:11
@Tehforsch
Copy link
Contributor

Hi, thank you.

From what I can see no_run is only for comments in Rust code.

This is true, but some of these markdown files are included from within the rust code as docstrings for their corresponding modules via #![doc = include_str!("README.md")], so unfortunately we cannot return the no_run directives.

@mattmundell
Copy link
Contributor Author

Oh I see, I'll make a new PR.

Would it be a good idea to add no_run to all the rust blocks?

@Tehforsch
Copy link
Contributor

Would it be a good idea to add no_run to all the rust blocks?

I don't think so, since we want those code blocks to run as doctests. Simply leaving the no_run as it is should be fine. It is a bit unfortunate that this shows up in the readmes and looks ugly, but as far as I know, fixing this requires some additional tooling such as https://github.com/orium/cargo-rdme , which is a little overkill for our purposes.

@mattmundell mattmundell closed this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants