Closed davidak closed 4 years ago
I don't think this is worth implementing tbh, the bash loop is simple enough, and auto-importing directories is not a behavior that's expected for everyone. e.g if I mistype a path and forget the ending, I don't want it attempting to import every entry in a directory that potentially has thousands of random files in it. Also what if the user wants to import text files that don't end in .md
? What about files that start with .
? What if there are a mix of files in the directory (e.g. .DS_Store
and others the user might not even know about), should we import only the ones that look like markdown and ignore the others? There are lots of edge-cases that make it less intuitive for the average use-case, I think it's safer to force the user to be explicit.
export CODIMD_SERVER='https://pad.nixnet.services'
for file in ~/Downloads/hackmd/*.md
./codimd import "$file" >> note_urls.txt
done
The URL output will also be fixed by #31, making the xdg-open
+ awk
workaround in your example snippet unnecessary.
If a search brought you here, here's a post-codimd version:
export HEDGEDOC_SERVER='https://notes.example.com'
for file in ~/Downloads/hackmd/*.md
do
hedgedoc import "$file" >> note_urls.txt
done
This should work:
codimd import /path/to/markdown/files
Workaround
(You have to open the imported note for it to appear in the history.)