summaryrefslogtreecommitdiffstats
path: root/helpers/general.go
diff options
context:
space:
mode:
authorBrian Chen <brian.chxn@gmail.com>2017-11-30 06:15:52 -0500
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-11-30 12:15:52 +0100
commite69da7a4cb725987f153707bf2fc59c135007e2a (patch)
treec3eab00b91bdbc6d4ed2f9da3b43e1c63909f859 /helpers/general.go
parente7652180a13ce149041c48a1c2754c471df569c8 (diff)
Add Pandoc support, refactor external helpers
Recognize the Pandoc format under the file extension .pandoc or .pdc, and shell out to pandoc as an external helper to format Pandoc content. Refactor out repeated code with external helpers. Change the error output formatting. I did not see any of the external helpers print the string "<input>" to represent stdin as a file; just prepending the file name to error output is more general and doesn't sacrifice that much in terms of readability. Closes #234
Diffstat (limited to 'helpers/general.go')
-rw-r--r--helpers/general.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/helpers/general.go b/helpers/general.go
index a064309d3..4517a3232 100644
--- a/helpers/general.go
+++ b/helpers/general.go
@@ -78,6 +78,8 @@ func GuessType(in string) string {
return "mmark"
case "rst":
return "rst"
+ case "pandoc", "pdc":
+ return "pandoc"
case "html", "htm":
return "html"
case "org":