Fix building asciidoc headers in importer & add docs

This commit is contained in:
Justin Mayer 2020-04-16 08:01:10 +02:00
commit 86ff02541f
2 changed files with 5 additions and 6 deletions

View file

@ -74,8 +74,8 @@ Optional arguments
-o OUTPUT, --output OUTPUT
Output path (default: content)
-m MARKUP, --markup MARKUP
Output markup format (supports rst & markdown)
(default: rst)
Output markup format: ``rst``, ``markdown``, or ``asciidoc``
(default: ``rst``)
--dir-cat Put files in directories with categories name
(default: False)
--dir-page Put files recognised as pages in "pages/" sub-
@ -140,4 +140,4 @@ To test the module, one can use sample files:
- for WordPress: https://www.wpbeginner.com/wp-themes/how-to-add-dummy-content-for-theme-development-in-wordpress/
- for Dotclear: http://media.dotaddict.org/tda/downloads/lorem-backup.txt
.. _more_categories: https://github.com/getpelican/pelican-plugins/tree/master/more_categories
.. _more_categories: https://github.com/getpelican/pelican-plugins/tree/master/more_categories

View file

@ -571,12 +571,11 @@ def build_header(title, date, author, categories, tags, slug,
header += '\n'
return header
def build_asciidoc_header(title, date, author, categories, tags, slug,
status=None, attachments=None):
"""Build a header from a list of fields"""
from docutils.utils import column_width
header = '= %s\n' % title
if author:
header += '%s\n' % author
@ -802,7 +801,7 @@ def fields2pelican(
ext = get_ext(out_markup, in_markup)
if ext == '.adoc':
header = build_asciidoc_header(title, date, author, categories,
tags, slug, status, attached_files)
tags, slug, status, attachments)
elif ext == '.md':
header = build_markdown_header(
title, date, author, categories, tags, slug,