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

Preview mode #64

Closed
SYNTAXDZ opened this issue Aug 15, 2021 · 11 comments
Closed

Preview mode #64

SYNTAXDZ opened this issue Aug 15, 2021 · 11 comments
Labels
major feature Feature request which goes beyond the basic graphing capabilities

Comments

@SYNTAXDZ
Copy link

Hi, does org-roam-ui support preview-mode when you hover a node like org-roam-server ?

@Hellseher
Copy link
Contributor

Hi @SYNTAXDZ If you check README there is a list with planned features, and file viewer is not implemented yet.

@SYNTAXDZ
Copy link
Author

ok, thanks for your reply

@tefkah
Copy link
Contributor

tefkah commented Aug 15, 2021

That is correct, file viewer-like capabilities will be implemented in the future!

@tefkah
Copy link
Contributor

tefkah commented Aug 15, 2021

Explanation for the delay:
We will add this in the future. One of the branches has a rather shoddy implementation, but we have not incorporated that into the main one and most likely won't any time soon. We would like to not rely on Emacs to convert your org-files to HTML and instead use an AST parser like Orga or Uniorg. However, these packages are in a bit of a pickle atm because the Unified framework they build upon just changed to ES modules a couple of weeks ago and they will need to adapt. We will wait until they do or we find a suitable workaround, but it will take a bit.

@tefkah tefkah added minor feature Feature request inline with current graphing capabilites major feature Feature request which goes beyond the basic graphing capabilities and removed minor feature Feature request inline with current graphing capabilites labels Aug 16, 2021
@rasendubi
Copy link
Contributor

I have tried to convert Uniorg to ESM-only before but that failed because the unified ecosystem itself didn’t finish the migration at the time and I’ve hit a couple of bugs here and there. It looks like it’s done now (unifiedjs/unified#121 (comment)), so I might try again somewhen this month.

This will require changes to org-roam-ui though because you cannot import ESM from a commonjs module (https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). Also, ESM support in nextjs is still experimental (https://nextjs.org/blog/next-11-1#es-modules-support).

If you need a workaround, the easiest option is to pin unified packages to the previous major version. e.g., npm install unified@9 vfile@4 etc

@tefkah
Copy link
Contributor

tefkah commented Sep 6, 2021

I have gotten OrgaJS working in the meantime, so this option is now definitely on the table. I've been very busy with other things lately so I haven't tried implementing it yet, but will in the foreseeable future!

If you have any ideas on what kind of behavior you would like to see please let me know! The UX part of this is much more difficult than the software part

@rasendubi
Copy link
Contributor

kk. If you need any help with getting the software part of Uniorg working though (getting it up and running, fixing any bugs, or implementing missing features), just ping me—I am more than willing to help.

(I am the author of the uniorg so I am obviously biased here, but the very reason I started it is that orga is a lousy org parser. When I used it for my website, it failed to parse lists correctly and thrown exceptions on ~10% of my pages.)

@tefkah
Copy link
Contributor

tefkah commented Sep 12, 2021

Ah I see, I didn't notice you were the one who wrote uniorg! I indeed had similar trouble getting uniorg to work, but I think that was mostly due to not having the package pinned.

I have no horse in this race, but I would of course prefer accurate parsing over... well, not that. What 10% did you notice Orga missing? Were they some specific Org features or was it just a general error margin? Given that you went through the trouble of writing an entire parser yourself because of this inaccuracy, I think it would be wise of me to consider that haha

@rasendubi
Copy link
Contributor

What 10% did you notice Orga missing? Were they some specific Org features or was it just a general error margin?

Cannot attribute this to any specific org feature but when I ran Orga on all my notes, it just failed to parse some portion of them (thrown exception = no output). On many other notes, it produced incorrect results (mostly bad handling of lists with nested indentation, quotes, etc.).

I don’t want to sound picky but I just put the first random note from my org-roam into orga playground and it couldn’t even parse the file properties drawer.

Here is an example of some other issues with Orga. (You can try the same example in Uniorg playground for comparison.)

Org-mode source
:PROPERTIES:
:ID:   this-is-id
:END:
* Issues with lists

One empty line in the middle of an item messes the list completely:

1. list 1
   1. world

   2. list 2?
2. list 3??
3. item 3

   item 3 continues?
4. item
   #+begin_src fundamental
   hello
   #+end_src

This should have been a top-level paragraph but it is not. (Because of src block before?)

- this must be a new top-level list

** a headline nested inside a list??

* Reset
Tags are not parsed in lists:
- [[https://example.com][Example]] :: Hello there!
- [[https://github.com][GitHub]] :: This is GitHub, your hub for Git repos.
- *Gitlab* :: Alternative to GitHub
- /Sourcehut/ :: Another alternative to GitHub that primarily uses email-based workflows.
- /Codeberg/ :: *ANOTHER ALTERNATIVE*
- /*self-hosting Git server*/ :: /*The ultimate Git solution for privacy-oriented individuals!*/

* Missing support
** Fuzzy links
no fuzzy links: https://example.com/

** Escapers in src block
No escapers in src block:
#+begin_src c
,*a = 0;
#+end_src

** superscript/subscript
- hello^world
- H_2

** fixed-width
: hello
: world

** LaTeX
\begin{equation}
a + b
\end{equation}

Inline latex: $$a + b$$

@tefkah
Copy link
Contributor

tefkah commented Sep 13, 2021

Wow thank you for the extensive demonstration! Those are indeed quite some issues, the LaTeX one is really big for me as I use it extensively throughout my notes (although this can apparently be solved by using a unified plugin in Orga, orgapp/orgajs#41).

I guess the main worry I had with uniorg was speed, but (even though this isn't a fair comparison because it's based on the implementation etc) your playground parsed my 10k+ words document with a ton of LaTeX faster and obviously much more accurately than on Orga, so I'm sold! The only upside I now see for Orga is it's ability to render JSX from Org files, which, while cool, I don't see a clear usecase for right now.

I will try to get Uniorg working, thanks for your detailed exposition! :)

@tefkah
Copy link
Contributor

tefkah commented Oct 11, 2021

It's here!

@tefkah tefkah closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major feature Feature request which goes beyond the basic graphing capabilities
Projects
None yet
Development

No branches or pull requests

4 participants