Code Monkey home page Code Monkey logo

org-roam-server's People

Contributors

alarsyo avatar alexpeits avatar codepiano avatar das-s avatar goktug97 avatar japhir avatar jethrokuan avatar kinredon avatar mirguest avatar natask avatar odomanov avatar tefkah avatar timquelch avatar wandersoncferreira avatar wohanley avatar yemeishenme 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

org-roam-server's Issues

org-roam-server slows down unrelated interactive commands

Hi, I am relatively new to org-roam world, and I've been using it just few days. But I started to notice weird performance issues occurring when executing unrelated interactive commands and I think this issue is related to org-roam-server.

Steps to reproduce

  1. start org-roam-server-mode on org-roam-directory with ~200 files
  2. open one or two files by both org-roam-find-file in emacs and org-roam-protocol click in org-roam-server browser window
  3. switch to completely unrelated buffer like your emacs config file
  4. turn on emacs profiler
  5. jk scroll for couple of seconds (basically DoSing emacs)
  6. turn off emacs profiller

Now you can see that aside from expected redisplay_internal, there is httpd--filter taking most of the CPU time.

...
+ httpd--filter                        474  55%
+ redisplay_internal (C function)      233  27%
...

full report

When I do something more natural in emacs, like searching for something in M-x and switching between few buffers, it is a server-process-filter which takes most of the CPU time.

full report

Expectations

Emacs should not feel sluggish when doing things unrelated to org-roam.

My setup

emacs 27.0.91, Arch Linux, vanilla doom emacs with org-roam and org-roam-server from github. Everything latest and up-to-date.

Can we have for each subdirectory a separate org-roam database?

Example:

dir_a/1_org-roam.db
  dir_a1/2_org-roam.db
  dir_a2/3_org-roam.db
dir_b/4_org-roam.db
  dir_b1/5_org-roam.db
  dir_b2/6_org-roam.db

Can I have such 6 different org-roam.db files, each for its own subdirectory .org files?

I am asking because org-brain has such a similar feature, called org-brain-switch-brain, where you can switch to another directory. Wondering if org-roam has a similar feature. Then both could work always in parallel. Separate org-brain, and its parallel friend org-roam. For those cases where you do not want to mix up things.

file-viewer - backlink ids are getting prefixed with "/"

In file-viewer tab, in roam-buffer pane on the right, clicking on backlink results in "Not Found" error in preview pane on the left because the link ids are consistently getting prefixed with slash:

<a name="backlink" id="/20200619173004-something.org" href="javascript:void(0)">Something</a>

Toplevel file links inside <h3> tag don't have leading slash and are working correctly, opening file to the left file preview pane.

This is an issue with server elisp code but it wasn't immediately obvious to me what exactly is causing it.

Set a different org-roam-directory in the server

It would be cool if the server could read local variables, like org-roam does, by being launched in the browser from emacs or set a custom org-roam directory from the browser, if one has more than one org-roam-directory, for instance defined in .dir-locals.el.
Yours is a wonderful addition to the nascent and expanding org-roam ecosystem. Thanks.

EmacSQL had an unhandled condition: "no such column: title"

What I expected:
Starting org-roam-server-mode in Emacs then navigating to localhost:8080 displays the org-roam-server graph.

What actually happened:
I started org-roam-server-mode in Emacs and receive the following error:
EmacSQL had an unhandled condition: "near line 891: no such column: title" 💥

Details:
Emacs: 27.0.91
Configuration: DooM
OS: Darwin/macOS
Emacsql-version: 3.0.0
emacsql-sqlite3-executable: /usr/bin/sqlite3

org-roam is working correctly in the same configuration.

The web application launches on localhost:8080, but does not display any org-roam contents.

My org-roam files are synced to Dropbox and all org-roam configuration points to the Dropbox folder containing them.

Troubleshooting steps:

  1. Remove all org-roam and org-roam-server configuration,
  2. restart Emacs, verify all is working as expected
  3. Add org-roam package and configuration, verify all is working as expected
  4. Add org-roam-server package, restart Emacs, verify problem persists
  5. Remove org-roam-server package
  6. Remove org-roam.db, restart Emacs
  7. Add org-roam-server package, restart Emacs, verify problem persists
  8. Remove org-roam-server package, restart Emacs
  9. Remove org-roam.db, org-roam files, set org-roam directory to new location, restart Emacs
  10. Add org-roam-server package, restart Emacs, verify problem persists

