hedgedoc/cli

Also download images when using export

theRealSuperMario opened this issue · 1 comments

So I was wondering if there already exists an option to also download the images that are added to the notes.

In that case, one might need to change the url of those images in the document as they are not referring back to the server anymore.

It would have the advantage that the export is actually standalone and offline accessible (might not be relevant if running on localhost)

If something like this does not exist yet, is there any reason why I shouldn't give it a try?

Just asking so that I am not doing something that won't be needed after all.

Cheers 🍻

Adding these two flags to the wget command should do the trick: --convert-links --page-requisites, you can run it manually like so:

wget \
    --convert-links \
    --load-cookies "$HEDGEDOC_COOKIES_FILE" \
    --output-document "$output_path" \
    --convert-links \
    --page-requisites \
    "$HEDGEDOC_SERVER/s/$public_id"

We could also add it as a config option to the CLI.

https://github.com/hedgedoc/cli/blob/master/bin/hedgedoc#L222