aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/compile/asciidoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/plugins/compile/asciidoc.py')
-rw-r--r--nikola/plugins/compile/asciidoc.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/nikola/plugins/compile/asciidoc.py b/nikola/plugins/compile/asciidoc.py
index 67dfe1a..12cb4bf 100644
--- a/nikola/plugins/compile/asciidoc.py
+++ b/nikola/plugins/compile/asciidoc.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -37,11 +37,17 @@ import subprocess
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
class CompileAsciiDoc(PageCompiler):
"""Compile asciidoc into HTML."""
name = "asciidoc"
+ demote_headers = True
def compile_html(self, source, dest, is_two_file=True):
makedirs(os.path.dirname(dest))
@@ -52,7 +58,10 @@ class CompileAsciiDoc(PageCompiler):
req_missing(['asciidoc'], 'build this site (compile with asciidoc)', python=False)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))