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

Integrate mdbook into rustdoc #66249

Open
Ppjet6 opened this issue Nov 9, 2019 · 8 comments
Open

Integrate mdbook into rustdoc #66249

Ppjet6 opened this issue Nov 9, 2019 · 8 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Ppjet6
Copy link
Contributor

Ppjet6 commented Nov 9, 2019

It doesn't seem to be possible to include external markdown files without using include_file!. By this I mean your file would have to be included in your code hierarchy and it's not possible to have it as a separate hierarchy.

This could be useful for getting-started (even though usually included in the README), debugging-tips, or various tutorials.

A few ideas where this could be used:

  • Be able to point rustdoc to some folder with markdown files, and it would render them all for the user to use freely in the code as normal links
  • Added as an entry in the left column alongside Module, Structs, Enums, etc. Either a single entry to an index that the user would have to create, or a custom hierarchy that the user would define.
@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Nov 9, 2019

@kinnison, @GuillaumeGomez

@csmoe csmoe added C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 9, 2019
@steveklabnik
Copy link
Member

There has long been a suggestion for "integrate mdbook into rustdoc and/or cargo doc", but I cannot find the existing ticket I thought we had.

@GuillaumeGomez
Copy link
Member

I think this is a good idea and something we might want to have on the long-term. However it brings some questions:

  • How should we render the markdown folder files? All in one page or a page for each file? Maybe we'd like a "book" tab in the docs? If so, what should it look like?
  • To include files/folders from markdown, what syntax should we use?

@Ppjet6
Copy link
Contributor Author

Ppjet6 commented Nov 15, 2019

@kinnison also raised the question of what to do with these links in reexported symbols (when they reference some file local to the repo that isn't in the one that reexports).

@jyn514
Copy link
Member

jyn514 commented Dec 15, 2020

This is doc(include), right? If so I think it should be closed in favor of #44732.

@steveklabnik
Copy link
Member

@jyn514 sorta; you can take it that way, or you can take it as "be able to make mdbooks with rustdoc too", that is, expanding rustdoc to not just be for API documentation, but for all documentation in your project.

@jyn514 jyn514 changed the title Add support for external markdown Integrate mdbook into rustdoc Jan 9, 2021
@jyn514 jyn514 added the E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. label Jan 9, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 9, 2021

Related: rust-lang/mdBook#1356

@Susurrus
Copy link
Contributor

Susurrus commented Jan 9, 2021

There is a related bug to this against Cargo as well: rust-lang/cargo#739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. 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

6 participants