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

Exporting of media #33

Open
ghost opened this issue Jul 16, 2020 · 6 comments
Open

Exporting of media #33

ghost opened this issue Jul 16, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ghost
Copy link

ghost commented Jul 16, 2020

It would probably very useful if images and PDF stored on Roam would be exported as well.

Via this thread (closed forum, but props where they are due), they look like an "easy" regex to find:

"string": "![](https://firebasestorage.googleapis.com/[..]/o/imgs%2Fapp%2FMY-GRAPH%2F-[IMAGEID].png?[AUTH_DELETED]

Alas, I don't know how complicated it would actually be to have the attachments downloaded just because they're easy to find.

@ghost ghost added the enhancement New feature or request label Jul 16, 2020
@ghost ghost assigned MatthieuBizien Jul 16, 2020
@gunar
Copy link

gunar commented Aug 10, 2020

@MatthieuBizien would you like help with this?

@MatthieuBizien
Copy link
Owner

Hi @benwf! I agree that feature would be nice, but I will not be able to work on it in the short time. PR welcome 😀

@MatthieuBizien MatthieuBizien added the good first issue Good for newcomers label Aug 16, 2020
@ghost
Copy link
Author

ghost commented Aug 19, 2020

I'd love to pass the torch to @gunar if he's still interested ;)

@gunar
Copy link

gunar commented Aug 19, 2020

Sure I'll take a stab at it

@gunar
Copy link

gunar commented Aug 19, 2020

I hadn't realized this codebase is written in Python. It'd take too long for me as I'm not used to Python tooling.

For concern of losing my images, I've written this short bash script to download images from the generated markdown files. It doesn't retroactively update the markdown files but at least you've got your images with you. Anyway, this might be an interim solution for whoever comes to this GH issue:

#!/usr/bin/env sh
ag -o "!\[.*\]\((.*)\)" | ag -o "\([^)]*" | cut -c 2- \
  | parallel -j 8 --halt never wget -P images --continue {}

Run it inside formatted/. You'll need the silver searcher.

Anyway, this is a hack and we'd love it if someone could contribute to this feature.

@gunar
Copy link

gunar commented Oct 3, 2020

Solution: I've built a thing called markdown-backup to solve this problem. It downloads the images linked inside markdown files, and rewrites the link to point to the new local files. There are instructions on how to use it with roam-to-git. Feedback welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants