-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo doc
could support building/testing standalone markdown files
#739
Comments
Right now, it appears that rust-lang/rust uses pandoc to build its docs. It seems like it would be nice to go ahead and get this moving forward so that dependency could be dropped. Two questions, therefore:
|
I'm not aware of anything that's being done. I don't actually think pandoc is used anymore, all that is stale. |
Ah, interesting. I'll go read the makefile; if nothing else I can submit a PR to update that. |
I was editing but since you replied, I'll make it a new comment: I don't actually think pandoc is used anymore, all that is stale. It was being used to generate PDF and EPUB, but we don't do that anymore. You'd basically need a way to tell cargo to invoke |
One quick question about that: I assume you're meaning top-level
Or am I misreading you? Also, would it make sense to include the README.md file if one is supplied—as the index, perhaps? Fair warning: it'll probably take me at least a month to implement, if not more, but I'd like to give it a go. I'll probably be inhabiting #rust an awful lot on the weekends I work on it. 😛 |
I've thought about this a bit in the past, and the general idea is something like:
Feel free to reach out to me with any questions! |
@alexcrichton, very good. The reason I was thinking to use * I was also hesitant initially because I was remembering repository size problems problems with large moves in Mercurial, but that's not a pain point for Git, so. |
@alexcrichton and @steveklabnik, how should this interact with (including just ignoring it) rustbook? |
I don't have super strong opinions about /src/doc vs just /doc, but I think we'd prefer to root everything in /doc as it seems to fit the conventions of other projects in other languages. The reason the compiler does this is that the top level /doc is actually where all the generated documentation goes. I... don't actually know why cargo does it! I'm not currently aware of any conventions externally in the community about this, I wouldn't expect there to be too much buy in to either scheme just yet though. I'm also fine just not worrying about rustbook for now, conventions can always be adapted! |
Yeah, I feel the same as @alexcrichton, basically. Same with 'dont worry about Rustbook'. |
Excellent—just wanted to check that box before proceeding. I'll go ahead with the root docs directory! Hopefully starting in on it a bit this week(end). |
…labnik Per @steveklabnik's comment [here](rust-lang/cargo#739 (comment)), the Pandoc components of the Makefile are no longer used, and as such the corresponding components of the documentation are out of date. - I've removed the Pandoc (and therefore also LaTeX) elements of the makefile and confirmed that the build proceeds correctly. - I updated the documentation to reference `rustdoc` and of Pandoc. r? @steveklabnik
Would these generated HTML files (optionally?) include the crate index side bar and the search bar? |
While I haven't had a chance to dig in yet courtesy of start-of-the-semester busyness, my tentative plan is to make those available, yep. Presumably with an optional argument to the command, similar to how you can specify a CSS file or other HTML to include now.
|
👍 |
Just a quick update: I've spent several hours last week and expect to spend several more this weekend familiarizing myself with the way |
@chriskrycho awesome! Feel free to ask any questions here or on IRC if you run into any speed bumps! |
Bump. Any progress on this @chriskrycho? |
Alas: no. School and work this semester have taken up more time than I’ve expected. It is still very much on my radar, but of course if someone else gets to it first… I won’t argue.
|
Just checking in: nobody has started work on this in the meantime, yeah? Maybe I should. |
No, I had an abortive start back in October or so, but nada since then. If you give it a go, I’d be happy to chip in.
|
Just as a consideration, how would we name these markdown files? Tread them the same way as .rs files so that I |
@chriskrycho BTW: I would also love to see this take off, so if you want to collaboratively start working on this again? I'm in. |
@hoodie in general, the idea would be that you'd write I'm skeptical of making readmes into module-level documentation, but possibly as an |
I though, only explicitly if the |
I'm a bit confused about what the docs mean regarding standalone markdown files if they're not referring to this feature. Am I missing something obvious? |
That's what I thought as well. I tried putting a markdown file in my Minimal example: $ cd /tmp
$ cargo new dummy && cd dummy
$ cat > src/extra_docs.md << EOF
% A Title
# Heading 1
Lorem ipsum...
EOF
$ cargo doc --open
$ find ./target/doc -name "*extra_docs*" In this case I'd expect the This was done using nightly |
@nathanaeljones @Michael-F-Bryan those are the docs for rustdoc. Rustdoc can do this. |
cargo-external-doc is really nice. But it would be great to have this directly integrated into cargo. That way I can use docs.rs instead of hosting my docs on github. |
@alexcrichton I'm trying to build doc for a project atm; and not having the md files merged into the Is it really necessary to do all those things before you can simply reference the md files from the generated doc? |
@Zteve I'd personally prefer a fully fleshed out implementation, yes. Half-baked implementations just get bugs opened against them and I usually end up personally having to fix them, which I'd ideally prefer to head off at the beginning. |
@alexcrichton Fair enough; sentiments I can relate to. Go to it, then :-D |
I came across this and #1016 after thinking of workspace documentation. It'd be nice to have |
While we wait for rust-lang/cargo#739 to get resolved, we hardcode the rustdoc template in bin/doc so that we can generate a nice index page for our docs. This hardcoded template has diverged a bit from rustdoc; update it to accordingly.
If you want a hacky shell/jq script to do that in the meantime, here's what we're using at @MaterializeInc: https://github.com/MaterializeInc/materialize/blob/master/bin/doc |
Hey I'm interested in trying to tackle this! Caveat, first time attempting to contribute to cargo and this old of an issue is pretty intimidating. Reading the contributor's guide right now (what a great doc), and this issue is missing a lot of labels? Could likely use an area, feature accepted (if it is?), mentor maybe? I'm planning to start reading up on this today, and will hopefully be able to post a design (or at least a list of questions) soon. I have steve's work from 5 years ago as a bit of a start: #2256 |
E.g. project specific guides/tutorials, like rust-lang/rust itself.
See also
The text was updated successfully, but these errors were encountered: