mt-caret / pandoc-ghcjs

Universal markup converter

Home Page:https://pandoc.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pandoc-ghcjs is a project to make ghcjs builds of pandoc possible and reproducible.

Reproducibility is ensured via Nix flakes. Previous versions of pandoc-ghcjs were attempted with vanilla Nix, then reflex-platform, but was unable to get either to fully work.

Rough summary of changes

  • removed non-library modules
    • the main pandoc binary seems to stack overflow during linking, and can't get around it
  • removed anything that transiently depends on the following
    • lua
    • conduit (which depends on network)

Related links

  • markup.rocks: The original inspiration for this project. I was unable to build a working copy of this for use in my personal projects, which was why I started working on pandoc-ghcjs.
  • jgm#4535: Discussion around removing C dependencies in pandoc.
  • configuration-ghcjs.nix: Nix code that deals with various issues with haskell packages when compiling with ghcjs.
  • Using Nix to build multi-package, full stack Haskell apps: Blog post describing a large-scale ghcjs project that was instrumental in understanding Nix's Haskell infrastructure.

TODO

  • Try building example project that depends on pandoc-ghcjs
  • Write build instructions
  • Build using cabal (inside Nix) for shorter feedback cycle
  • For now I'm only thinking of getting this running on the browser, but in general seems useful to be able to use via node as well. Benchmarking should probably be done here as well.
  • Currently, large swathes of pandoc has been stripped out, which is pretty sad. Gradually adding back functionality by either implementing things in pure Haskell or switching out dependencies based on whether we're on ghcjs and is one goal.
  • Believe it or not, asterius actually successfully seems to build pandoc as-is (there's even a demo). Naively writing a demo for this resulted in very large wasm sizes (<40MB) which I couldn't reduce. Regardless, it'll be nice to be able to seamlessly build pandoc using asterius via a Nix flake as well.
  • Wondering what sort of breakage will occur when (if?) ghcjs is unified with ghc as mentioned here: Is GHCJS stuck on GHC 8.6.5?. Hopefully the build process can be made simpler/easier.

Work getting stuff into upstream

About

Universal markup converter

https://pandoc.org

License:Other


Languages

Language:Haskell 83.5%Language:Rich Text Format 8.7%Language:HTML 2.3%Language:Lua 1.9%Language:Roff 1.2%Language:Jupyter Notebook 1.1%Language:Shell 0.3%Language:Makefile 0.2%Language:Nix 0.2%Language:TeX 0.2%Language:Perl 0.1%Language:Smarty 0.1%Language:Emacs Lisp 0.1%Language:CSS 0.0%