1

It seems that both formats support tables, though they are completely different formats. GitHub Markdown supports embedding the relevant subset of HTML, though I'm not clear how, or if, this is possible in Hackage's markdown.

If this isn't possible, disabling the display of a region of markdown in the readme of the generated Hackage markdown would be acceptable, so that parts of the Readme that aren't supported by Hackage wouldn't be mangled in the resulting Haddock contents page output, e.g., at the bottom of this contents page.

bbarker
  • 11,636
  • 9
  • 38
  • 62
  • 1
    In source code files, I believe you can use `#ifdef HADDOCK` or something similar, with CPP on. Not sure on doc files. – chi Nov 21 '20 at 19:04
  • extra-doc-files sounds promising, though i need to try it out to be sure: https://cabal.readthedocs.io/en/3.4/cabal-package.html#pkg-field-extra-doc-files – bbarker Nov 21 '20 at 19:34
  • Using pandoc to convert the markdown table to HTML works well, however, it does appear that just putting HTML into the markdown file does not work well when it is converted to haddocks. – bbarker Nov 21 '20 at 20:44
  • 1
    How is this question related to Haddock? It seems to me that you want to know a table syntax for MarkDown that works both on GitHub and _Hackage_. Haddock also offers a [table syntax](https://haskell-haddock.readthedocs.io/en/latest/markup.html#grid-tables), but AFAIK Haddock is not a supported markup format for package READMEs. Please clarify your question. – sjakobi Nov 21 '20 at 21:02
  • 1
    This question seems related: https://stackoverflow.com/questions/41623846/which-dialect-of-markdown-does-hackage-use-to-render-readmes – sjakobi Nov 21 '20 at 21:43
  • 1
    I see, I updated to reflect it is more of an issue with hackage than haddocks. Also, it looks like there's a recent PR that may have a solution (or at least change the dynamics of the problem): https://github.com/haskell/hackage-server/pull/904 – bbarker Nov 21 '20 at 22:47

0 Answers0