Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

neuron v2 support #62

Open
srid opened this issue Jan 24, 2021 · 16 comments
Open

neuron v2 support #62

srid opened this issue Jan 24, 2021 · 16 comments

Comments

@srid
Copy link

srid commented Jan 24, 2021

The query has changed; will need something like this to quickly pull in all zettels.

let l:cmd = g:neuron_executable.' -d "'.g:neuron_dir.'" query --cached | jq ".result | .vertices | to_entries[] | [.value]"'
@chiefnoah
Copy link

Sorry, slightly off topic for this issue, but was this actually a v2 change? I've noticed this plugin being broken on neuron 1.9.6.5 for what looks like this issue.

@srid
Copy link
Author

srid commented Jan 25, 2021

1.9.6.5 is pre-v2, and v2 is designed to break a number of things (so as to accomodate the new architectural changes). v1 (which this plugin works with) can still be installed using:

nix-env -if https://github.com/srid/neuron/archive/v1.tar.gz

@chiefnoah
Copy link

It looks like this might be a more extensive change than just tweaking the command for listing zettels. Is there any documentation on the return format for neuron query? I have some changes necessary to get refresh_cache_callback not immediately failing, but it's not immediately clear to me how to fix zettelQueries no longer being a direct child of the zettel objects.

I'd also be hesitant to rely on jq for this plugin. My WIP changes currently expect that, but IMO it'd be better to just traverse the json structure in viml directly.

@fiatjaf
Copy link
Owner

fiatjaf commented Jan 26, 2021

Will there be a binary release of Neuron 2? I need that to use the plugin against since I deleted all my Nix environment (I love Nix, but my computer is not good enough for it).

@srid
Copy link
Author

srid commented Jan 26, 2021

nixpkgs static builds are broken in master ... so unless somebody volunteers to resolve it, I'd say unlikely.

@srid
Copy link
Author

srid commented Jan 26, 2021

Is there any documentation on the return format for neuron query?

Nope; but we should probably clean up its JSON output before finalizing 2.0.

@chiefnoah
Copy link

Nope; but we should probably clean up its JSON output before finalizing 2.0.

I sadly don't know Haskell or have time to learn it right now, but once the JSON format is 'stable' for v2.0 I plan on attempting to fix up this plugin for it.

@fiatjaf
Copy link
Owner

fiatjaf commented Jan 28, 2021

nixpkgs static builds are broken in master ... so unless somebody volunteers to resolve it, I'd say unlikely.

Oh, ok, I didn't know that. I thought binaries were still a thing. I guess I will reinstall nix then.

@srid
Copy link
Author

srid commented Jan 30, 2021

I've added neuron query --zettels and neuron query --tags that should be helpful for editor support.

Change: srid/neuron#547

Docs: https://neuron.zettel.page/query.html (do a full browser refresh if you see the old docs)

@srid
Copy link
Author

srid commented Jan 30, 2021

@chiefnoah take a look at the new (final?) query interface ^

hopefully that's sufficient to use it in neuron.vim

@srid
Copy link
Author

srid commented Jan 30, 2021

also checkout --cached mode, which really makes things fast on larger zks.

@chiefnoah
Copy link

The PluginData JSON structure is still rather confusing. Can you write up some documentation on how to correctly interpret that?

Example:

    "PluginData": [
      [
        [
          "DirTree",
          []
        ],
        {
          "dirParent": "index",
          "meta": null,
          "childrenTag": null,
          "tags": [
            "root"
          ]
        }
      ],
      [
        [
          "Links",
          []
        ],
        [
          [
            [
              "0de24d86",
              "cf"
            ],
            []
          ],
          [
            [
              "neuron",
              "folge"
            ],
            []
          ]
        ]
      ],
      [
        [
          "Tags",
          []
        ],
        {
          "Queries": [
            [
              "TagQuery_TagZettel",
              "zettelkasten"
            ]
          ],
          "Tagged": [
            "zettelkasten"
          ]
        }
      ],
      [
        [
          "UpTree",
          []
        ],
        []
      ]
    ]

The rest of it is fairly obvious, but this is laid out in a rather confusing way and I'm not quite sure how to interpret it.

@srid
Copy link
Author

srid commented Jan 30, 2021 via email

@chiefnoah
Copy link

For fixing neuron#tags_search, which queries for zettels based on tags.

srid added a commit to srid/neuron that referenced this issue Jan 30, 2021
@srid
Copy link
Author

srid commented Jan 30, 2021

@chiefnoah Just added neuron query --tag=foo

@chiefnoah
Copy link

I think my changes to support v2 are done and can be seen on this branch.

@fiatjaf how do you want to handle the v1/v2 split for this plugin?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants