Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Support Markdown syntax via commonmark-hs #794

Open
@harpocrates

Description

@harpocrates

@jgm @alexbiehl @gbaz This is following up the discussion in #729.

I'm opening a new issue despite #244 and #570 because I'd like to focus on the particular issues around supporting Markdown syntax via commonmark-hs.

As per #729 (comment), I've gone ahead and

All of this is very quick and dirty (and in a separate branch) - I'm just trying to get a feel for the library. Still it is nice to see end to end results:

module Mark where

-- | An emphasized _foo_ and a linked 'foo'.
-- Some math I like: $\int_{\partial \Omega} \omega = \int_\Omega \partial\omega$
--
-- A list of things:
--
--   1. First item
--
--      ```
--      some code
--        block
--      ```
--
--   2. Some sub-items
--
--       * sub-item1
--       * __sub-item2__
--
foo :: Int -> Int
foo = undefined

Output:

screen shot 2018-04-04 at 2 49 33 pm

@jgm My first impression of the API is very positive: I very much like the idea of slicing the problem along the dimensions of SyntaxSpec. I definitely think this is going to be extensible enough for Haddock. Some more basic questions:

  1. What is Rangeable for? Is this something Haddock might want (or is range _ x = x enough)
  2. What is the motivation for distinguishing lineBreak and paragraph? When are both used?
  3. What is referenceLinkDefinition?

@gbaz @alexbiehl How can Haddock start using commonmark-hs? I am completely unfamiliar with what needs to happen from a vendoring/dependency perspective. More generally, can I start making some PR's to prepare for eventual integration (i.e. small changes to Documentation.Haddock.Types)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions