-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
feat(summary) - replace existing summary, use a ranged tag #976
base: main
Are you sure you want to change the base?
Conversation
I like the idea a lot! What about a simple carryover tag instead of a whole
The EDIT: The I'm also unsure about just leaving the links hanging around and not in a list item. It looks good when it's just norg, but when running a norg formatter or converting to different file formats you'll get a weird looking thing like this:
Since all of the links are in a single paragraph. |
About the standard ranged tags ( |
Hey @vhyrro , I've tried to implement suggestions, with mixed results. I tried the carryover tag (see below), and I tried a bit more to put list items into a ranged tag. It still doesn't work for me. Maybe I should raise an issue about that separately. So, I pushed some changes:
So, the issues: List items / Headings inside of ranged tagsThanks for clarifying that it should work to put these inside of ranged tags. Of course it should work for examples. Still, something is up. In any norg doc, if I put a list item or a heading inside a ranged tag, treesitter no longer recognises the ranged tag. I see that in latest main, after running Given the following content:
I see the following in
I recommend checking out the PR and trying this. If you edit line 131, to use a I don't know how to debug treesitter beyond I can create an issue for this separately - maybe this is something which is just my environment? I tried it on 2 computers (both Macs), with the same results... Carryover tagsThere's a couple of challenges with using a
Maybe you have a solution in mind but ... given this "My existing heading", with some text below it ...
Now, "Some text" is considered contained by the summary node. A replacement would gobble it up. It'd be even worse if you happened to have a So, that's what led me to using a ranged tag. IMO it would be nice to introduce fifth variant of the ranged tag, Hopefully that all makes sense. Cheers. |
Sorry for making you wait - I should have time to properly review this tomorrow! |
Okay, this looks good to me! I'm refraining from merging it yet though, as from what I see the broken ranged tags are really messing things up 😅. I'm working on the next version treesitter parser and it's close to completion! |
sounds good to me |
Problem Definition
Why is this an issue?
Challenges
* Heading
or a- List item
inside of a ranged tag. I see an ERROR in:InspectTree
.^^
. Same result.Proposal
This approach throws out the old format of the workspace summary, but I think the result is OK. It's a bit of a tradeoff, but I think the benefit of the container (the ranged tag) outweighs the drawbacks of changing the format.
|group
because it seems the closest match of the four types. Perhaps we could call it|summary workspace
in future?#cat Groceries
- list
items because that would break the parser.:Neorg generate-workspace-summary
, the module checks for an existing ranged tag below the current heading. If it exists, replace it with the new summary.Here's an example of what it produces:
Some open points
|group summary
a good choice of ranged tag? Any suggestions?#cat CategoryName
an appropriate choice of carryover tag?|group summary
node. This would make the whole 'refresh this view' more easy to use. No need to fuss over the any more.Ta.