@udx/md2html 1.0.0 → 1.1.0

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.
package/README.md CHANGED
@@ -101,6 +101,29 @@ Add captions to images with this syntax:
101
101
  *This is the image caption*
102
102
  ```
103
103
 
104
+ ### Mermaid Diagrams
105
+
106
+ Create professional diagrams using Mermaid syntax:
107
+
108
+ ````markdown
109
+ ```mermaid
110
+ flowchart LR
111
+ A[Client] --> B[Load Balancer]
112
+ B --> C[Server1]
113
+ B --> D[Server2]
114
+ ```
115
+ ````
116
+
117
+ Supported Mermaid diagram types:
118
+ - **Flowcharts**: Process flows and workflows
119
+ - **Sequence Diagrams**: System interactions over time
120
+ - **Gantt Charts**: Project timelines and schedules
121
+ - **Entity Relationship Diagrams**: Database schemas
122
+ - **User Journey**: User experience flows
123
+ - **Git Graphs**: Version control workflows
124
+
125
+ The diagrams are automatically rendered when the HTML document loads, with professional styling that matches the document theme.
126
+
104
127
  ## Customization
105
128
 
106
129
  This tool is designed to be easily customizable:
package/index.js CHANGED
@@ -39,7 +39,7 @@
39
39
  * - Applies syntax highlighting to code blocks
40
40
  * - Supports watch mode for automatic rebuilding
41
41
  *
42
- * @version 1.0.0
42
+ * @version 1.1.0
43
43
  * @author UDX Team
44
44
  * @copyright 2025
45
45
  */
@@ -86,7 +86,7 @@ const CHAPTER_NAV_STYLES_PATH = path.join(path.dirname(new URL(import.meta.url).
86
86
  const SCRIPTS_PATH = path.join(path.dirname(new URL(import.meta.url).pathname), 'static/scripts.js');
87
87
 
88
88
  program
89
- .version('1.0.0')
89
+ .version('1.1.0')
90
90
  .description('Convert markdown files to a single HTML document with Google Docs styling')
91
91
  .option('-s, --src <directory>', 'Source directory containing markdown files')
92
92
  .option('-o, --out <file>', 'Output HTML file path')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udx/md2html",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Magazine-quality Markdown to HTML converter with professional styling",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/static/view.hbs CHANGED
@@ -48,6 +48,7 @@
48
48
  <script src="https://cdn.tailwindcss.com?plugins=typography"></script>
49
49
  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
50
50
  <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
51
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
51
52
  <script>
52
53
  tailwind.config = {
53
54
  theme: {
@@ -301,6 +302,30 @@
301
302
  });
302
303
  }
303
304
 
305
+ // Initialize Mermaid diagrams
306
+ if (window.mermaid) {
307
+ mermaid.initialize({
308
+ startOnLoad: true,
309
+ theme: 'default',
310
+ securityLevel: 'loose',
311
+ fontFamily: 'inherit'
312
+ });
313
+
314
+ // Convert mermaid code blocks to diagrams
315
+ document.querySelectorAll('pre[data-file-type="mermaid"]').forEach((pre) => {
316
+ const code = pre.querySelector('code');
317
+ if (code) {
318
+ const mermaidDiv = document.createElement('div');
319
+ mermaidDiv.className = 'mermaid';
320
+ mermaidDiv.textContent = code.textContent;
321
+ pre.parentNode.replaceChild(mermaidDiv, pre);
322
+ }
323
+ });
324
+
325
+ // Re-render after conversion
326
+ mermaid.init();
327
+ }
328
+
304
329
  // Initialize the annotation system if available
305
330
  if (window.ScienceUsability && typeof ScienceUsability.init === 'function') {
306
331
  console.log('Initializing ScienceUsability annotation system...');