Code Monkey home page Code Monkey logo

nroam's Introduction

nroam https://github.com/NicolasPetton/nroam/actions/workflows/test.yml/badge.svg

Update: With the release of org-roam v2 and its new revamped side-buffer, I do not feel the same need for nroam as I did with org-roam v1. The project is now archived, but if someone wants to port nroam to org-roam v2, I’d be willing to hand over maintenance of the project.

nroam is a supplementary package for org-roam that replaces the backlink side buffer of Org-roam. Instead, it displays org-roam backlinks at the end of org-roam buffers. The user can also click a button to see unlinked occurrences of the buffer title (as defined by org-roam-unlinked-references).

Screenshots

Backlinks

screenshots/backlinks.png

Unlinked references

screenshots/unlinked-references.png

Rationale

One of the ideas behind nroam is to remove the friction and effort it takes to consult backlinks. I consider backlinks to be a very central piece of information about a note. Backlinks can even be the most important content of a note, for instance when using page links as tags.

It is easy to miss backlinks when they are not always visible with the main content of a note. The side buffer will not always be open, and even if it is, the information it contains is visually far away from the note you’re looking at.

By making them an integral part of the org buffer, backlinks also become more powerful. You could for instance make a sparse tree—see org-sparse-tree — to filter the contents of a note and its backlinks at the same time.

Installation

nroam is not yet available in MELPA. Until it is, you can install the Elisp files by hand in your .emacs.d or if you use straight.el add the following to you init file.

(use-package nroam
  :straight '(nroam :host github
                         :branch "master"
                         :repo "NicolasPetton/nroam")
  :after org-roam
  :config
  (add-hook 'org-mode-hook #'nroam-setup-maybe))

Setup & usage

To setup nroam for all org-mode buffer, evaluate the following:

(add-hook 'org-mode-hook #'nroam-setup-maybe)

The linked references section will be updated after each buffer save. It can also be manually updated by typing C-c C-c anywhere in the linked references section.

Warning

This package is in its infancy. Be careful when using it as it modifies your org-mode buffers—it should not modify your files though. Backup your data often.

nroam's People

Contributors

cdlm avatar damiencassou avatar nicolaspetton avatar whil- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nroam's Issues

possible to refile to nonexistent header and loose data

When doing a visual refile from a split window on another buffer I have the option to refile to the Backlinks header. org-refile lets me do this, but nroam of course does not allow filing there, so the refiled header just disappears.

I wonder if this is possible to fix within the bounds of org-refile. Is there a way to designate a header not a valid refile target on the fly?

Can't add a file local variable

In an org-roam buffer managed by nroam, type M-x add-file-local-variable RET ispell-local-dictionary RET "french" RET.

  • Expected: a few lines added at the end of my buffer to remember I want spelling of this file to be checked against the French dictionary.
  • Actual: an error message "Text is read-only".

Workaround

Temporarily disable nroam-mode

Nroam entries duplicated

When I refresh the buffer with C-c C-c in any header (org-ctrl-c-ctrl-c), a duplicate nroam heading is generated.

Every time I use this function, a new header is added.

All functionality works for all generated backlink headings.

My config:

 (use-package nroam
    :after org-roam
    :config
    (add-hook 'org-mode-hook #'nroam-setup-maybe)
    :bind
    (:map org-roam-mode-map ("C-c n n" . nroam-update)))

nroam deletes my text

  1. Call M-x org-roam-dailies-capture-today
  2. Type some text and validate the capture with C-c C-c
  3. Call M-x org-roam-dailies-capture-today again
  4. Type some text and validate the capture with C-c C-c
  5. Call M-x org-roam-dailies-find-today to show the resulting org file

Expected: the texts I typed on steps 2 and 4 are all visible
Actual: I only get the text I typed on step 2.

Feature request: option to show backlinks in side buffer

Thank you Nicolas for creating this!

I am torn between Logseq and org-roam as I really want backlinks with context, but I want Emacs + having backlinks shown on the side also (as most of my writings happen in daily notes and I would tidy them up while looking at the linked reference). I almost cried when I found this. nroam is almost exactly to what I need, except where backlinks are shown.

I understand the side buffer is what you didn't like. But it would be great to have a option to show backlinks back int the side buffer, but with outline subtree!

Unlinked references does not work with evil

Wonderful. Really like the way it's implemented. Another advantage is of course that working with a sidebar is not ideal when the frame need to be kept very narrow (i.e. alongside another app).

