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

support repeated keywords in org mode files as arrays #11743

Closed
augustfengd opened this issue Nov 26, 2023 · 6 comments
Closed

support repeated keywords in org mode files as arrays #11743

augustfengd opened this issue Nov 26, 2023 · 6 comments

Comments

@augustfengd
Copy link
Contributor

augustfengd commented Nov 26, 2023

Hello!

Could we be able to specify array values in org mode content over multiple lines instead of suffixing the keywords with []. This would make the syntax less odd aesthetically (imo), and also allow terms to have spaces in them which is already the case for the other markup languages.

I've accidentally and pre-emptively submitted an implementation when I should've created a proposal first.

The goal would be these two front matters are equivalent.

#+categories: foo bar
#+categories: baz
+++
categories = ['foo bar', 'baz']
+++

Thanks!

@jmooring
Copy link
Member

instead of

That's a breaking change. We'd need to support both.

@kaushalmodi @niklasfasching Thoughts?

@augustfengd
Copy link
Contributor Author

Ah I apologize for my miscommunication. I meant to say in addition of: I've left in the if clause that handles keywords with [] suffixes for backward-compatibility sake.

One thing to note would be that the [] suffixed syntax doesn't support multi-word strings as the keyword values are going through strings.Fields(s string). In other words, these would not be the same:

#+categories: foo bar
#+categories: baz
#+categories[]: foo bar baz

@niklasfasching
Copy link
Contributor

I like it better than my [] hack, which was strongly guided by just wanting to expand the existing solution to other key names https://github.com/augustfengd/hugo/commit/fad183c4ae55069be9246e64ab1c8b2f43d08d06.

It does remove the ability to specify multiline strings in org front matter I gueee. I never used hugo enough to have any idea whether that's something you want to keep.

@augustfengd
Copy link
Contributor Author

@jmooring what should be the next steps relating to this feature request?

@jmooring
Copy link
Member

@augustfengd Testing with the current release and with your PR, it seems like the only functional improvement is to allow multi-word taxonomy terms. That alone I think is a valid reason to proceed.

Note that this is a breaking change for those who have been ignoring this warning for the past 4.5 years:

warn: Please use '#+tags[]:' notation, automatic conversion is deprecated.

Applicable to taxonomies named "tags", "categories", and "aliases", this:

#+tags: tag-a tag-b

...will produce a single term, while it used to produce two terms with a warning.

I'll re-open the PR for review.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants