pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Support for Github "Alerts"

Open Sajjon opened this issue 1 year ago • 3 comments

Describe your proposed improvement and the problem it solves. Seems this (great) tool does not render Github Markdown "alerts", as Github does.

Pandocs rendering

pandoc

Githubs rendering

github

For this markdown:

> [!CAUTION]
> You **MUST** use the Rust programming language.

Using command:

pandoc --from=gfm --to=pdf -o PANDOC.pdf README.md

Would be nice to get the same kind of appearance as Github Markdown uses.

Describe alternatives you've considered. N/A

Sajjon avatar Aug 22 '24 09:08 Sajjon

This is perhaps a duplicate of https://github.com/jgm/pandoc/issues/9716

Sajjon avatar Aug 22 '24 09:08 Sajjon

No, it's not a duplicate of #9716, which concerns pandoc's markdown and not gfm. GitHub alerts are supported in gfm.

pandoc -f gfm -t native
> [!CAUTION]
> You **MUST** use the Rust programming language.
^D
[ Div
    ( "" , [ "caution" ] , [] )
    [ Div ( "" , [ "title" ] , [] ) [ Para [ Str "Caution" ] ]
    , Para
        [ Str "You"
        , Space
        , Strong [ Str "MUST" ]
        , Space
        , Str "use"
        , Space
        , Str "the"
        , Space
        , Str "Rust"
        , Space
        , Str "programming"
        , Space
        , Str "language."
        ]
    ]
]

The issue is that the writers don't by default do any special styling for this structure. See #9821 for a filter that may help with PDF output.

jgm avatar Aug 22 '24 15:08 jgm

For background see also https://github.com/jgm/commonmark-hs/issues/132#issuecomment-1856751436

jgm avatar Aug 22 '24 15:08 jgm