Skip to content

Integrate mdbook into rustdoc #66249

Open

Description

@Ppjet6

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.

Activity

  1. Ppjet6 commented on Nov 9, 2019

    @Ppjet6
    ContributorAuthor
  2. added
    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Nov 9, 2019
  3. steveklabnik commented on Nov 11, 2019

    @steveklabnik
    Contributor

    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.

  4. GuillaumeGomez commented on Nov 15, 2019

    @GuillaumeGomez
    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?
  5. Ppjet6 commented on Nov 15, 2019

    @Ppjet6
    ContributorAuthor

    @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).

  6. jyn514 commented on Dec 15, 2020

    @jyn514
    Member

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

  7. steveklabnik commented on Jan 9, 2021

    @steveklabnik
    Contributor

    @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.

  8. changed the title [-]Add support for external markdown[/-] [+]Integrate mdbook into rustdoc[/+] on Jan 9, 2021
  9. added
    E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.
    on Jan 9, 2021
  10. jyn514 commented on Jan 9, 2021

    @jyn514
    Member
  11. Susurrus commented on Jan 9, 2021

    @Susurrus
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions