ndwarshuis / org-sql

SQL backend for Emacs Org-Mode
GNU General Public License v3.0
100 stars 9 forks source link

[Feature request] parse the content of outline level 0 #28

Open jarofromel opened 2 months ago

jarofromel commented 2 months ago

Hello, some of my org files have some content before the first headline:

#+title:       file title      
#+date:       [2024-09-12 Thu 17:19]
#+subtitle: file subtitle with short description

summary of the file, notes/todos relevant to the content of the whole file

* first headline

Now everything above the first heading ends inside the column outline_preamble of the table outlines. I would say the content before the first heading is "officialy" approved from the org-mode 9.6 and it is named as the level 0:

3.3.7. Property drawers allowed before first headline Property drawers are now allowed before the first headline. Org mode is moving more towards making things before the first headline behave just as if it was at outline level 0.

I have read your comment and I understand the reasoning related to finding the proper schema for properties on the top level. I think there are three ways of properties/attributes/metadata declaration on the level zero and they are not equivalent to my knowledge (Setting Properties for org-mode whole buffers).

--------------------------------------1st
#+title:      file title
#+filetags: tag1:tag2

--------------------------------------2nd
:PROPERTIES:
:YEAR: 2015        
:END:

--------------------------------------3rd
#+PROPERTY:  YEAR 2015

But it seems to me that the other content fits quite good as the level zero to the current schema of org-sql tables (at least that is my naive point of view). Hey I know it is not for free so the label 'feature request'.

My other argument is that it used to be quite a niche (to have content on the top level) but it seems to me there is a rising community of users around org-roam or denote who use it rudimentary (many small level zero like org-mode files rather than several files with dense headings). These are potential users of org-sql. I myself use both denote and the classical org style with headings.

Thanks for potentially considering this.

ndwarshuis commented 2 months ago

I think there are three ways of properties/attributes/metadata declaration on the level zero and they are not equivalent to my knowledge

How are 2 and 3 different? They both provide a toplevel "YEAR" property to any headline in the buffer if queried with org-entry-get.

But it seems to me that the other content fits quite good as the level zero to the current schema of org-sql tables.

I'm not sure what you mean by this

it seems to me there is a rising community of users around org-roam or denote who use it rudimentary (many small level zero like org-mode files rather than several files with dense headings)

Good to know, I didn't realize this.

I don't have lots of time to prioritize writing code for this now but if you want to continue this feel free to do so.

jarofromel commented 2 months ago

I think there are three ways of properties/attributes/metadata declaration on the level zero and they are not equivalent to my knowledge

How are 2 and 3 different? They both provide a toplevel "YEAR" property to any headline in the buffer if queried with org-entry-get.

You are right they are just different ways to tell the same.

But it seems to me that the other content fits quite good as the level zero to the current schema of org-sql tables.

I'm not sure what you mean by this

By that I meant other elements like links, timestamps, paragraphs, bullet lists, clocks. By including the top level into the table headlines and saying it is the ordinary headline (with value 0 in the column level) its direct children elements (other than headlines) can be included in other tables as well.

it seems to me there is a rising community of users around org-roam or denote who use it rudimentary (many small level zero like org-mode files rather than several files with dense headings)

Good to know, I didn't realize this.

I don't have lots of time to prioritize writing code for this now but if you want to continue this feel free to do so.

I understand, thanks for the answers. I am not an experienced in elisp but at least I can try, the issue you mentioned is good hint.