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

Katex doc rendering #423

Closed
Shoeboxam opened this issue Oct 27, 2022 · 6 comments
Closed

Katex doc rendering #423

Shoeboxam opened this issue Oct 27, 2022 · 6 comments

Comments

@Shoeboxam
Copy link

I was recently trying to get Katex rendering on docs.rs for a crate I work on. Noticed this crate was able to get it working. It seems you can directly reference a file in your crate.

[package.metadata.docs.rs]
rustdoc-args = ["--html-in-header", "docs/assets/rustdoc-include-katex-header.html"]
@rozbb
Copy link
Contributor

rozbb commented Oct 27, 2022

I was actually working on this last week and couldn't make the above work. The issue was it attempted to compile all the deps with the same flag, and obviously the deps don't have that path in their repo, so it quickly failed with a File Not Found. Did you manage to find a way around this?

@Shoeboxam
Copy link
Author

Shoeboxam commented Oct 27, 2022

My test crate had no deps, so it didn't trigger that issue. However, the crate I linked does have deps and it works. (!)

EDIT: After adding a dep to my test crate, I still got a successful docs.rs build.
EDIT2: This also comes up: CAD97/katex-doc#4

@rozbb
Copy link
Contributor

rozbb commented Oct 28, 2022

Neat! I'll give it a shot soon, then.

@Shoeboxam
Copy link
Author

Shoeboxam commented Oct 28, 2022

I hadn't caught the distinction between cargo doc and cargo rustdoc. cargo doc also builds all deps. For local builds I think you could also run:

cargo doc && cargo doc --no-deps *inject html*

@pinkforest
Copy link
Contributor

#439 fixes this and does it all in docs.rs and locally

@pinkforest
Copy link
Contributor

pinkforest commented Nov 27, 2022

This was fixed via #439

@rozbb rozbb closed this as completed Dec 9, 2022
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

No branches or pull requests

3 participants