Skip to content

Migrate from hoedown to pulldown-cmark for markdown parsing #38400

Closed
@frewsxcv

Description

@frewsxcv
Member

For markdown parsing, we currently use rust-lang/hoedown (based on hoedown/hoedown). There's a (somewhat) new Markdown pull parser entirely written in Rust: google/pulldown-cmark. Some reasons to switch:

  • All the safety guarantees that come with anything written in Rust
  • Rust contributors don't need to know C if they want to make changes upstream
  • Don't need to maintain our own C hoedown bindings / pulldown-cmark has an idiomatic Rust API
  • It uses Cargo, which should make integration easy

Activity

frewsxcv

frewsxcv commented on Dec 15, 2016

@frewsxcv
MemberAuthor

cc @rust-lang/tools @rust-lang/docs

@GuillaumeGomez has already expressed interest in making the changes for this transition.

added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
on Dec 15, 2016
frewsxcv

frewsxcv commented on Dec 15, 2016

@frewsxcv
MemberAuthor

Via #29329 and critiqjo/rustdoc#2, it looks like @critiqjo has already made some progress on migrating to pulldown-cmark.

alexcrichton

alexcrichton commented on Dec 16, 2016

@alexcrichton
Member

We're not quite ready to pull in crates.io dependencies into the build system yet as we've still got makefiles that don't work with that. On 2016-02-02, however, I'll be deleting the makefiles with glee at which point we are capable of pulling in dependencies from crates.io!

frewsxcv

frewsxcv commented on Dec 16, 2016

@frewsxcv
MemberAuthor

2016-02-02

I'm going to guess you meant 2017 here

alexcrichton

alexcrichton commented on Dec 16, 2016

@alexcrichton
Member

Oops, yes!

steveklabnik

steveklabnik commented on Dec 16, 2016

@steveklabnik
Member

I have been very interested in this for a long time.

matklad

matklad commented on Dec 16, 2016

@matklad
Member

Some random thoughts:

  1. Are these two implementations compatible? Probably not, and that means some docs might break a little bit.

  2. Perhaps this is the chance to specify what exactly is the markdown dialect of the docs?

  3. What's the current plan about using ::foo::bar::baz syntax for cross-link the docs? If we decide to add some kind of linking, will it be compatible with pulldown-mark?

frewsxcv

frewsxcv commented on Dec 16, 2016

@frewsxcv
MemberAuthor

Are these two implementations compatible? Probably not, and that means some docs might break a little bit.

pulldown-cmark is an implementation of CommonMark.

Hoedown follows the original markdown document, but there are talks about switching to CommonMark.

From what I understand, one of the main reason CommonMark exists is because the original Markdown specification is so vague and there were many subtle differences in implementations. More info in this thread. I'm not familiar enough with either spec to know specific differences.

What's the current plan about using::foo::bar::baz syntax for cross-link the docs? If we decide to add some kind of linking, will it be compatible with pulldown-mark?

This is what led me to open this issue. There aren't any concrete plans right now for this syntax, but if this something that is decided cmark-pulldown can help. There are talks about adding a basic generic directives/plugins syntax into CommonMark which would be great since we wouldn't need to invent our own syntax. Though, if we did invent our own syntax, from what I've seen of the pulldown-cmark API, it seems it would be easier to implement in that than Hoedown.

18 remaining items

Loading
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-enhancementCategory: An issue proposing an enhancement or a PR with one.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

        Participants

        @steveklabnik@alexcrichton@frewsxcv@Ericson2314@critiqjo

        Issue actions

          Migrate from hoedown to pulldown-cmark for markdown parsing · Issue #38400 · rust-lang/rust