Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also download images when using export #41

Open
theRealSuperMario opened this issue Apr 4, 2021 · 1 comment
Open

Also download images when using export #41

theRealSuperMario opened this issue Apr 4, 2021 · 1 comment

Comments

@theRealSuperMario
Copy link

theRealSuperMario commented Apr 4, 2021

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 🍻

@pirate
Copy link
Member

pirate commented Apr 5, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants