marp-cli
marp-cli copied to clipboard
Watchmode does not watch .md anymore (with custom css) ?
Watch mode does not update .html although an update of the css file triggers conversion, in preview mode only :
$ marp -p -w --theme-set ~/marpthemes P_P1A_00.md
[ INFO ] Converting 1 markdown...
[ INFO ] P_P1A_00.md => P_P1A_00.html
[ INFO ] [Watch mode] Start watching...
[ INFO ] [Preview] (EXPERIMENTAL) Opening
file:///...
[ INFO ] P_P1A_00.md => P_P1A_00.html <=== When I update the CSS file in ~/marpthemes
<=== Nothing happens if I update the .md file...
If I use :
$ marp -p -w P_P1A_00.md
Then the watch mod id OK for .md file... but theme falls back to default, of course.
I use the standalone binary :
marp -v
@marp-team/marp-cli v0.20.0 (w/ @marp-team/marp-core v1.2.2)
If I use marp in server mode -s option, then watch mode works correctly even if I set --theme-set (but I'd rather not to use server mode).
marp vscode plugin works like a charm.
Thank you for your work (I use marp for everyday work).
I tried some situations to watch the change of both Markdown and theme CSS, but I could not reproduce failure of observation as you told in my environment (Windows + Marp CLI v0.20.0 standalone build). Probably you may have met a special case.
We require more contexts to determine root cause of the issue: OS, file structures, permissions, and so on.
Context :
$ ls -lR
.:
total 110240
-rwxr-xr-x 1 signac 1000 112877006 28 juil. 15:01 marp-0.20.0
-rw-r--r-- 1 signac 1000 59 28 juil. 15:21 test.md
drwxr-xr-x 2 signac 1000 4096 28 juil. 15:15 themes
./themes:
total 4
-rw-r--r-- 1 signac 1000 93 28 juil. 15:15 test.css
$ uname -a
Linux snarkturne 5.7.7-arch1-1 #1 SMP PREEMPT Wed, 01 Jul 2020 14:53:16 +0000 x86_64 GNU/Linux
$ ./marp-0.20.0 -v
@marp-team/marp-cli v0.20.0 (w/ @marp-team/marp-core v1.2.2)
$$ chromium --version # Mmmmm probably you don't need this one... :)
Chromium 83.0.4103.116 Arch Linux
I found it more easy to provide a sample video of what happens. You can find it here https://upload.univ-poitiers.fr/l5m6yj8x (it will be deleted in 5 days). Making the video, I found that it was possible to call marp -p with a directory (instead of a file... but I did not try with a directory containing several files...). And then it works again ! You can not see it in the video but if I remove theme from markdown file, and if I empty the themes directory, the same behavior can be observed. It seems to come from the command line invocation : --theme-set ... with -p and watch mode is disabled for .md file !
I'm pretty sure this is new (version > 17 ?)
Can confirm, same thing happening to me when using the official docker, it just stops detecting changes after some time.
Writing the .css file again fixes it, it seems.
https://github.com/guard/listen/blob/master/README.md#increasing-the-amount-of-inotify-watchers
Related: #498
Close for cleaning up Marp CLI issue tracker. Please report this to chokidar, a file watcher Marp CLI is using.