Add support for Markdown.
[docutils.git] / docutils / tools / md2html5.py
blob55b9238ceb44cd957522111add2d4d7bf96c8e8c
1 #!/usr/bin/env python
2 # -*- coding: utf8 -*-
3 # :Copyright: © 2020 Günter Milde.
4 # :License: Released under the terms of the `2-Clause BSD license`_, in short:
6 # Copying and distribution of this file, with or without modification,
7 # are permitted in any medium without royalty provided the copyright
8 # notice and this notice are preserved.
9 # This file is offered as-is, without any warranty.
11 # .. _2-Clause BSD license: https://opensource.org/licenses/BSD-2-Clause
13 # Revision: $Revision$
14 # Date: $Date$
16 """
17 A minimal front end to the Docutils Publisher, parsing CommonMark markdown files
18 with `recommonmark` and producing HTML 5 documents.
20 The output is also valid XML.
21 """
23 try:
24 import locale # module missing in Jython
25 locale.setlocale(locale.LC_ALL, '')
26 except locale.Error:
27 pass
29 from docutils.core import publish_cmdline, default_description
32 description = (u'Generate HTML5 documents from standalone '
33 u'Markdown (CommonMark) sources.\n'
34 + default_description)
36 publish_cmdline(#parser=mdparser,
37 parser_name="recommonmark",
38 writer_name='html5',
39 description=description)