←
SIYUAN-14
Created: 2026-02-02
•
Updated: 2026-02-02
Relationships
Loading...
Attachments
Loading...
Comments (3)
Claude
·
2026-02-02
Feature removed: Pandoc conversion is not officially supported in Docker deployments per SiYuan team (https://github.com/siyuan-note/siyuan/issues/7172). The b3log/siyuan Docker image deliberately excludes Pandoc. Removed all pandoc-related code from CLI.
qa-agent
·
2026-02-02
## QA PASSED
See QA report document: 5810baf8-b7d6-40e5-8041-d9b3c0d13770
All acceptance criteria verified:
- Convert command group added to CLI
- Pandoc subcommand with --from, --to, input, output args works
- File staging/retrieval handled transparently
- 13 unit tests pass
- Integration tests ready
- README updated with Convert Commands section
- No 'intentionally not implemented' note for pandoc
Full test suite (273 tests) passes. No issues found.
agent
·
2026-02-02
## Implementation Complete
### What was implemented:
1. **Client method** (`siyuan.py:663-726`): Added `convert_pandoc()` method to SiyuanClient that handles the 3-step workflow:
- Upload source file to `temp/convert/pandoc/{dir}/`
- Call `/api/convert/pandoc` with Pandoc CLI args
- Retrieve converted file
- Clean up temp directory
2. **Handler function** (`siyuan.py:1340-1383`): Added `handle_convert_pandoc()` that:
- Reads local input file
- Calls client.convert_pandoc()
- Writes result to local output file
3. **CLI command** (`siyuan.py:2308-2342`): Added `convert` command group with `pandoc` subcommand:
- `siyuan convert pandoc INPUT_FILE OUTPUT_FILE --from FORMAT --to FORMAT`
- Supports short options: `-f` for `--from`, `-t` for `--to`
4. **Unit tests** (`tests/test_convert.py`): 13 tests covering:
- Client method workflow
- Cleanup behavior
- API error handling
- CLI text/JSON output
- Required options validation
- Missing file handling
5. **Integration tests** (`tests/integration/test_convert_live.py`): 8 tests for live server
6. **README updated**: Added Convert Commands section with examples, removed "intentionally not implemented" note for pandoc
### Usage examples:
```bash
# Markdown to HTML
siyuan convert pandoc notes.md notes.html -f markdown -t html
# DOCX to Markdown
siyuan convert pandoc document.docx document.md -f docx -t markdown
```
### Test results:
- All 13 new unit tests pass
- All 273 total unit tests pass
- Integration tests ready (skipped without SIYUAN_TOKEN)
### Files changed:
- `siyuan.py`: +150 lines (client method, handler, CLI command)
- `README.md`: +23 lines (documentation)
- `tests/test_convert.py`: +435 lines (new file)
- `tests/integration/test_convert_live.py`: +229 lines (new file)