15 ms·
Pandoc 3.0
- tetris11 4y agofantastic software, never build it from source, or if you have to, make sure you have an OS that bundles all the Haskell dependencies into a single meta package
- mrspuratic 4y agoI did this years back, it took, ehm, quiet some time. I use a binary now :D ISTR it starts with building a self-hosting Haskell compiler...
- gregwebs 4y agoHaskell tooling went from awful to best in class after stack came out. Look for “Quick stack method” in the installing page- It should be easy to build from source now with just a few commands. No doubt will take a long time to compile all the packages and you might still have issues tracking down any non-Haskell dependencies (c libraries).
- bitmapper 4y agothis got replaced with ghcup iirc
- jesprenj 4y agoIt or one of its libraries did not compile for me OOTB in Gentoo. Granted it's marked as nonstable (~*). That's unfortunate, because I really liked to use it when I was mainly running Debian. Though I didn't really put any debugging effort into making it work.
- Tyr42 4y agoYeah, I ended up upgrading my machine's ram when I was building it from source. It's sizable.
- josephcsible 4y agoPandoc is really easy to build with just Haskell and Cabal installed via ghcup, without needing any Haskell packages from your distro.
- kelsolaar 4y agoQuarto, excellent software for building publications, websites, etc…, is leveraging Pandoc: https://quarto.org/ https://quarto.org/
- CJefferson 4y agoI love pandoc. With it's lua filters, I love using it for generating html and blog posts, one thing which always annoys me about most static website generating tools is they make you use some very limited templating language, when I just want to use a proper programming language. My only irritation -- while I understand why one would want to do it for neatness, it's annoying that the "pandoc" package no longer provides the "pandoc" program! Maybe instead introducing "pandoc-core" and renaming "pandoc-cli" to "pandoc" would be better (it would certainly avoid breaking existing scripts, like mine).
- y04nn 4y agoIf I understand correctly the package pandoc-cli installs the pandoc binary [1], so it shouldn't beak that many scripts. [1]: https://github.com/jgm/pandoc/blob/535bd0393fe7b2f287903b942c96dab1139a7e90/pandoc-cli/pandoc-cli.cabal#L65 https://github.com/jgm/pandoc/blob/535bd0393fe7b2f287903b942...
- sramsay 4y agoThis (I also generate my blog using pandoc). In another case, I wanted to go from Markdown to groff -mom and it was a totally straightforward matter with a custom Writer in Lua.
- asicsp 4y agoI use pandoc to convert GitHub style markdown to PDF/EPUB ebooks. The default output is good and there are plenty of customization options too. I didn't know LaTeX/CSS but stitched a few things together with help from stackexchange sites to customize the output produced. Later came to know there are third-party templates that I could've used/started with.
- toastal 4y agoOne day I wish to see the AsciiDoc(tor) Reader. I'd love to be freed from Ruby as AsciiDoc is superior to Markdown and most other lightweight markup syntax options in features and syntax. This lack of features is why we have an incompatible group of Markdown syntax forks (aka "flavors" to mask that forks are incompatible).
- thekaleb 4y agoPandoc is written in Haskell.
- chungy 4y agoAsciiDoc is written in Python. Though when it comes to annoyance with Markdown forks: AsciiDoctor is basically that to AsciiDoc. It's mostly compatible, but when it isn't, it really bites.
- toastal 4y agoThe more important part is that you end up with a binary instead of needing an interpreted language which makes the tooling a mess. Python and Ruby are the same thing to most people.
- binarycoffee 4y agoAs others wrote, Pandoc is Haskell so it compiles to a fairly efficient binary. But more importantly, unlike the various Markdown flavors or AsciiDoc, it is incredibly extensible thanks to the combination of custom filters and the possibility to add HTML classes and attributes. One can write filters to leverage the class/attribute information and perform transformations at the AST level, which basically lets you define a DSL with an arbitrary number of custom elements. I wrote a collection of filters for the publication of a large online legal playbook. Not only did Pandoc make it possible to introduce different kind of custom elements that don't exist in plain Markdown or AsciiDoc, but by using different filters it was possible to use a single Markdown source to generate both the book and various summaries such as a list of examples, a list of civil code clauses etc. I don't know Haskell that well so I used Rust for the filters, but that worked very well. Pandoc is IMO a very underrated tool.
- bronikowski 4y agoI love Pandoc. I don't often write "documents for office consumption" but when I do, I just write a markdown file and spit out docx or PDF. I was congratulated more than once on how coherent my documents are in their structure. Plus, having a git history is a great boon.
- qbasic_forever 4y agoOh that's a great idea! I wish I had pandoc in my university days--I ended up writing a lot of (non-technical) papers in latex just because I hated using word for the task.
- yabones 4y agoIt's also not too difficult to hook up a GH actions job to generate the documents with pandoc and spit them out directly into dropbox/sharepoint for "non-techie consumption". Great for semi-technical documentation that bis/sales/support people need to be in the loop on.
- snet0 4y agoI've been using Pandoc to write Latex-lite for a couple years now. Just write .md files with basic Markdown syntax for all the major text content, and add some Latex when I need to do something more particular. Best of both worlds, really.
- jawadch93 4y ago[dead]
- Brendinooo 4y agoI'm in a job where I pretty much never need to output a PDF, but whenever the occasional thing comes around, pandoc is always there for me. Such a useful tool.
- mrehler 4y agoOut of every tool I’ve ever used to make a .docx file from Markdown, Pandoc is the only one that has consistent results with converting Markdown headers to Word styles rather than just a bigger font size. Lots of Markdown tools in my tool belt, and would love to know of any more that can do this, because it’s really useful on the (unfortunate) occasions something needs to live as a Word doc.
- Veen 4y agoI do wish there was an easy way to create Word document titles from H1s in Markdown. It makes sense that they should be converted to top-level headings, but it adds an annoying bit of friction to my workflow.
- fiddlosopher 4y agoOh, but there is! pandoc --shift-heading-level-by=-1 input.md -o output.docx This will promote level-2 headings to level-1, and promote a level-1 heading at the top of the document to the document's title.
- Veen 4y agoOh really? I've tried --shift-heading in the past and it worked to move headings up a level, but not to the title. I'll have to read the docs more carefully and give it another go. Thank you.
- cosmic_quanta 4y agoThat's great news. I've been waiting for years for a dedicated 'Figure' element. The workaround was pretty brittle. It'll make pandoc-plot [0] easier to maintain as well. [0]: https://github.com/LaurentRDC/pandoc-plot https://github.com/LaurentRDC/pandoc-plot
- gpoore 4y agoI've been frustrated by Markdown previews not supporting Pandoc features, so I created a Pandoc-based Markdown preview for VS Code [1]. The preview supports all Pandoc extensions to Markdown syntax, because Pandoc itself generates the preview. There is also optional support for code execution with Jupyter kernels. I'm currently in the process of adding support for non-Markdown formats (including scroll sync), plus taking advantage of some of the new Pandoc 3.0 features. [1]: Examples and animations: https://codebraid.org/presentations/scipy2022/ https://codebraid.org/presentations/scipy2022/. Installation for VS Code: https://marketplace.visualstudio.com/items?itemName=gpoore.codebraid-preview https://marketplace.visualstudio.com/items?itemName=gpoore.c.... Installation for VSCodium: https://open-vsx.org/extension/gpoore/codebraid-preview https://open-vsx.org/extension/gpoore/codebraid-preview.
- dosshell 4y agoDoes that mean that you are adding support for latex etc? this is awesome, thank you for your work.
- gpoore 4y agoYes, I'm adding support for arbitrary text-based formats, including LaTeX. So it will be possible to write LaTeX and see a live HMTL preview generated by Pandoc. In principle, it should be possible to create a PDF preview with proper SyncTeX support for synchronizing LaTeX source and PDF preview locations, but that gets complicated when Pandoc+LaTeX generate the PDF. It may be best to leave LaTeX-PDF previews to dedicated LaTeX previewers that don't involve Pandoc.
- noiwillnot 4y ago> Yes, I'm adding support for arbitrary text-based formats That would be extremely powerful, and also would allow you to differentiate your extension from the Quarto one.
- gpoore 4y ago
- remoquete 4y agoOne new feature that will make Python documentarians happy is the `—-list-tables` flag for rST output: You can now convert any table to the list table syntax of reStructuredText, which is, in many's opinion, superior to classic tables with ASCII borders.
- zdw 4y agoDoes it still automatically generate "smart" quotes (which are anything but) from traditional ones during conversion? Love the tool, but this is the most awful default setting I've seen in a program in a while, especially if you include any code that depends on quotes not being mangled.
- johnday 4y agoIf you specify that you just want bog-standard markdown then it will not generate smart quotes. To wit: - `pandoc foo.tex -t markdown foo.md` will not produce smart quotes. - `pandoc foo.tex -t markdown-smart foo.md` will produce smart quotes.
- zdw 4y agoI think the examples you give might be the opposite of what happens - in the docs: https://pandoc.org/MANUAL.html#extension-smart https://pandoc.org/MANUAL.html#extension-smart The meaning of the -smart extension on option names is inverted in some cases, and enabled by default on markdown output.
- leephillips 4y agoIt’s configurable, and, in any case, Pandoc will not alter the quotes in your code blocks nor in inline code.
- simonmic 4y agoThis I agree with. I don't know the exact current status, but having debugged related rendering issues many times over the years, I wish it had always been hard to enable conversion to so-called smart quotes, rather than hard to prevent it.
- simonmic 4y agoI should add: the above is about the only quibble I can think of, which is impressive. I love love love pandoc! It's a highly dependable and capable swiss army docs tool. I use it constantly, eg to help generate CLI help text and HTML, man, info and plain text manuals from (mostly) markdown sources. Huge congrats and thanks to the developers for their hard work and for this latest release.
- jszymborski 4y agoMan I'd love an asciidoc(tor) reader for pandoc sooo much. The existing toolchain is a big pain.
- gyulai 4y agoI've been looking for a tech stack to replace latex for decades now. As a very recent development, the combination of pandoc+weasyprint (plus a little bit of homebrewed pandoc filter magic) has now become good enough for my needs, and I have finally been able to take the plunge. Feels great. For those who are a little less adventurous and who happen to be in the social sciences, humanities, journalism, etc., pandoc+msword is also definitely worth looking into. It's a much better tech stack than standalone msword. -- It's really only in the STEM fields that, in my mind, there really is no way around latex.
- tikhonj 4y agoNo way around LaTeX, but Pandoc + LaTeX is still a much nicer experience than plain LaTeX in my experience.
- adityaathalye 4y agoPandoc powers my little static site maker: cf. https://github.com/adityaathalye/shite/blob/master/bin/templating.sh#L112 https://github.com/adityaathalye/shite/blob/master/bin/templ... __shite_templating_compile_source_to_html() { # If content has front matter metadata, it is presumed to be in a format # that the content compiler can safely process and elide or ignore. local file_type=${1:?"Fail. We expect file type of content like html, org, md etc."} case ${file_type} in html ) pandoc -f html -t html ;; md ) pandoc -f markdown -t html ;; org ) pandoc -f org -t html ;; esac }
- BeetleB 4y agoMine too. I author in org and have a plugin that converts the org files to rst files.
- adityaathalye 4y agoAh, I make it compile partial HTML (just page content), and stick that into my own HTML page template(s) (written as HEREDOCS :D). That's part of the joy of using Pandoc. I can pipeline it, no problem. Like this: cf. https://github.com/adityaathalye/shite/blob/master/bin/templating.sh#L219 https://github.com/adityaathalye/shite/blob/master/bin/templ... cat "${watch_dir}/sources/${url_slug}" | __shite_templating_compile_source_to_html ${file_type} | __shite_templating_wrap_content_html ${content_type} ${watch_dir} | __shite_templating_wrap_page_html \ > "${watch_dir}/public/${html_url_slug}" Templates look like this. Notice the $(cat -) in the middle. That's how the HTML content produced by Pandoc gets injected in the middle of everything else. shite_template_common_default_page() { local maybe_page_id=${shite_page_data[page_id]:+"id=\"${shite_page_data[page_id]}\""} local maybe_canonical_url=${shite_page_data[canonical_url]:+"<link rel=\"canonical\" href=\"${shite_page_data[canonical_url]}\">"} cat <<EOF <!DOCTYPE html> <html lang="en"> <head> $(shite_template_common_meta) $(shite_template_common_links) ${maybe_canonical_url} </head> <body ${maybe_page_id}> <div id="the-very-top" class="stack center box"> $(shite_template_common_header) <main id="main"> $(cat -) </main> $(shite_template_common_footer) </div> </body> </html> EOF } edit: substantiate Pandoc's role.
- quijoteuniv 4y agoDo you want to change yve world? Write software like this. Pandoc is great.
- amai 4y agoSince Pandoc has Lua inbuilt I wonder if it can also run LuaLatex in full? Because then it could support really all features of LaTeX and become a kind of SuperLaTeX.
- account-5 4y agoLove this program. Means I can write in plain text, markdown or zim-wiki syntax, and export to word no hassles. If I'm writing markdown I use pandocs version as it has support for advanced tables. Brilliant software.
- jph 4y agoPandoc is such a great conversion program, and this new 3.0 release has so many improvements, especially for figures. I write in markdown and export to PDF and using pygments for code syntax coloring, with .tex files to adjust layouts, tables, and the like. https://github.com/SixArm/pandoc-from-markdown-to-pdf https://github.com/SixArm/pandoc-from-markdown-to-pdf
- maweki 4y agoPandoc is a great piece of software. As a university teacher and researcher, I use it in three ways: 1. I write markdown for my website and for the websites for my research projects and simply generate standalone html out of it. Done. 2. When we create electronic exams, the exam platform takes questions using a html-backed rich text editor. We write down our exam questions using markdown, create html document fragments, that we simply paste into the exam platform. 3. When students do electronic exams, we receive xml files from our exam platform. We use python to pass on submissions to different submission checkers (akin to autograders or static analysis) and create yaml files with the student submission and grading suggestions and static analysis annotations. We manually review and grade and comment within the yaml file (that works incredibly well), collect all the data using python and generate markdown reports for each student, including their submission, our comments and scoring. We pass this markdown through pandoc, creating well layouted pdfs which we either print and hand out or send out electronically. Pandoc fits our yaml+markdown-based processes very well. Only for the actual research papers we still write LaTeX and build pdfs without pandoc.
- WolfOliver 4y agofor the research papers which you write in LaTeX you should have a look at MonsterWriter. Disclaimer: I'm the creator of MonsterWriter and very keen to receive feedback and learn about how universities and their students write papers, thesis, ...
- Terretta 4y agoIt's cool you're using SetApp, thank you. For HN reading along, SetApp is a way to distribute apps and get paid outside the app store. Really, that exists. // Disclosure: Unless you are disavowing your ability as author to offer a recommendation that can be trusted, you probably mean "Disclosure" not "Disclaimer". Disclosure = here is my potential bias. Disclaimer = YMMV, no warranties express or implied.
- WolfOliver 4y agoYou can also download the app without SetApp. No Subscription needed!