Each click on a node opens a new Emacs frame with a maybe "legit" link but NOT opening the corresponding buffer.

What I want to achieve:
org-roam-server should load corresponding window / frame

What I have:

Windows10

  • Emacs 27.096 Win-client
  • Installed org-roam org-roam-server and require org-roam protocol
  • Standard config from manual pages org-roam
  • Calling org-roam-server-mode works fine and shows anything I want it to show
  • Even “Database”, “Buffer” view automatically follows my buffers in the emacs client

Issue:

  • Each click on a node in the 127.0.0.1:8080 page opens a new frame of Emacs
  • And tries to open a file from the wrong path like so: c:/Program Files (x86)/Microsoft/Edge Dev/Application/85.0.538.0/org-protocol:/roam-file/?file=c%3A%2FUsers%2FJochenBurkhard%2FiCloudDrive%2FiCloudcomappsonthemove~beorg%2Forg%2F2020-06-04.org

Thank you in advance for your insight and support and greetings,
Jochen

image

image

Make port configurable

8080 is a fairly common local-use HTTP port and it would be good to make this configurable to avoid conflicts with other applications or other users.

Filtering by tags in org-roam-server does not work

The filter (at the bottom left of the server on 127.0.0.1:8080) in the "Database network view" supposedly takes input. When I type in the filter, it says "No Results Found", even though the tags exist in the roam files.

Expected behavior - it should display nodes with that tag.

[feature request] more robust filtering for org-roam-server

Current implementation of filtering is a whitelist of tags. But there are times when I would like a blacklist of tags instead. These hides a set of tags instead of only showing a set of tags.

For now I am modifying index.html as follows when I want a blacklist.
replace

         var view = new vis.DataView(nodeDataset, {
             filter: function (item) {
                 if (filters.size > 0) {
                     if (item.tags) {
                         tags = new Set(item.tags);
                         for (let filter of filters.values()) {
                             var parsed_filter = JSON.parse(filter);
                             if (parsed_filter.parent === "tags"){
                                 if (!tags.has(parsed_filter.id)) {
                                     return false;
                                 }
                             }
                         }
                     } else {
                         return false;
                     }
                 }
                 return true;
             }
         });

with

         var view = new vis.DataView(nodeDataset, {
             filter: function (item) {
                 if (filters.size > 0) {
                     if (item.tags) {
                         tags = new Set(item.tags);
                         for (let filter of filters.values()) {
                             var parsed_filter = JSON.parse(filter);
                             if (parsed_filter.parent === "tags"){
                                 if (tags.has(parsed_filter.id)) {
                                     return false;
                                 }
                             }
                         }
                     } else {
                         return true;
                     }
                 }
                 return true;
             }
         });

replacing !tags.has(parsed_filter.id) with tags.has(parsed_filter.id) and return false; with return true;

we can also extend bufferview(buffer network) with dropdownfilters and extra logic like globalview(database network).

ROAM_TAGS is here to stay, Therefore I think building on it in org-roam-server is sustainable.

Implementation schemes

  • another bar for blacklisting only.
  • modify dropdownfilters with extra options that select if the next tag is added to a whitelist or a blacklist.

Things to consider when implementing this feature

  • Which takes precedence on conflict, i.e, when a file is enabled through whitelist but disabled through blacklist. This can happen because a file has multiple tags and one of the tags is in whitelist while the other is in a blacklist. This can be exposed as a variable if needed.

Dark mode readibility

First of all, thanks for the great package! I really like the possibility to get an overview and also the new dark mode is a valuable addition.

Sadly, readibility due to low contrast for congested areas on my screen (1080p) in dark mode is often low, especially when zoomed out.
Here is a comparison between both light and dark mode for roughly the same area:
2020-05-22-191449_379x211_scrot
2020-05-22-191503_418x225_scrot

May I suggest a lighter grey or plain white for easier readibility?

Faster Loading

Filter Database View

It would be awesome to have an input on the database view to filter the nodes by title (or some other attribute) and get all nodes connected to the input match.

Output encoding

First absolutely great tool, super helpful for weekly consolidating of notes, and free roaming. Thanks for building this.

Issue: I seem to be seeing output encoding as is & instead of & (as intended) in the graphs. As I use a lot of & and apostrophes, so this seems to turn up everywhere.

