summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-12-13 01:07:17 -0500
committerMatthias Clasen <mclasen@redhat.com>2019-12-13 01:07:17 -0500
commitc2feecbf0424518a0a79cb302434c858fb54aa44 (patch)
tree183833b1329c8ab9988a4331dc97693c45c6a44c
parentb84b964327019b946534a4cd7838b591c1f69a60 (diff)
downloadgtk-doc-markdown-content.tar.gz
Expand markdown in content filesmarkdown-content
Here is a quick proof-of-concept patch to recognize .md files in expand_content_files, and run ConvertMarkDown on them. It is not quite as useful as I had hoped, since gtk-doc's markdown support is so limited. And it insists on emitting <refsect2> elements. But its a start. I tested this by putting test.md in expand_content_files, and then have this in my main xml: <refentry> <refmeta><refentrytitle>Test</refentrytitle></refmeta> <refnamediv><refpurpose>markdown</refpurpose></refnamediv> <xi:include href="xml/test.md" /> </refentry>
-rw-r--r--gtkdoc/mkdb.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtkdoc/mkdb.py b/gtkdoc/mkdb.py
index 9404452..2ad2008 100644
--- a/gtkdoc/mkdb.py
+++ b/gtkdoc/mkdb.py
@@ -2381,7 +2381,10 @@ def OutputExtraFile(file):
contents = open(file, 'r', encoding='utf-8').read()
with open(new_db_file, 'w', encoding='utf-8') as out:
- out.write(ExpandAbbreviations(basename + " file", contents))
+ if old_db_file.endswith(".md"):
+ out.write(ConvertMarkDown(basename + " file", contents))
+ else:
+ out.write(ExpandAbbreviations(basename + " file", contents))
return common.UpdateFileIfChanged(old_db_file, new_db_file, 0)