feat: unified convert --to CLI (textutil-compatible) - #28
Merged
Merged
Conversation
Implement textutil-compatible CLI pattern where all conversions go through a single `convert` subcommand with --to flag for target format. Input format auto-detected from file extension. Old subcommands (word, html, md, srt, bib) kept for backward compatibility. Routing table: .docx → md (WordConverter) .html → md (HTMLConverter) .md → html (MarkdownConverter) .srt → html (SRTConverter) .bib → html (BibToAPAHTMLFormatter) .bib → md (BibToAPAFormatter) .bib → json (BibToAPAJSONFormatter) Closes #27
- Remove non-existent Markdown.self from subcommands - Replace unused --style/--model with --css flag for bib CSS selection - Fix resolveOutputPath docstring (--stdout wins, not --output) - De-duplicate APACSS.web in convertBibToHTML - Use ParsableCommand instead of AsyncParsableCommand (no async calls) - Fix dependency: use remote doc-converter-swift v0.4.0 (CommonConverterSwift)
Establish that macdoc must prioritize macOS native frameworks (PDFKit, Vision, CoreGraphics) over external tools. Includes capability mapping table and new-converter checklist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
macdoc convert --to <format> <file>as unified conversion entry pointRouting table
.docxmd.html/.htmmd.mdhtml.srthtml.bibhtml.bibmd.bibjsonUsage
Options
--output <path>— write to file instead of stdout--stdout— force output to stdout--hard-breaks— treat soft breaks as hard line breaks--full— output full HTML document (for md→html and bib→html)--style <style>— citation style (reserved for future use)--model <model>— model for token counting (reserved for future use)Design
Follows macOS
textutil -convertpattern per.claude/rules/cli-textutil-compat.mdCloses #27
🤖 Generated with Claude Code