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

Do not assume that a node is the entire file #203

Merged
merged 3 commits into from
Jan 29, 2022
Merged

Conversation

egh
Copy link
Contributor

@egh egh commented Jan 17, 2022

A roam node is no longer necessarily an entire file. It can be a file,
or any heading with an id.

Fixes #106

I removed the /file servlet, as it seems to not be used after this changed.

If a node is nested beneath another node, the entire content of the tree is returned. It's not clear to me from reading the org-roam manual what the content of the node is expected to be in this case, but returning the entire subtree seems fine to me.

I tested with the following files:

mixed.org:

:PROPERTIES:
:ID:       abc
:END:
#+title: Mixed node 1

This is a mixed node. This is the file node.

* Mixed node 2
:PROPERTIES:
:ID:       0472cac5-5766-4095-a4ed-f7be4da1c461
:END:

this is a mixed node. This is the heading node.
:PROPERTIES:
:ID:       foo
:END:

file.org:

#+title: Single file node

This is a single file node.
* Test node
:PROPERTIES:
:ID:       25d1e441-ca54-4658-a42b-38e13886412c
:END:

heading.org:

This is a heading node.
* Test node 2
:PROPERTIES:
:ID:       4253bf6f-5774-4c51-83a3-80e89ea09d14
:END:

This is another heading node.
** Test node 3
:PROPERTIES:
:ID:       88c5c090-aba8-47f5-9cc3-8c01a7cbc8ba
:END:
This is a subheading node.

A roam node is no longer necessarily an entire file. It can be a file,
or any heading with an id.

Fixes org-roam#106
@tefkah
Copy link
Contributor

tefkah commented Jan 17, 2022

I think you should indeed return the entire node, after all if you return a file-level node you would also expect the heading-level nodes there.

I will test this myself sometime soon, thanks for writing this up!

@tefkah
Copy link
Contributor

tefkah commented Jan 29, 2022

LGTM! I just added that the 1st heading wont be displayed when viewing a smaller node, because that looks kinda silly. There are some other things I want to add, such as proper support for TODO tags and markup in the title, and the ability to click on the headings to just view the smaller node, but I'll do that later.

anyway, thank you very much!

@tefkah tefkah changed the base branch from main to fix/106 January 29, 2022 14:46
@tefkah tefkah merged commit 835c002 into org-roam:fix/106 Jan 29, 2022
@egh
Copy link
Contributor Author

egh commented Jan 29, 2022

Thank you!

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

Successfully merging this pull request may close these issues.

[MINOR] Preview a node should only show that node, not the whole file
2 participants