image

Is there a way to change the default HTTP port?

I'm really enjoying using this code in my org-roam setup.

I'm working on a website, and I debug changes to the website on a localhost web server running on port 8080. It would be nice if I could change the HTTP port for the org-roam-server to something other than 8080 so I can use both at the same time.

Is there a way to do this?

Thanks!

org-protocol-open-file not working

org protocol was creating buffers pointing to %2path%2Fto%2Ffile.org. I added (setq file (org-link-decode file)) to org-roam-protocol-open-file to solve this issue.

Preview Mode – CC Mode is incompatible

Enabling Preview and mousing over a node yields the following:

500 Internal Error

Internal error when handling this request.

error: (error CC Mode is incompatible with this version of Emacs - support for the ‘syntax-table’ text property is required.)

I'm using Emacs 26.3 on NixOS. It looks like a problem with my Emacs but this is the only place I've seen it. I'm also surprised that CC Mode is even relevant here.

The links are not drawn

If you set this parameter, the links are not shown.
org-roam-server-network-arrows t
It worked a few commits ago.

[Feature Request] Differentiate Notes from Tags by color-coding based on number of lines?

My tag files tend to have the same number of lines since it's mainly just template + linking other files through - tags ::. You can use the number of lines to differentiate notes from tags.

I was thinking tags should be grayish, whereas notes should be more saturated. Maybe even extend it further by making the color saturation a spectrum so you can differentiate between small notes and large notes.

include file error in "file viewer"

when I include a file using#+INCLUDE,there is an error error: (error Cannot include file ~/.emacs.d/elpa/org-roam-server-20200608.1547/,I don't konw how to solve it.

Org-roam-server may change the export of inline images

Hello,Thanks for this awesome project.

But,I encountered a problem when I using org-roam, that is, the picture will not be exported. I am very puzzled. I checked for a long time, until I closed the org-roam-server-mode, everything works well again, I guess there may be some problems.

Can anyone help me?

HTML attributes being placed incorrectly in inline images

Hi,
When I add an HTML attribute to an inline image, it gets added to the surrounding <p></p> element: for example:<p width="400px"><image ..... /></p>

However, if format my image link in a way that breaks the regexp that filters for the image path and manually export my org file to HTML, then the width attribute gets applied properly: to the <image/> element itself. This however breaks the image preview in org-roam-server

My elisp is pretty poor so I couldn't understand how to fix this but overall, we just need make sure that the enclosing paragraph element doesn't get inserted

Node-color documentation

I'd like to categorize my nodes and have org-roam-server's database display reflect that categorization with the colors of the nodes. The problem is that I can't tell what currently governs the color.

A note about that in the README would be much appreciated, even if it's just a reference to a dependency. Thank you!

Title of node

situation: If I enter an quite long notes title, then the name of the node is something like this.
屏幕快照 2020-05-23 下午3 11 49

feature request: It would be better if there is a param we could set the max length of the name in one line shown in the graph.

This feature is shown below, implemented by roam research
屏幕快照 2020-05-23 下午3 08 51

Graphs are not shown (blank page with 5 buttons only)

  1. I installed the package from MELPA as per the instructions, without visible problems.
  2. started the server, without seeing any special notice.
  3. When I open http://127.0.0.1:8080/, I see only 1 button in the top-left (enable preview), 3 in the top-right (database network, buffer network, file viewer) and 1 at bottom-right (reload, in red), but nothing is showing in the central space (see attached screen capture).
    RoamServer-WhitePage

When "File viewer" is pressed, 2 rectangles appear and in the top-left a combobox appears, but without any options. Near it, top-left from the left rectangle, a blue "Back" appears.

I'm in Debian 10 with i3, and tested with Firefox 68.8.0esr and Google Chrome 81.0.4044.138 (Build oficial), with the same result.

How can I help to debug this issue? Any more info, or some specific test?
I'm not very knowledgeable on code or development, but can follow instructions. :)

Thanks a lot...

Filename too long

After updating org-roam to version 1.1.1, I get the following error on /roam-data:

`(file-error Opening input file File name too long /home/matt/roam/{"nodes":[{"id":"20200529150127-lisp","label":"Lisp","url":"org-protocol:/roam-file?file=%2Fhome%2Fmatt%2Flog%2FOrg%2Froam%2F20200529150127-lisp.org","path":"/home/matt/roam/20200529150127-lisp.org","group":4}…`

