cmal_0807 · 2022-11-10 02:26
Recently I've started using org-roam to build my note taking system.
I am wondering whether there is a recommended workflow for using org-roam to read source code managed by git?
What I am imagining is that:
1. When I open a source code file/buffer, the notes I've taken before would show highlight in the buffer.
2. I can read the notes I've taken, and travel from notes to source, under org-roam
's help.
3. The notes can record the git commit hash of the selected text if any. If I want to travel from notes to source like in 2.
, it will show the historical file content when the notes were taken, if the file has changed.
FrozenOnPluto · 2022-11-10 04:06
Your source or annotating someone elses? You want a separate note file to the code, not something tangled together?
itistheblurstoftimes · 2022-11-10 04:12
Never used Adobe. [https://www.qoppa.com/pdfstudio/](https://www.qoppa.com/pdfstudio/) does everything I have asked of it.
SasukeUchiha231 · 2022-11-10 05:04
I think rather than org roam, you should have an org file which tangles the source code with babel. If that's too complicated, comments often work best, which is what i used
acow · 2022-11-10 05:38
[org-remark](https://github.com/nobiot/org-remark) hits some of your requests, but I think lacks the git parts in point 3.
DefiantAverage1 · 2022-11-10 12:18
This is awesome! I'm interested in maybe extending this to support git hash snapshots (if I can think of a way + get free time to do it)
acow · 2022-11-10 13:45
I really like the idea of git hashes attached to notes; it’s something I’ve specifically wanted before.
One minor word of caution about the `org-remark` model is that the syntax highlighting impact if you’re also using LSP on a file can be a bit heavy (ie underlining links to notes in the source code clashes with other syntactic highlighting). I find that a notes file that links into the source code is usually enough for me. What might work better for me is a fringe indicator with a link to notes. I’ve not spent the time to try to make that happen.
AndreaSomePostfix · 2022-11-10 14:28
mmm I got this but it is pretty adhoc for my system: I had to modify the capture of template of notes to add that info in a property and write some Elisp to extract things so that I can see my notes by mode, project or file.
I am missing the highlighting and navigation because I didn't need them yet :P
fuzzbomb23 · 2022-11-12 21:04
Since the notes are going to live in org-roam, see what the org-remark manual says about customising the location of the notes files.
[How to Change Where Marginal Notes File is Saved](https://nobiot.github.io/org-remark/#How-to-Change-Where-Marginal-Notes-File-is-Saved)
fuzzbomb23 · 2022-11-12 21:16
For parts 2 & 3, try these:
* [git-link](https://github.com/sshaw/git-link) package. It supports a good number of online git hosting services. It also integrates with git-timemachine package, and can provide a link to a specific version of a file.
* [orgit](https://github.com/magit/orgit) package, which provides Org link types pointing to Magit buffers (including log and revision buffers). Optionally, [magit/forge](https://github.com/magit/forge) and [orgit-forge](https://github.com/magit/orgit-forge) packages might be useful too, for noting issues and pull requests.