michal-h21 / vim-zettel

VimWiki addon for managing notes according to Zettelkasten method
MIT License
557 stars 73 forks source link

Fallback on regular Markdown heading for the Zettel's title #79

Closed mickael-menu closed 2 years ago

mickael-menu commented 3 years ago

I'm not a fan of the YAML frontmatter in my markdown files and was wondering if there's a way to have a fallback on parsing the title from the first heading in the document (or to simplify, the text after # on the first line)? The use case is when autocompleting a link [[, I get [filename](filename) since I disabled the frontmatter.

Here's how neuron handles it:

You can explicitly specify a title using the title metadata; otherwise, Neuron will infer it from the Markdown heading or Zettel ID.

Thank you for all the effort you're putting in this plugin, it's particularly useful!

TS-CUBED commented 3 years ago

Second that one. It would be great to have the option to use the markdown header as the zettel title (in addition to the YAML frontmatter).

mickael-menu commented 3 years ago

I opened a PR for this fix, if you want to try it out: https://github.com/michal-h21/vim-zettel/pull/82

TS-CUBED commented 3 years ago

Hi Machal

Great. That works.

I had started to work on a similar solution. Your regex kung-fu is better than mine ;-)

I can confirm that this will take the first of the following

Seems to work with both my Zettlr files and vim-Zettel files without breaking the old format.

As far as I understand this needs to be changes in vimwike html export as well.

I'll close my branch.

Best T

On Tue, 2020-11-10 at 12:01 -0800, Mickaël Menu wrote:

CAUTION: This message was sent from outside the University, purportedly from noreply@github.com .

Please check the sender is legitimate before responding. Please treat any links or attachments with care - do not follow or open them unless you are sure they are genuine.

I opened a PR for this fix, if you want to try it out: #82https://github.com/michal-h21/vim-zettel/pull/82

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/michal-h21/vim-zettel/issues/79#issuecomment-724934173, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMOMX2H4TD5AKAUOBOV7KY3SPGLYRANCNFSM4TNZOM5A.

--

Dr. Torsten Schenkel Dr.-Ing. habil. CEng FIMechE Associate Professor of Continuum Mechanics

Sheffield Hallam University Department of Engineering and Mathematics College of Business, Technology and Engineering Room 4206, Sheaf Building Sheffield, S1 1WB UK

Tel +44 (0)114 225 6294 Email t.schenkel@shu.ac.ukmailto:t.schenkel@shu.ac.uk WEB https://www.shu.ac.uk/about-us/our-people/staff-profiles/torsten-schenkel EC2M3 https://blogs.shu.ac/ecm https://blogs.shu.ac/ecm github: TS-CUBED - https://ts-cubed.github.io/

mickael-menu commented 3 years ago

As far as I understand this needs to be changes in vimwike html export as well.

Ha could be that I missed it, I'm not using the HTML export myself and focused on the [[ completion use case.

michal-h21 commented 2 years ago

This functionality should work now, thanks to the PR, Vim-zettel can read title from the first header.