It then proceeds to list out all my roam nodes.

[Feature Request] Save local static copy of the graph

The graph is absolutely great for visualising note relationships and weekly reviews.

If I want to export a topical Buffer Network (or even a full database network), it would be great to be able to share a "static local" copy of the graph + notes that can then be added to for example, an online blog, or a quick set of notes with friends.

Usecase - example: you study for a course, and have your notes, but also want to share this with others in the class. Example: you create a course and want to give people a layout view of the topics, from which they can drill down.

[Feature request] directed graph

Thanks for all the hard work. It will be nice to have an option to display forward links and backward links as separate edges connecting files. It makes it easier to figure out which file is the linking originating from.

[Bug] emacsql-error "near line 13: no such column: files.file"

Just installed org-roam-server for the first time, the webpage loads but there's no content. All the drop-down menus are blank and no graph is displayed. In the console I see a 500 error being received on the roam-data API call. Delving into the httpd emacs messages, I found the error emacsql-error "near line 13: no such column: files.file" printed every time the page tried to query roam data.

Allow Server Access from other devices

I would love to be able to point my ipad to my computer and access the server, unfourtunately I can only access it at localhost:8080 but not at 192.xxx.x.xxx:8080.

Node preview produces "500 Internal Error"

Hello,

For some reason when I enable the preview of OR notes I get the following error:

"error: (wrong-type-argument stringp nil)"

Any idea how I can go about debugging this issue?

Thank you!

Preview stops after code in SRC area is evaluated

Hi,
I come up with an issue with org-babel. When I try to preview an org file with SRC area inside, emacs ask me to evaluate the code. whether I choose evaluate or not, it won't show the preview in the browser.

condition:

  1. emacs 27
  2. org-roam-server: updated at 2020-06-03
  3. SRC code type: plantuml
  4. browse: chrome

Thank you!

P.S: Is the browser you are using in the README an emacs-embedded one?

Feature Request on Filter with ROAM_TAGS

The tag of org roam dont show up in title, so we could not find out files by tag in org roam server right now.

Aside, filters on tag system can do quite a lot as we could make up our own structure by tags.

Needs a way to authenticate clients

As it is, any local process (including web browsers), whether owned by the org-roam-server user or not, can access all of the org-roam data. This poses a fairly significant security risk, especially on multiuser systems. HTTP authentication would (hopefully? I don't know how to do this in elisp) be fairly trivial to implement and could help out here.

error: (emacsql-error no such column: refs.type)

Hey! Thanks for putting this project together.

Im trying to get this going and am running into some errors:

Image 2020-05-11 at 3 54 47 PM

Im using doom emacs and this is the related config I have going:

;; .doom.d/config.el
(setq org-roam-directory "~/Desktop/03-resources/org-roam")
(after! org-roam
  (setq org-roam-graph-viewer "/usr/bin/open")
  (setq org-roam-ref-capture-templates
        '(("r" "ref" plain (function org-roam-capture--get-point)
           "%?"
           :file-name "websites/${slug}"
           :head "#+TITLE: ${title}
#+ROAM_KEY: ${ref}
- source :: ${ref}"
           :unnarrowed t)))
  (setq org-roam-capture-templates
        '(("d" "default" plain (function org-roam--capture-get-point)
           "%?"
           :file-name "${slug}"
           :head "#+TITLE: ${title}\n"
           :unnarrowed t))))

(require 'simple-httpd)
(setq httpd-root "/var/www")
(httpd-start)

(use-package org-roam-server
  :ensure nil
  :load-path "~/Desktop/01-projects/org-roam-server/")
;; .doom.d/init.el
(org +roam)

Do you have any suggestions on how to debug this?

[bug」config org-roam-server-port doesn't work

org-roam-server version: 20200624.1658

I have set

(use-package org-roam-server
  :ensure t
  :config
  (setq org-roam-server-host "127.0.0.1"
        org-roam-server-port 18080
;; ...

but the server still listening 127.0.0.1:8080

Open org files in another buffer

Thanks for your project, it's really awesome !

I would like to have the same behavior as the gif in your readme : when I click on a node I would like to open it in another buffer, not in the current one (the EAF browser buffer).

It's not the case from scratch, so have you done some modifications in your EAF config to make it possible ?

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.