@ttscoff Yesterday, Pandoc added support for compiling to WASM. I’ve been waiting for this for a long time with the hopes of somehow it could be wrapped for use in a-Shell by @nholzschuch to finally have Pandoc on the iPad. It looks like it still might be complicated.

This morning while I was looking at it, I wondered if the WASM version might be away to have Pandoc work in the App Store version of @marked 3.

https://pandoc.org/app/

https://github.com/jgm/pandoc/tree/main/wasm

https://github.com/holzschu/a-shell/issues/10#issuecomment-3847416231

pandoc for the people

@ttscoff @nholzschuch @marked Not that you need more features. :) But I thought I’d mention it.

Since it’s GPL2, it probably would need to be downloaded by the user, but WASM should get around the sandbox-restrictions, right?

@somelinguist @ttscoff @nholzschuch I’ll look into it. But I’m hoping that my Apex project will allow most users to do what they would need pandoc for without needing pandoc.

@marked @ttscoff @nholzschuch Definitely. As I’ve been looking into it, I’m not sure how well the WASM version would work for most of my projects either (I have several filters, including pandoc-crossref, etc), especially on Mac where I can just have native Pandoc.

I just think it’s cool.

I still plan on getting the non-MAS version of Marked when it comes out. :)

@somelinguist @marked @nholzschuch Out of curiosity, is Apex missing any features you’re using Pandoc for? Most users primarily need bib support, which Apex does well, but I’ve supported a lot of the extensions as well. Apex is a C library I can build right into Marked, which is best for both speed and security.
@ttscoff Mainly, a lot of my projects have PDF as one output, so I think need to keep Pandoc for that. Several I also want to have HTML output as well. The projects use a lot of Lua filters, some of which work for both PDF and HTML, others are specific to one output. If didn’t want the PDF output still, I could probably port a lot of the filters to Apex plugins.
@somelinguist Oh, I wasn't suggesting you would get rid of Pandoc in general, just that you wouldn't need it as a custom processor in Marked. Apex can read the same files you're exporting to PDF and work generate the preview in Marked. You would still use Pandoc for command line PDF output, as that's not something I'm getting into with Apex.

@ttscoff Yeah, I understand what you mean.

It’s just currently I rely on several Lua filters to transform things (esp. fenced divs), some of which I’ve modified for my purposes from others. For example, this is one of the most important for most of my projects that works with both PDF via LaTeX and HTML (https://github.com/cysouw/pandoc-ling).

Personally, I’d much rather be writing filters in something other than Lua, but there are lots of useful ones out there because Pandoc handles them out of the box.

@ttscoff But the syntax for the fenced divs that the filter above uses is readable enough that I don’t have any problems previewing many other aspects of the projects with Apex without the filter
@somelinguist But Apex already supports that syntax, as well as plugins in any language (just stdio pipes).
@ttscoff Yes, but the filter looks for the the specifics class of divs and then transforms the contents to numbered lists, or interlinear glossed examples. I could probably write an Apex plugin in to do the transformations but the current Lua filter already works. But because Apex recognizes the fenced divs, I can still see the original text at least, which still gives a quick decent enough preview.
@ttscoff I might actually take the time to write an Apex plugin for it if I get time or run into something I need to fix something with the Lua filter. I’ve customized or added lots of things for it for the PDF output. Which means I’ve learned a decent amount Lua at least. 😂 But other language options would be easier.

@somelinguist My work this morning might be of interest (inspired by you) https://github.com/ApexMarkdown/apex/wiki/Filters

Ideally it works with existing Pandoc Lua filters, and also incorporates Pandoc's JSON filtering. I'm definitely not trying to entirely replace Pandoc, but I want Apex to be a viable solution from within Marked that greatly reduces the need to run Pandoc as an external process.

Filters

Contribute to ApexMarkdown/apex development by creating an account on GitHub.

GitHub
@ttscoff That sounds awesome! I’ve been away from the computer for the weekend, but I’m going to forward to trying this.