-
-
Save maskshell/f65aefd04d0f3bebd7eeb78d612517be to your computer and use it in GitHub Desktop.
Revisions
-
cheungnj revised this gist
Oct 31, 2017 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,8 @@ $ pandoc -f docbook -t gfm foo.xml -o foo.md $ iconv -t utf-8 foo.xml | pandoc -f docbook -t gfm | iconv -f utf-8 > foo.md # Pandoc inserted hard line breaks at 72 characters. Removed like so: $ pandoc -f docbook -t gfm --wrap=none # don't wrap lines at all $ pandoc -f docbook -t gfm --columns=120 # extend line breaks to 120 -
cheungnj revised this gist
Oct 31, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html # Using asciidoctor 1.5.6.1 and pandoc 2.0.0.1 # Install pandoc and asciidoctor $ sudo apt install asciidoctor $ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb -
cheungnj renamed this gist
Oct 31, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
cheungnj created this gist
Oct 31, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html # Using asciidoctor and pandoc 2.0.0.1 # Install pandoc and asciidoc $ sudo apt install asciidoctor $ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb $ sudo dpkg -i pandoc-2.0.0.1-1-amd64.deb # Convert asciidoc to docbook using asciidoctor $ asciidoctor -b docbook foo.adoc # foo.xml will be output into the same directory as foo.adoc # Convert docbook to markdown $ pandoc -f docbook -t gfm foo.xml -o foo.md # Unicode symbols were mangled in foo.md. Quick workaround: $ iconv -t utf-8 foo.xml | pandoc -f docbook -t gfm | iconv -f utf-8 > foo.md # Pandoc inserted hard line breaks at 80 characters. Removed like so: $ iconv -t utf-8 foo.xml | pandoc -f docbook -t gfm --wrap=none | iconv -f utf-8 > foo.md