Skip to content
This repository was archived by the owner on Jul 28, 2022. It is now read-only.
This repository was archived by the owner on Jul 28, 2022. It is now read-only.

Consider separating out Options from Doc type #31

@tysonzero

Description

@tysonzero

I am assuming the reason they are intertwined is because of the ToMarkup instance, but IMO how the markdown doc is converted to Html is not an inherent part of the markdown itself.

For my use case I will probably never actually use the ToMarkup instance, as I'm writing a custom markdown renderer on top that outputs a Miso View. So the Options will never actually be used.

When I saw the Options in the Doc I ended up just source diving to see what exactly it does, as from the surface it looks as though the markdown function itself might use it, which it basically doesn't (except for the debug flag which IMO isn't needed since Doc has a Show instance).

I think the developer experience would be nicer if Options was removed from Doc, and renderDoc was tweaked to have type Options -> Doc -> Html. As that would make it obvious that Options is not for markdown parsing or manipulating itself, but purely for outputting it to Html.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions