Live data from Hacker News

Pandoc

pandoc.org

31–40 of 213 posts

Re: Pandoc

#31
Pandoc (or latex) + make + iNotifyWait work really well together for WYSIWYG like editing too:

  watch: $(ALL)
    while true; do \
    clear; \
    make $(WATCH); \
      inotifywait -qr -e close_write .; \
    done
"make watch WATCH=build" will now compile documents on every save. Works well for single documents, collections of documents or entire websites.

Re: Pandoc

#32

As a guy attempting to transition from macOS to Linux: Pages to anything else, please.

A quick Google suggests that the most straightforward way is to run an Automator script to convert everything to PDF using Pages itself.

Re: Pandoc

#33
I sometimes use pandoc to clean up my markdown-formatted documents, especially given its abilities to "wrap" text and add indentation-style whitespace that makes plain-text documents look nearly suitable for publishing as-is (almost kinda like RFC docs but without header/footer cruft).

There are a few things (in latest version, 2.2.3.2) that don't really survive round-trip from markdown back to markdown:

- reference-style links (e.g. `[foo][f]`). They are converted to inline links e.g. `[foo](http://...)`.

- setext vs hashmark headers. `foo\n=====` will get converted to `# foo`.

- markdown allows for forced-linebreak
s to be added with two trailing blank spaces at the end of a line. Pandoc escapes these with a trailing `\` at the end of the line.

These are only occasional nuisances, but overall the documents (at least in my experience) are not butchered.

I also occasionally go from markdown to docx for the purposes of uploading to google-docs and copy/pasting large sections into other docs. This is the only markdown-to-google-docs workflow I've found that works to preserve formatting. It's never really butchered anything, except a few times the syntax-highlighting for code-blocks gets confused and keywords get the wrong colors.

Re: Pandoc

#34

I love pandoc. I've been using it intermittently for years to turn my Markdown and org-mode documents into other formats. Just wish it would take Asciidoc as an input format.

Asciidoctor and the other asciidoc tools do the job that I use pandoc for: tables, custom numbering, all the other markdown extensions that one needs to be able to create a highly structured document. With Asciidoc, you don't need md extensions. It's all in there.

Re: Pandoc

#35
post #5

I use Pandoc to convert directories of Markdown files into static HTML websites. Here's the build command for responsive.style[1]: pandoc $file -f markdown -t html5 -H templates/header-prod.html -B templates/nav.html -A templates/footer-prod.html -o (echo "../$file" | sed '$s/\.md$/.html/') -s --data-dir=./ --highlight-style breezedark --variable=file:(echo "$file" | sed '$s/\.md$/.html/') Works beautifully! 1: https…

I know Blot.im as one static site generator that uses it: https://github.com/davidmerfield/Blot/blob/master/app/models...

Hakyll is another: https://jaspervdj.be/hakyll/

Re: Pandoc

#36
post #10

What don't I use it for? + Static websites from any input to html + Markdown & TeX & References to pdf for academia + Generating manpages for new tools + Generating ebooks ... Let's just say I get a bit lost when it isn't available.

What do you use for ebooks? Asciidoc?

Re: Pandoc

#37
post #10

What don't I use it for? + Static websites from any input to html + Markdown & TeX & References to pdf for academia + Generating manpages for new tools + Generating ebooks ... Let's just say I get a bit lost when it isn't available.

> + Generating manpages for new tools Do any of your tools use long options (prefixed with a double dash)? If so, make sure you disable the "smart" extension, otherwise you might end up with en dashes.

OP said he doesn't use pandoc for such things. It's a list of things that have better tooling.

Re: Pandoc

#39
post #34

I love pandoc. I've been using it intermittently for years to turn my Markdown and org-mode documents into other formats. Just wish it would take Asciidoc as an input format.

Asciidoctor and the other asciidoc tools do the job that I use pandoc for: tables, custom numbering, all the other markdown extensions that one needs to be able to create a highly structured document. With Asciidoc, you don't need md extensions. It's all in there.

Ya, I've been using Asciidoctor and Asciidoctor-pdf for long time. Those are some awesome tools, too.

Re: Pandoc

#40
post #37

Earlier quoted context omitted.

> + Generating manpages for new tools Do any of your tools use long options (prefixed with a double dash)? If so, make sure you disable the "smart" extension, otherwise you might end up with en dashes.

OP said he doesn't use pandoc for such things. It's a list of things that have better tooling.

Maybe he edited his post, but it now ends with "... Let's just say I get a bit lost when it isn't available. " suggesting that he actually does use pandoc for stated tasks.
Post reply on HN