Skip to content

Commit 39df7a0

Browse files
committed
feat: Integrate standalone HTML converter with pipeline
- Add convert_file_to_html() function for programmatic use - Modify save_all_markmaps() to support standalone tool option - Add configuration option use_standalone_tool in config.yaml - Update pipeline to check config and use appropriate converter - Maintain backward compatibility (default: internal converter) - Update README with integration instructions This allows decoupling (tool can run independently) while enabling integration (pipeline can call it programmatically).
1 parent b42bb01 commit 39df7a0

File tree

5 files changed

+494
-1
lines changed

5 files changed

+494
-1
lines changed

tools/ai-markmap-agent/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,42 @@ python translate_only.py --source en --target zh-TW
215215

216216
# Also generate HTML
217217
python translate_only.py --html
218+
219+
### Standalone HTML Converter
220+
221+
For converting Markdown files to HTML without running the full pipeline:
222+
223+
```bash
224+
# Basic conversion (output: input.html)
225+
python convert_to_html.py input.md
226+
227+
# Specify output file
228+
python convert_to_html.py input.md -o output.html
229+
230+
# Custom title
231+
python convert_to_html.py input.md -t "My Mind Map"
232+
233+
# Use custom template
234+
python convert_to_html.py input.md --template templates/custom.html
235+
```
236+
237+
This tool is **completely independent** of the main pipeline and only requires:
238+
- Python 3.10+
239+
- `jinja2` package
240+
241+
It can be used to convert any Markmap Markdown file to interactive HTML.
242+
243+
### Integration with Pipeline
244+
245+
The standalone tool can be integrated with the main pipeline. To use it instead of the internal converter, set in `config/config.yaml`:
246+
247+
```yaml
248+
output:
249+
html:
250+
use_standalone_tool: true # Use convert_to_html.py instead of internal converter
251+
```
252+
253+
This maintains **decoupling** (the tool can run independently) while allowing **integration** (the pipeline can call it programmatically).
218254
```
219255
220256
### API Keys

tools/ai-markmap-agent/config/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ output:
347347

348348
html:
349349
template: "templates/markmap.html"
350+
# Use standalone convert_to_html.py tool instead of internal converter
351+
# This allows decoupling while maintaining integration
352+
use_standalone_tool: false # Set to true to use convert_to_html.py
350353
include_styles: true
351354
include_scripts: true
352355
title: "AI Evolved Markmap"

0 commit comments

Comments
 (0)