You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ Options:
55
55
-h, --help ............... Output usage information
56
56
-v, --version ............ Output version
57
57
-w, --watch .............. Watch the current file(s) for changes
58
+
--watch-options .......... Options for Chokidar's watch call
58
59
--basedir ................ Base directory to be served by the file server
59
60
--stylesheet ............. Path to a local or remote stylesheet (can be passed multiple times)
60
61
--css .................... String of styles
@@ -90,6 +91,12 @@ _Tip: You can concatenate multiple files using `cat file1.md file2.md`._
90
91
91
92
The current working directory (`process.cwd()`) serves as the base directory of the file server by default. This can be adjusted with the `--basedir` flag (or equivalent config option).
92
93
94
+
#### Watch Mode
95
+
96
+
Watch mode (`--watch`) uses Chokidar's `watch` method on the markdown file. If you're having issues, you can adjust the watch options via the config (`watch_options`) or `--watch-options` CLI arg. The `awaitWriteFinish` option might be particularly useful if you use editor plugins (e. g. TOC generators) that modify and save the file after the initial save. Check out the [Chokidar docs](https://github.com/paulmillr/chokidar#api) for a full list of options.
97
+
98
+
Note that Preview on macOS does not automatically reload the preview when the file has changed (or at least not reliably). There are PDF viewers available that can check for file changes and offer auto-reload (e. g. [Skim](https://skim-app.sourceforge.io/)'s "Sync" feature).
99
+
93
100
#### Programmatic API
94
101
95
102
The programmatic API is very simple: it only exposes one function that accepts either a `path` to or `content` of a markdown file, and an optional config object (which can be used to specify the output file destination).
0 commit comments