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

Use KaTeX in documentation #226

Closed
wants to merge 5 commits into from
Closed

Use KaTeX in documentation #226

wants to merge 5 commits into from

Conversation

hauleth
Copy link
Member

@hauleth hauleth commented Sep 17, 2016

Before:

before

After:

after

Close #225

@hauleth
Copy link
Member Author

hauleth commented Sep 17, 2016

This PR also allow us to describe whole method used to implement given function, ex.:

image

@bluss
Copy link
Contributor

bluss commented Sep 17, 2016

Cool. Not to be a super downer, but while docs.rs is awesome, it also makes it so that it's best if docs build well there, so is it possible to use this there? Their maintainer seems pretty open to installing new software and so on, so maybe.

@hauleth
Copy link
Member Author

hauleth commented Sep 17, 2016

This requires no additional software, only some environment variable. So if it is possible to set them on docs.rs then it should work.

@cuviper
Copy link
Member

cuviper commented Sep 18, 2016

It definitely looks nice! But I do have concerns...

  • I would prefer all resources stay local, especially for offline use. KaTeX advertises that it is self-contained to allow bundling, so that should be possible.
  • The injection is a bit fragile, leaning on an environment variable, and RUSTDOCFLAGS isn't even supported in stable cargo. This also injects into all crates at the time, not just num's.
  • This won't work (as-is) for the sub-crates when generated independently. That's important for docs.rs where everything is independent.
  • Even from the main crate, it won't work if generated as a dependency in someone else's docs.

I think perhaps it will need some cargo enhancements before this can work cleanly.

@cuviper
Copy link
Member

cuviper commented Sep 18, 2016

It wouldn't be so bad if it degraded better, but raw math typesetting is really ugly IMO.

@hauleth
Copy link
Member Author

hauleth commented Sep 18, 2016

Yeah it is a shame, but currently there is no other way to achieve that. We could although try to propose such change for Cargo.

@hauleth
Copy link
Member Author

hauleth commented Sep 18, 2016

However I would love to have possibility to use ASCIIDoc instead of Markdown in documentation as it is more suitable and have a lot more possibilities to work with. Unfortunately that isn't going to happen soon :(

@cuviper
Copy link
Member

cuviper commented Sep 19, 2016

IMO, the cosmetic improvement when this works right is not enough to justify the problems.
If Cargo can be improved to reliably integrate this, that will probably tip the scales.

@homu
Copy link
Contributor

homu commented Dec 6, 2016

☔ The latest upstream changes (presumably #246) made this pull request unmergeable. Please resolve the merge conflicts.

remexre pushed a commit to remexre/num that referenced this pull request Jun 1, 2017
@cuviper
Copy link
Member

cuviper commented Oct 7, 2017

Closing as a stale PR. I'd rather wait for properly integrated support in cargo and/or rustdoc.

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.

4 participants