diff options
author | David Edmundson <davidedmundson@kde.org> | 2023-08-15 10:38:52 +0000 |
---|---|---|
committer | David Faure <faure@kde.org> | 2023-08-15 10:38:52 +0000 |
commit | 2520408a523cb46a7be3cad3a26d1b7a8dabb645 (patch) | |
tree | ef76fe608f4eec0bdeb0d6ce2e0a09af978425a1 | |
parent | 97706d726772de93c4bc440435a3323049cd064a (diff) |
Add markdown support to website generator
-rwxr-xr-x | web-export/update.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/web-export/update.py b/web-export/update.py index ccb9593..cf3cad7 100755 --- a/web-export/update.py +++ b/web-export/update.py @@ -163,7 +163,7 @@ class SpecObject(): self.filename = os.path.basename(full_path) self.dir = os.path.dirname(full_path) - if self.ext not in ['.xml', '.sgml', '.txt', '.dtd', '.html']: + if self.ext not in ['.xml', '.sgml', '.txt', '.dtd', '.html', '.md']: raise Exception('Format \'%s\' not supported for %s' % (self.ext, self.vcs.get_url())) self.downloaded = False @@ -224,6 +224,10 @@ class SpecObject(): elif self.ext == '.sgml': one_chunk_command = ['docbook2html', '-o', self.spec_dir, '--nochunks', path] multiple_chunks_command = ['docbook2html', '-o', html_dir, path] + elif self.ext == '.md': + safe_mkdir(html_dir) + shutil.copy('simple.css', html_dir + '/simple.css') + one_chunk_command = ['discount-mkd2html', '-css', 'simple.css', path, html_dir + '/index.html'] if one_chunk_command: retcode = subprocess.call(one_chunk_command) |