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

Additional template options for new zettels #3

Open
abers opened this issue Jul 25, 2018 · 6 comments
Open

Additional template options for new zettels #3

abers opened this issue Jul 25, 2018 · 6 comments

Comments

@abers
Copy link

abers commented Jul 25, 2018

I was wondering whether it would be feasible to add options to allow users to modify the default template for new zettels. For example, currently when a new zettel is created it generates a YAML with title and date. It would useful if users could specify in .vimrc a list of any additional items to include in the YAML (e.g. tags) as well as another list for any section headers to automatically add with specified header level (e.g. # or ##) and 1-2 new lines separating them. For example, I try to ensure every zettel has a "Related" section for links to related zettels and a "References" section for any books, journal articles, and so on referenced in the zettel. Would be handy if there were automatically added to any new zettel created.

@michal-h21
Copy link
Owner

@abers that is a good idea. It is now possible to configure used template and custom variables for the front matter. The configuration can be set per wiki, so it can use a different templates for Markdown and Vimwiki syntaxes.

Sample configuration:

let g:vimwiki_list = [{'path':'~/scratchbox/vimwiki/markdown/','ext':'md','syntax':'markdown',}, {"path":"~/scratchbox/vimwiki/wiki/"}]                                  
let g:zettel_options = [{"front_matter" : {"tags" : ""}, "template" :  "~/mytemplate.tpl"}]

The example requires tags field in the YAML front matter and uses ~/mytemplate.tpl file as a template for the Markdown syntax. There is no configuration for the second Wiki. The order of configurations in g:zettel_options must be same as the order of configured wikis in g:vimwiki_list

@abers
Copy link
Author

abers commented Jul 29, 2018

Thanks! Given it a test and all is working perfectly.

@michal-h21
Copy link
Owner

Great! I've also fixed other things. Do you have ideas for more features?

@abers
Copy link
Author

abers commented Aug 2, 2018

No ideas that are fully formed. Unsure how easy or not it would be in vimscript but I was planning to have a go at writing a Python script that would scan through all the files in a directory, check which ones are linked to which, and then return a list of zettels that have no links or the links are broken / have incorrect titles. Could then build off of that to add features so that if the title of a zettel changes you can quickly search and replace all links for it, return all zettels that reference another one, etc.

@michal-h21
Copy link
Owner

Something similar is in fact also on my ToDo list, I want to create some sort of inbox, where all notes not referenced by any other note would be collected. I am still not sure which language to choose, I feel that Vimscript may be not fast enough and it is really hard to debug (at least for me). If you are willing to create such tool in Python, it would be really great.

@abers
Copy link
Author

abers commented Aug 9, 2018

I am very much a beginner Python user so may be some time till I get around to it. However, will let you know if and when I do. It might be worth creating separate threads for each feature idea, with basic details in terms of function, rationale, planned way to implement it. Then others can chip in with ideas for refining or extending it etc.

Have you seen sublime_zk, the zettelkatsten plugin for Sublime Text? Might be a few feature ideas to garner from it. Also unsure if you are a member already but there is a Research Hacking slack group of academics interested in improving their digital workflows. A lot of early discussion on the group was around the zettelkasten method, and there are a small number of vim users on it. May be worth asking folk on there if there are any features they'd be interested in.

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

No branches or pull requests

2 participants