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

Is it possible to extract markdown in user specific folder. #20

Open
tharansakthi opened this issue Mar 25, 2022 · 6 comments
Open

Is it possible to extract markdown in user specific folder. #20

tharansakthi opened this issue Mar 25, 2022 · 6 comments

Comments

@tharansakthi
Copy link

I am using your script. But I want to extract markdown to my _notes folder of Jekyll based project. Is it possible ?

No formatting needed. Just extract or move extracted markdown files to specific location.

Thanks a lot in advance.

@everruler12
Copy link
Owner

You could try forking https://github.com/everruler12/roam2github/blob/main/roam2github.js
then replace line 409 const markdown_dir = path.join(backup_dir, 'markdown', graph_name) with const markdown_dir = path.join(backup_dir, '_notes')

Then in your Actions repo, in main.yml line 30, replace:
git clone -q https://github.com/everruler12/roam2github.git roam2github with git clone -q https://github.com/tharansakthi/roam2github.git roam2github
and add th following after line 37:

          BACKUP_EDN: false
          BACKUP_JSON: false
          BACKUP_MARKDOWN: true

But I see you're using roam-to-git to generate notes, in which case this wouldn't work. There's probably a way after the "Generate notes" task in main.yml to add a run a task that does the renaming and moving. That would probably be easiest.

@tharansakthi
Copy link
Author

tharansakthi commented Mar 26, 2022

Unfortunately, I am using this fork of roam-to-git -> https://github.com/DoomHammer/roam-to-git/tree/roam-to-garden

The formatter code inside this transforms the .md files and its file names when moving to "_notes" folder in Jekyll. But the template (https://github.com/maximevaillancourt/digital-garden-jekyll-template) I'm using doesn't need any formatting. Also the code doesn't publish entire roam graph, instead it only converts the notes referred under Public.md file.

So, I am thinking about moving to roam-to-git, but I don't how to move the extracted .md files in /markdown/ to _notes folder.

It would be nice to get an option to mention the location folder through git secrets or something like that in your original repo, so that many people like me benefit.

tharansakthi added a commit to tharansakthi/roam2github that referenced this issue Mar 26, 2022
@tharansakthi
Copy link
Author

tharansakthi commented Mar 26, 2022

You could try forking https://github.com/everruler12/roam2github/blob/main/roam2github.js
then replace line 409 const markdown_dir = path.join(backup_dir, 'markdown', graph_name) with const markdown_dir = path.join(backup_dir, '_notes')

The above code didn't work as expected. It again stores content inside markdown/ directory. Did I do anything wrong?

const markdown_dir = path.join(backup_dir, '_notes', graph_name) - also not working.

Is there any other way?

@tharansakthi
Copy link
Author

https://github.com/tharansakthi/roam2github/blob/main/backup.js
code line number 413.
replacing to -> const markdown_dir = path.join(backup_dir, '_notes')

Worked successfully

@everruler12
Copy link
Owner

It would be nice to get an option to mention the location folder through git secrets or something like that in your original repo, so that many people like me benefit.

I have since moved on from Roam to Obsidian. Roam2Github was only intended for backups, not digital gardens. Roam has since released their own automatic backup solution. So I no longer use Roam2Github, and unfortunately don't plan on adding more features.

code line number 413. replacing to -> const markdown_dir = path.join(backup_dir, '_notes')

Ah, I missed line 413 which still included the graph name. Good catch! So are things working the way you want now? If not, there should still be a way using main.yml to move files.

@tharansakthi
Copy link
Author

It worked like a charm.
Thanks a lot for the help.

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