-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Sundown backend for rustdoc #1555
Comments
https://github.com/tanoku/sundown for reference. And yes, we should probably have a rustdoc mode that emits "finished" HTML renderings directly. |
I'd be interested in working on this. I like the idea of rustdoc being distributed and updated by cargo. However, I have some other concerns that should probably be split off in another ticket (maybe one already exists?) I think it will be important as people begin writing more bindings for Rust. The thing is, that it would be nice if rustdoc could just distribute the C files as part of the build, to minimize the need to build and install a dynamic library. However, I see no way of having Cargo handle this at the moment as it only builds crates - for comparison, GHC accomplishes this by just accepting C files on the command line and giving them to gcc appropriately as part of the build/link. So that's one thing (just give any c/cpp files to rustc as part of the build) I think has a pretty good power-weight ratio. In general I tend to use this kind of feature a lot to bind libraries in a 'standalone' manner - many small libraries such as sundown, leveldb, etc. can be included in the source without much hassle and the need for external installation (and in the case of both sundown and leveldb, there is no Furthermore, this kind of support in the frontend/cargo makes it much easier to write rust libraries that have C wrappers for libraries that do exist on the system. If you have a C++ library like Finally, one point worth considering too is that, in GHC for example, C files you give it can include FFI headers and all sorts of stuff from the runtime system because it sets In general I don't know what this means for native functions, since native modules depend on the name of the module/ This problem can be attacked multiple ways. They all involve Cargo, really. It can handle all this logic of passing C shims to Sorry for this being long, it perhaps should be split up into multiple tickets. So please let me know if this is way off base, or sounds crazy, etc. Maybe nobody even wants to be able to do this, maybe it's already done and this ticket is easy? I find myself running into this case a lot, personally. If this seems like a good idea though, I'd be more the happy to make a ticket and begin hammering away. |
@thoughtpolice Are you still interested in working on this? (Looks like #1850 blocks it.) |
@catamorphism Yes, I am still interested in working on this. Sorry for the absence, I've had a lot of my spare cycles taken recently by a new job. #1850 does indeed block this issue quite heavily at the moment it seems, but @graydon proposed bundling clang with the LLVM repository that Rust uses in #2084. Another alternative is simply calling out to the system |
@thoughtpolice Great, I'll leave this open but consider it blocked for now. |
This continues to be blocked on rustpkg being in a better state. |
There are many differences between the markdown dialects used by pandoc and github, so we would have to pick one. For example, both support syntax highlighting and tables but they don't agree on a syntax. The "standard" markdown subset is very crippled so sticking to that isn't going to be enough. Pandoc is the nicest superset out there, but it's a very heavy dependency to have. |
I idly wonder if there is (or if one could make) a sundown backend for pandoc. |
If/when we have a doc generator in Rust, it'd be worth reconsidering this issue. |
The current consensus is that we're going to use pandoc. We'll have a pure-Rust, pandoc-compatible markdown renderer for fallback when pandoc isn't available. Closing. (cc @Seldaek, @thestinger) |
See #9377 for follow-up. |
Sundown is the C markdown parser/renderer used by GitHub. We'll start by using an external markdown or pandoc, but eventually it might make sense to integrate a markdown library. Probably we would want to do this by creating an external rust-sundown cargo project, and either integrate cargo into the rust build or just move rustdoc out of the rust repo.
The text was updated successfully, but these errors were encountered: