summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2016-10-20 03:18:33 -0400
committerIru Cai <mytbk920423@gmail.com>2016-10-20 03:18:33 -0400
commitaf51010b93326456df76ac2edfe565551b31cca5 (patch)
tree32a8ca7b108877024391678d9ae77ca68bcc88dc
parent8cea529776dc9806e420530af24ee2b3eeecdb1b (diff)
downloadwerc-af51010b93326456df76ac2edfe565551b31cca5.tar.xz
fix asciidoc
-rwxr-xr-xbin/contrib/asciidoc.sh3
-rw-r--r--bin/corehandlers.rc2
-rwxr-xr-xbin/werc.rc2
-rw-r--r--etc/initrc.local1
4 files changed, 6 insertions, 2 deletions
diff --git a/bin/contrib/asciidoc.sh b/bin/contrib/asciidoc.sh
new file mode 100755
index 0000000..3b97b0c
--- /dev/null
+++ b/bin/contrib/asciidoc.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cat "$@" | /usr/bin/asciidoc -s -o - -
diff --git a/bin/corehandlers.rc b/bin/corehandlers.rc
index a5ce965..40fd834 100644
--- a/bin/corehandlers.rc
+++ b/bin/corehandlers.rc
@@ -7,7 +7,7 @@ fn nav_tree {
# /./ to deal with p9p's ls failure to follow dir symlinks otherwise
ls -F $sitedir/./$req_paths_list >[2]/dev/null \
| {
- sed $dirfilter'/\/[^_.\/][^\/]*(\.(md|rst|txt|html)|\/)$/!d; s!^'$sitedir'!!; '$dirclean
+ sed $dirfilter'/\/[^_.\/][^\/]*(\.(md|rst|asciidoc|txt|html)|\/)$/!d; s!^'$sitedir'!!; '$dirclean
if(! ~ $#synth_paths 0) echo $synth_paths | tr ' ' $NEW_LINE
} | sort -u | awk -F/ '
function p(x, y, s) { for(i=0; i < x-y; i+=1) print s }
diff --git a/bin/werc.rc b/bin/werc.rc
index 42720e3..3d52e40 100755
--- a/bin/werc.rc
+++ b/bin/werc.rc
@@ -12,7 +12,7 @@ difs=$ifs # Used to restore default ifs when needed
# Expected input: ls -F style, $sitedir/path/to/files/
# <ls -F+x><symlink hack><Useless?><hiden files >
dirfilter='s/\*$//; s,/+\./+,/,g; s,^\./,,; /\/[._][^\/]/d; /'$forbidden_uri_chars'/d; /\/sitemap\.xml$/d; /\/index\.(md|rst|asciidoc|html|txt|tpl)$/d; /\/(robots|sitemap)\.txt$/d; /_werc\/?$/d; '
-dirclean=' s/\.(md|rst|html|txt)$//; '
+dirclean=' s/\.(md|rst|asciidoc|html|txt)$//; '
# Careful, the proper p9p path might not be set until initrc.local is sourced
path=(. $PLAN9/bin ./bin /bin /usr/bin)
diff --git a/etc/initrc.local b/etc/initrc.local
index 8fe04d7..352fd45 100644
--- a/etc/initrc.local
+++ b/etc/initrc.local
@@ -26,6 +26,7 @@ path=($plan9port/bin . ./bin ./bin/contrib /bin /usr/bin)
#formatter=(fltr_cache markdown.pl)
formatter=(fltr_cache pandoc_format.sh)
rst_formatter=(fltr_cache rst2html)
+asciidoc_formatter=(fltr_cache asciidoc.sh)
# Enable debugging, to disable set to ()
debug=true