How does the unlinked feature work, BTW? Right now, with evil enabled (in Doom Emacs) when in normal mode nothing happens (I'm assuming there are many unlinked references) when I push or click with the mouse. When I switch to "insert mode" push the org button (press), the text breaks (new line is inserted).

support for exporting to the html project

I use org-publish-current-project to export my org-roam folder files into a html project.

After using nroam, I am not able to export my files.
I am getting Text is read-only message when I am trying to do it.

I use following config to do exporting by using .dir-locals.el

((nil . ((eval .
;; (require 'ox-publish)
(setq org-publish-project-alist
      '(
("org-notes"
 :base-directory "~/.org-roam/"
 :base-extension "org"
 :publishing-directory "~/.org-roam/public_html/"
 :recursive t
 :publishing-function org-html-publish-to-html
 :headline-levels 4             ; Just the default for this project.
 :auto-preamble t
 )
("org-static"
 :base-directory "~/.org-roam/"
 :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
 :publishing-directory "~/.org-roam/public_html/"
 :recursive t
 :publishing-function org-publish-attachment
 )
("org" :components ("org-notes" "org-static"))
      ))
))))

Nroam swallows heading when reordering

I just started using Nroam and I really like it. It's nice to have the backlinks within the context of the buffer they're for. One problem I've run into is when reordering a heading to the end it disappears. I presume that this is due to the backlinks readonly section. This only happens with the last heading. If I disable nroam-mode, the problem disappears.

ezgif com-gif-maker

Setting org-mode hook makes RET on roam links stop working

Within doom emacs, so I suspect my specific keybinds will be different from vanilla but not the base issue:

When I set

(add-hook 'org-mode-hook #'nroam-setup-maybe)

hitting RET on roam links emits evil-ret instead of +org/dwim-at-point, which normally opens links. If I issue +org/dwim-at-point the links work fine, so the issue is in the mapping of RET.

Additionally, the nroam text at the bottom of the buffer says

* Backlinks                                                        :noexport:
** 23 linked references

But the linked references headline has no children.

I note that if I activate nroam manually while in a file links still work, but the lack of references remains. The lack of references is perhaps a different issue, but I mention it here just in case it's related.

This just started happening after I updated to the most recent version, a few days ago.

Here I must admit that I have a hideously complex and baroque setup, so this is probably nroam interacting poorly with something mysterious somewhere. If there's anything I can do to get a more helpful narrowed down repro, please let me know.

Unlinked references do not work on Termux/Android

I don't think there's probably anything to do about this one, but using Emacs under Termux on Android, (where Org-Roam, sqlite, and rg/ripgrep all work), Unlinked References in nroam aren't shown, but rather a message is displayed:

"rg" must be compiled with PCRE2 support

(Obviously this is an issue with rg on Termux rather than an nroam issue. I assume.)

straight installation

Great package. seamless integration into org-roam without any issues.

Can you add following in yr readme for straight users:

(use-package nroam
  :straight '(nroam :host github
                         :branch "master"
                         :repo "NicolasPetton/nroam")
  :after org-roam
  :config
  (add-hook 'org-mode-hook #'nroam-setup-maybe)
)

Org roam capture templates leads to "Text is read-only." error

Seems there is interference between nroam and org roam capture templates.

Using org-roam-capture leads to the following printed in the message-buffer:

user-error: Text is read-only.  Please adjust ‘org-roam-capture-templates’

Using a custom daily capture template led to this:

org-roam-capture--fill-template: Text is read-only

Last bit of file being marked read-only breaks refiling

I have a file that looks like

* header1
* * sub1 
* * sub2

* header2 
* * sub3
* Backlinks

The "Backlinks" is, of course, being generated by nroam. If I try to refile (using visual refile) to header2, I'm told that "Text is read-only". I can refile fine to header1. I am 90% sure this is being caused by nroam. Somewhat oddly, I also get this error when trying to do an org-capture to a datetree file (so, the place that's being filed to is not at the end of the file), which is what gives me that 10% of doubt, but disabling nroam lets me refile again, so I'm pretty sure.

Feature Request: option to have backlinks appear folded on start

Just what the title says. I would like the option for the the initial state of the backlinks to be folded, because I keep opening files and thinking "oh crap this is much bigger than I thought" then realizing why. I'd suggest a variable that could be set by the user. I expect showing up unfolded is probably still a reasonable default for most people.

Control the initial fold state of the backlinks headline

@NicolasPetton, thanks for such a useful package.
I found myself with the need of always expanding the backlinks headline when opening a file, as I can visualise links right away. So I adviced one of the methods as follows:

(warning: my elisp is basic)

(defun sn/advice-nroam--set-sections-visibility (orig-func &rest args)
  (let ((org-startup-folded 'showeverything))
         (apply orig-func args)))

(advice-add 'nroam--set-sections-visibility :around #'sn/advice-nroam--set-sections-visibility)

If you like the idea of adding a custom variable to your package, I am happy to contribute the changes.
Otherwise, I can just live with my advice function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.