Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
allow different asciidoc binaries
  • Loading branch information
ralsina committed May 9, 2015
1 parent 75a2f72 commit 116ec29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion v7/asciidoc/asciidoc.py
Expand Up @@ -51,8 +51,9 @@ class CompileAsciiDoc(PageCompiler):

def compile_html(self, source, dest, is_two_file=True):
makedirs(os.path.dirname(dest))
binary = self.site.options.get('ASCIIDOC_BINARY', 'asciidoc')
try:
subprocess.check_call(('asciidoc', '-b', 'html5', '-s', '-o', dest, source))
subprocess.check_call((binary, '-b', 'html5', '-s', '-o', dest, source))
except OSError as e:
if e.strreror == 'No such file or directory':
req_missing(['asciidoc'], 'build this site (compile with asciidoc)', python=False)
Expand Down
5 changes: 5 additions & 0 deletions v7/asciidoc/conf.py.sample
Expand Up @@ -4,3 +4,8 @@ COMPILERS["asciidoc"] = ('.asc',)
# Add asciidoc files to your POSTS, PAGES
POSTS = POSTS + (("posts/*.asc", "posts", "post.tmpl"),)
PAGES = PAGES + (("stories/*.asc", "posts", "post.tmpl"),)

# You can choose what command to use for processing.
# For example, you can replace asciidoc with asciidoctor
# Or use the full path to the program.
# ASCIIDOC_BINARY = "asciidoc"

0 comments on commit 116ec29

Please sign in to comment.