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

rustdoc: literate rust #26097

Closed
RalfJung opened this issue Jun 8, 2015 · 6 comments
Closed

rustdoc: literate rust #26097

RalfJung opened this issue Jun 8, 2015 · 6 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

RalfJung commented Jun 8, 2015

It would be nice if rustdoc (or rustbook? Not sure which of the two fits better) could generate "annotated source" output: Given a Rust file, generate an HTML file with the source code in proper syntax highlighting, and with the comments interpreted and rendered as markdown. That would make it possible to write executable Rust code that is at the same time a readable document (for example, a tutorial). The result could be similar to Docco.

@steveklabnik steveklabnik changed the title rustdoc: Add support for "annotated source" mode rustdoc: literate rust Jun 8, 2015
@steveklabnik steveklabnik added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jun 8, 2015
@steveklabnik
Copy link
Member

Yes, this would be neat. We mostly try to keep feature requests on the RFCs repo, but have gotten lax about it, so I'm just going to leave this here for now.

@calebmer
Copy link

calebmer commented Apr 2, 2016

Has there been any update on this? I'm writing a trait which has a lot of functionality which can't be defined in the type system (not a problem with the rust type system, just my use case). So along with the trait I'm writing a test suite.

I'd like the test suite to be written in literate rust and have the rendered document be considered a “specification” for trait implementors.

Even if this is not a high priority feature, is there any preference/speculation on what the syntax would be so I could at least annotate my code even if the renderer isn't present yet? I was thinking about using comment strings prefixed with //*.

@steveklabnik
Copy link
Member

There has not. I wonder if it would take an RFC these days, since it would be a pretty major change.

@steveklabnik
Copy link
Member

steveklabnik commented Jul 8, 2016

Worth noting that rustdoc can already run over raw markdown files, with embedded code blocks. This isn't a true literate mode, but it does help when writing documentation, and can feel like literate code at times.

@killercup
Copy link
Member

This looks promising: https://github.com/pnkfelix/tango

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@steveklabnik
Copy link
Member

Triage: tango has you covered, and I don't believe this is going to land in upstream rustdoc any time soon. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants