Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Use Pandoc for Textile <> MD and add JIRA's extras #12

Open
FokkeZB opened this issue Jun 16, 2016 · 2 comments
Open

Use Pandoc for Textile <> MD and add JIRA's extras #12

FokkeZB opened this issue Jun 16, 2016 · 2 comments

Comments

@FokkeZB
Copy link
Owner

FokkeZB commented Jun 16, 2016

http://pandoc.org/
http://pandoc.org/try/
https://answers.atlassian.com/questions/31681034/how-different-is-jira-markup-from-textile

@roryokane
Copy link

Note that Pandoc is a Haskell library that also provides a command-line tool, while this project, J2M, is a JavaScript library. That would make it difficult to call Pandoc from J2M unless this tool were changed to be a command-line tool or to have a separate server component that ran Pandoc.

It is possible to embed Pandoc in the browser: http://markup.rocks/ (source code) does it by compiling the Haskell to JavaScript using GHCJS. However, this involves a 2.2 MB initial download of the generated JavaScript.

So these are the options for improving the parsing:

  • require local installation of J2M and Pandoc, and get rid of the website component
  • add a server-side component that runs Pandoc, and host it on the web along with http://j2m.fokkezb.nl/
  • embed Pandoc as a library, the way markup.rocks does it
  • give up on integrating Pandoc; write custom conversion code on top of existing Markdown and Textile parsing libraries for JavaScript

To give more detail on the non-Pandoc option, there are existing libraries that can parse and generate Markdown (CommonMark), and that can at least parse Textile (textile.js). They each have their own AST format which you could use as J2M’s internal standard representation. Or you could convert both Markdown and JIRA to HTML before converting them to the other format. Whether you use Pandoc or a native JavaScript library to parse Textile, you would still first have to write code to convert between Textile and JIRA markup, in both directions.

@FokkeZB
Copy link
Owner Author

FokkeZB commented Mar 31, 2017

There might be some Node.js wrappers:
https://www.npmjs.com/search?q=pandoc

Anyway, if you want to give it a go, be my guest!
Unfortunately I personally don't have time for it atm.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants