Skip to content

File properties #28

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

Merged
merged 2 commits into from
Nov 5, 2020
Merged

File properties #28

merged 2 commits into from
Nov 5, 2020

Conversation

karlicoss
Copy link
Owner

No description provided.

@@ -717,26 +719,25 @@ def __unicode__(self):
def __str__(self):
return unicode(self).encode('utf-8')

def get_file_property(self, property):
# todo hmm, not sure if it really belongs here and not to OrgRootNode?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I'm following your project and just saw that comment, maybe this is helpful: https://orgmode.org/Changes.html#org935ad43

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. Inheritance for properties will work also for this level. In other words: defining things in a property drawer before the first headline will make them "inheritable" for all headlines.

So imho it makes sense to move this to OrgRootNode

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, thanks for a heads-up! I think what they mean are the actual properties drawers though? (as opposed to file properties file #+TITLE:). That would mean moving _properties field and the related parsing code to OrgBaseNode.

This todo, however, refers to file properties like #+TITLE or #+FILETAGS, so it kinda makes sense that only OrgRootNode has the corresponding methods. On the other hand, currently level 1+ nodes would just return None, so it's not too bad either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, makes sense. I was confused by "things before the first headline", i had the impression a file property #+title would be equivalent to a :title: in a property drawer. But your explanation seems more logical ;)

@karlicoss karlicoss merged commit b64dd8f into master Nov 5, 2020
@karlicoss karlicoss deleted the file-properties branch November 5, 2020 22:38
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.

3 participants