]>
git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blob - build_readme.py
9f33dbd6740a10aa137685d1ac75013898081322
2 from markdown
.extensions
.toc
import slugify
4 def lang_slugify(lang
):
5 def l_slugify(value
, separator
):
6 return slugify(lang
+ "__" + value
, separator
)
9 def get_markdown(md_file
, lang
, table_of_content
):
10 with open(md_file
, "r") as f
:
13 return markdown
.markdown(
16 'markdown.extensions.codehilite',
17 'markdown.extensions.toc',
18 'markdown.extensions.tables'
21 'markdown.extensions.codehilite': {
24 'markdown.extensions.toc': {
25 'title': table_of_content
,
26 'slugify': lang_slugify(lang
)
31 print("<p><a href='#lang-en'>Documenation in english</a></p>")
32 print("<p><a href='#lang-fr'>Documenation en Français</a></p>")
33 print("<hr id='lang-en'/>")
34 print(get_markdown("documentation_en.md", "en", "Table of contents"))
35 print("<hr id='lang-fr'/>")
36 print(get_markdown("documentation_fr.md", "fr", "Sommaire"))