markdown_convert 1.2.25__tar.gz → 1.2.27__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown_convert
3
- Version: 1.2.25
3
+ Version: 1.2.27
4
4
  Summary: Convert Markdown files to PDF from your command line.
5
5
  Project-URL: homepage, https://github.com/Julynx/markdown_convert
6
6
  Author-email: Julio Cabria <juliocabria@tutanota.com>
@@ -50,6 +50,7 @@ Unlike other similar tools, `markdown-convert`:
50
50
  - Comes with a sensible default CSS stylesheet out of the box.
51
51
  - Supports:
52
52
  - **LaTeX math equations:** `$...$` for inline and `$$...$$` for block equations.
53
+ - **Mermaid diagrams:** ` ```mermaid ...``` ` code blocks get rendered as diagrams.
53
54
  - **Syntax highlighting for code blocks:** Applied automatically based on the specified language.
54
55
  - **Live conversion:** `markdown-convert file.md --mode=live` updates the PDF every time the Markdown file changes.
55
56
  - **Custom CSS** `markdown-convert file.md --css=style.css` extends the default CSS with your own stylesheet.
@@ -31,6 +31,7 @@ Unlike other similar tools, `markdown-convert`:
31
31
  - Comes with a sensible default CSS stylesheet out of the box.
32
32
  - Supports:
33
33
  - **LaTeX math equations:** `$...$` for inline and `$$...$$` for block equations.
34
+ - **Mermaid diagrams:** ` ```mermaid ...``` ` code blocks get rendered as diagrams.
34
35
  - **Syntax highlighting for code blocks:** Applied automatically based on the specified language.
35
36
  - **Live conversion:** `markdown-convert file.md --mode=live` updates the PDF every time the Markdown file changes.
36
37
  - **Custom CSS** `markdown-convert file.md --css=style.css` extends the default CSS with your own stylesheet.
@@ -221,3 +221,9 @@ math {
221
221
  text-rendering: optimizeLegibility;
222
222
  font-family: "Latin Modern Math", "Cambria Math", serif;
223
223
  }
224
+
225
+ /* Mermaid diagrams */
226
+ div.mermaid {
227
+ display: flex;
228
+ justify-content: center;
229
+ }
@@ -53,13 +53,19 @@ def render_mermaid_diagrams(html, *, nonce):
53
53
 
54
54
  Args:
55
55
  html (str): HTML content.
56
+ nonce (str): Cryptographic nonce for CSP.
56
57
  Returns:
57
58
  str: HTML content with rendered Mermaid diagrams.
58
59
  """
59
60
  mermaid_script = f"""
60
61
  <script type="module" nonce="{nonce}">
61
- import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
62
- mermaid.initialize({{ startOnLoad: true }});
62
+ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
63
+ mermaid.initialize({{
64
+ startOnLoad: true,
65
+ theme: 'default',
66
+ themeVariables: {{}},
67
+ fontFamily: 'arial, verdana, sans-serif'
68
+ }});
63
69
  </script>
64
70
  """
65
71
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "markdown_convert"
7
- version = "1.2.25"
7
+ version = "1.2.27"
8
8
  description = "Convert Markdown files to PDF from your command line."
9
9
  authors = [
10
10
  { name = "Julio Cabria", email = "juliocabria@tutanota.com" },