Replies: 3 comments 2 replies
-
Before going for what appears to be a complex solution with "Ivy dynamic collections", it might be still worth spending some time on But I believe that going with a simple and built-in framework with existing implementations might be worth considering before trying very hard to go with a custom solution. Let me illustrate what I mean below. The POC I have done is based on In addition, the "marker" might also be possible with an existing facility of "annotation" in the standard Completion. Org-roam uses it and you can achieve something like this: The number of backlinks is dynamically generated by SQL query. In theory, I think you can check existence of files in the hierarchy and then display the marker. The tag is now part of the searchable text, so that part is obsolete (this is an old screen shot of mine). These are built-in facilities, so you get them for free (not much custom scaffolding required). Having said this, I completely understand if these do not represent your direction. Just wanted to give a perspective, as I really like what you are doing with dendroam 👍 |
Beta Was this translation helpful? Give feedback.
-
Adding @nobiot POC for reference https://gist.github.com/nobiot/152a5f0e6f761f5100e6b4e019bf0ccf |
Beta Was this translation helpful? Give feedback.
-
I was further thinking how to approach this. I think the first step should be set This is a sample dendron schema: version: 1
schemas:
# this will match "cli.*" notes
- id: cli
# human readable description of hierarchy
desc: command line interface reference
# add this to the domain of your schema hierarchy
parent: root
# when a schema is a namespace, it can have arbitrary children. equivalent to cli.* glob pattern
namespace: true
children:
- cmd
- env
# will match cli.*.env
- id: env
desc: cli specific env variables
# will match cli.*.cmd.*
- id: cmd
desc: subcommands
namespace: true So the main fields an schema have are:
I can identify this atomic unit description of a hierarchy element, the rest (children or parents) If I would like to write this in elisp, it would be something like: '(:id "cli"
:desc "command line interface reference"
:parent "root"
:namespace t
:children ((:id "env"
:desc "cli specific env variables")
(:id "cmd"
:desc "subcommands"
:namespace: t))) Now, assuming this is the schema, what it's left is, how to read them, and to |
Beta Was this translation helpful? Give feedback.
-
This is an open discussion for implementing the Dendron's concept of schemas.
Since there is not too much people interested on the project itself I'm going to use it as bucket for ideas and resources I found useful for this. However If anybody wants to contribute into this brain storming your ideas are more than welcome!
Right now what I have is:
File type
Use YAML
I've found these two libraries that might be useful:
JSON
Json is another option that is very similar to YAML (personally I like it more) and I think that could be easily exported to YAML if needed.
Elisp objects
Another option can be just use elisp objects to represent schemas. This probably is the most convenient way in order to process values.
Schema location
I think schemas should live in the same folder as notes, so the can be version controlled along with them and are portable. This is what Dendron does.
I think as well that schemas should be in separates files, having all of them in one file will be tedious with a big number of schemas.
Schema UI
What I was thinking is to add this potential siblings of your note in the minibuffer as a candidate, with a marker indicating that the note doesn't exists but that the system is expecting it. Something like:
But this shouldn't stop you from creating a note outside of your schema if you need it, and the minibuffer can mark it as well
For this matter I think we need to use a dynamic completion list instead of an static one. For that reason I think
(completing-read)
won't work.I guess the best bet will be something like Ivy dynamic collections, the way it is being used in
counsel-locate
. This will allow to dynamically update the candidate list based on the search input, so we can show and hide potential childs that match the schema.Beta Was this translation helpful? Give feedback.
All reactions