Skip to content

Commit e19481e

Browse files
committed
feat: add detailed help text with examples and feature descriptions
1 parent 940243a commit e19481e

1 file changed

Lines changed: 45 additions & 2 deletions

File tree

cmd/root.go

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,51 @@ var (
2626
)
2727

2828
var rootCmd = &cobra.Command{
29-
Use: "mo [flags] [FILE ...]",
30-
Short: "mo is a Markdown viewer that opens .md files in a browser.",
29+
Use: "mo [flags] [FILE ...]",
30+
Short: "mo is a Markdown viewer that opens .md files in a browser.",
31+
Long: `mo is a Markdown viewer that opens .md files in a browser with live-reload.
32+
33+
It starts an HTTP server, renders Markdown files using a built-in React SPA,
34+
and automatically refreshes the browser when files are saved.
35+
36+
Examples:
37+
mo README.md Open a single file
38+
mo README.md CHANGELOG.md docs/*.md Open multiple files
39+
mo spec.md --target design Open in a named group
40+
mo draft.md --port 6276 Use a different port
41+
42+
Single Server, Multiple Files:
43+
By default, mo runs a single server process on port 6275.
44+
If a server is already running on the same port, subsequent mo invocations
45+
add files to the existing session instead of starting a new one.
46+
47+
$ mo README.md # Starts a server and opens the browser
48+
$ mo CHANGELOG.md # Adds the file to the running server
49+
50+
To run a completely separate session, use a different port:
51+
52+
$ mo draft.md -p 6276
53+
54+
Groups:
55+
Files can be organized into named groups using the --target (-t) flag.
56+
Each group gets its own URL path (e.g., http://localhost:6275/design)
57+
and its own sidebar in the browser.
58+
59+
$ mo spec.md --target design # Opens at /design
60+
$ mo api.md --target design # Adds to the "design" group
61+
$ mo notes.md --target notes # Opens at /notes
62+
63+
If no --target is specified, files are added to the "default" group.
64+
65+
Live-Reload:
66+
mo watches all opened files for changes using filesystem notifications.
67+
When a file is saved, the browser automatically re-renders the content.
68+
69+
Supported Markdown Features:
70+
- GitHub Flavored Markdown (tables, task lists, strikethrough, autolinks)
71+
- Syntax-highlighted code blocks (via Shiki)
72+
- Mermaid diagrams
73+
- Raw HTML`,
3174
Args: cobra.ArbitraryArgs,
3275
RunE: run,
3376
Version: version.Version,

0 commit comments

Comments
 (0)