[gtk/doc-chapters-markdown: 24/29] docs: Allow influencing pandoc divisons
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/doc-chapters-markdown: 24/29] docs: Allow influencing pandoc divisons
- Date: Mon, 25 May 2020 20:14:25 +0000 (UTC)
commit 581b39a38d803b0b0137eed0ef9a6bea80cda11b
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 24 12:04:15 2020 -0400
docs: Allow influencing pandoc divisons
Arrange for files named section-foo.md to be turned
into docbook sections, while others get turned into
chapters. This is necessary to allow including such
content in chapters, since chapters in docbook don't
nest.
docs/reference/gtk/gtk-markdown-to-docbook | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/docs/reference/gtk/gtk-markdown-to-docbook b/docs/reference/gtk/gtk-markdown-to-docbook
index 247c613dce..aa5dd53e61 100755
--- a/docs/reference/gtk/gtk-markdown-to-docbook
+++ b/docs/reference/gtk/gtk-markdown-to-docbook
@@ -167,12 +167,16 @@ MarkdownExtensions = {
def ConvertToDocbook(infile, outfile):
basename = os.path.basename(infile)
+ if basename.startswith('section'):
+ division='section'
+ else:
+ division='chapter'
input_format = "markdown" + "".join(MarkdownExtensions)
output_format = "docbook"
subprocess.check_call(["pandoc", infile, "-o", outfile,
"--from=" + input_format,
"--to=" + output_format,
- "--top-level-division=chapter"])
+ "--top-level-division=" + division])
def ExpandGtkDocAbbreviations(infile, outfile):
contents = open(infile, 'r', encoding='utf-8').read()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]