Zettelkasten Forum


Archive Template

Hi All, would anyone have a really good template to share as an example of layout, structure,tags, title etc? Struggling with this one currently. Would be appreciated...

I meant to ask is it possible to embedd images into my notes? I did a search saying it was coming?

Comments

  • @scollops71 Not sure what you are looking for but I'll share my starting template for most of my zettels. I use a pair of Keyboard Maestro macros to help with this. It has taken me a while to evoke to this point and that evolution continues. Some of the areas of the YAML Block are not used for every zettel but are there for a reminder.

    Create Note
    YAML Block

    Will Simpson
    My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
    kestrelcreek.com

  • Will, thanks for this anm still learning, where and how do I use Maestro and YAML? As such run these macros.

  • Keyboard Maestro is an application that automates action on a Mac. It allows one to script actions, like creating a new note. What I referred to as a YAML Block is just my personal implementation of the note's metadata. YAML is used in various programs and file conversion tools. It is referred to as a YAML header, coming at the beginning of a file, but I like it better at the end. It helps with search, sorting, scripting, keeping references in the right place. and acts as a reminder to add appropriate tags, links, biographical data, and context all in the same place of each note.

    If you have a Mac and The Archive installed take a look at the note "Welcome to The Archive" it will reveal the answers to many of your questions.

    Some zettelnauts use text replacement tools to fill in a basic template once a new note is created. On a Mac there is the Text setting in the Keyboard section of the System Preferences which can be used as a way to create "templates".

    I sense you have more and broader questions. Our friend @Sascha and his partner in crime @ctietze are sequestered away in a secret mountain chalet deep in the Black Forest working night and day on an online class and a book all about Zettelkasting. :wink: Till the online class and book surface check out the Zettelkasten YouTube channel.

    Will Simpson
    My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
    kestrelcreek.com

  • You might also want to have a look at the "interactive" demo Zettelkasten that you can download and browse in your note archive app of choice:
    https://github.com/Zettelkasten-Method/The-Archive-Demo-Notes

    (Revised this a couple of times but there are probably still typos and grammatical errors 😬)

    Author at Zettelkasten.de • https://christiantietze.de/

  • @Will Thank you kindly for your kmmacro and all your hard work producing new productivity tools for use with The Archive. Greatly appreciated! I have been able to tweak and adapt the macros to a format I use. A task which would have been impossible without you laying the foundations as I am very new to KM and still learning.

    I have a request, as I have struggled all day to 'reverse engineer' a macro from your 'Create Note with YAML' provided.

    I want to (in my case) append the YAML block to existing notes that do not contain this information as yet. So a KM macro to 'auto-fill' the metadata (as it does with your macros for newly created notes).

    Type: # //this field can remain empty for manual input
    Title: %Variable%zettelTitle%
    Date: %Variable%humanTime%
    Note/Resource ID: [[%Variable%zettelUID%]]
    Area: //this field can remain empty for manual input
    Project/Subject: //this field can remain empty for manual input
    Project ID/Subject ID: //this field can remain empty for manual input
    Keywords: # //this field can remain empty for manual input


    I'd be grateful for your help and insight.
    Thank you for your help in advance.

  • @shauxesis Thank you for your kind words.
    I'm happy you are finding some value in my meager Keyboard Maestro macros.

    I'd recommend against trying to retrofit metadata into old notes. It becomes a maintenance nightmare. What happens when you read a post describing a new and cooler way of including some new nugget of metadata, do you go back and add it to all the old notes? What happens when you discover you no longer use a piece of metadata, do you go and remove it from every note? What happens when you change your mind?

    I strive to be moving forward and let the past be the past. Here is an early note and you can see all kinds of problems but time is too short to spend time maintaining old stuff. It is there in my Zettelkasten to be discovered and that is what matters. Today I have 1233 notes in my Zettelkasten.

    The YAML Block is separate so it can be maintained in one place as I use it in a couple of macros. It has already gone through a few interactions. And who knows, I may abandon the whole thing.

    One thing you might consider is that as you discover valuable connections with your older notes, add the block or part of it where appropriate. A year from now things will be different yet again.

    Will Simpson
    My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
    kestrelcreek.com

  • edited May 2020

    @Will Thank you for taking the time to reply.

    I strive to be moving forward and let the past be the past.

    A very wise sentiment. Thank you for the reminder :) I do have a tendency to try fix the past with the present way of doing things, particularly with writing. An unfortunate carry-over from my Windows days, prior to moving to Mac, when my filenames and creation dates became corrupted, losing all use and context. As a screenwriter, this did a number on my usually very ordered mind and system with repercussions still felt to this day... thus the pursuit of an automation method to assist with my current endeavour ;)

    It was this that ultimately led me to discover the Zettelkasten, of which I've been a follower and supporter since before the early Beta testings of The Archive. And you are correct, I have grown and evolved in my understanding and learning over the years, as I hope to continue to grow moving forward.

    Who knows what the future holds, eh?

    Thank you again for taking time to respond. I'll probably end up scratching my head over this one for a while... I'm more intrigued now to know whether it could be done rather than if it should be done ;)

    Wishing you safe and well.

  • @shauxesis this could be done but your right to consider if this should be done. All one would have to do with Keyboard Maestro is to look into each note and see if it already had a metadata block and if not append one to it.

    I took a moment and constructed a macro that would do what you asked. I still don't think you should retrospectively add this to every single note but here goes.

    Test this. There are no guarantees that this won't destroy you zettelkasten. There is no graceful what to undo the changes. and weird things happen.

    I ran this on a subset of my notes (copied into a test directory) and here is the result.

    Before

    After

    Keyboard Maestro Macro "Adding metadata to all notes"

    Will Simpson
    My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
    kestrelcreek.com

  • @Will Thank you for taking time to look into this for me. You are a good man!

    It was only after the fact that I remembered I had forgotten to actually express my exact usage and requirements, but I didn't want to be a nuisance. In part yes, historical notes (that should be left in the past, as I'm coming to agree), but I am also creating new notes by breaking down specific source texts I wish to open dialogue with, within my Zettelkasten.

    An example of this is Joseph Campbell's, A Hero with a Thousand Faces. Each chapter is broken down into its parts (topics or arguments are usually denoted by the subheadings already in the book) as individual zettels. I use DEVONthink to split the book into its parts, each however, doesn't contain the metadata I use to identify and distinguish this 'curated' resource from my 'created' content. It's a long and tedious process, but for specific, cherry-picked texts, well worth the effort. As a writer, an incredibly valuable resource for cross-referencing and making connections during both the academic and creative stages.

    I know not everyone would agree with this system of implementing source literature into a Zettelkasten, but in this digital age, we have the freedom now to interact more thoroughly with the source instead of limiting ourselves to just referencing it in an external holder. Just my take, anyway... and I do enjoy debating with the text directly ;)

    As such, I am very grateful indeed for your help.

    p.s. I attempted to download the macro, but the link appears to be broken.

    Thank you again for your help!

  • @shauxesis
    Here is a corrected link.

    It does sound a bit convoluted what you are trying to do with your zettelkasten. There may be other ways Keyboard Maestro can help.

    I too am a writer and use my zettelkasten for research and first draft. Then I export to IA Writer for more editing and then pandoc for PDF, docx, epub formating. The Archive has a really nifty feature where you can do a search in The Archive and once you're satisfied that you have what you want in the Note List you can select all and "Reveal in Finder" and all the appropriate notes are selected in Finder and you can copy them to a temp folder and manipulate from there without worrying about the originals.

    Will Simpson
    My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
    kestrelcreek.com

  • edited May 2020

    @Will

    Always wonderful to meet a fellow writer! What a bunch we are ;)

    You are very right, my current process is convoluted (and takes time away from the creative) but I just don't have the know-how as yet to flex the full powers of Keyboard Maestro or AppleScript to speed things along. I've also only just learnt about pandoc... but again, I fear beyond me.

    iA Writer is a fantastic app! I too use it in conjunction with The Archive. Particularly loving the new ==highlighting== syntax. Now, just need to work out how to !create my own templates. (!: read - procrastinate)

    If you ever feel like sharing your creative workflow, it would be great to see how you manage things and speed processes up so you can spend more time on the actual writing :)

    Regarding the Keyboard Maestro macro, thank you. The link downloaded perfectly.

    I've spent the better part of the day working with it to see if I could adapt it so that it prepends, rather than appends. Seems it is not as simple as flicking a switch between the two actions. And I fear, with my very limited skills as this point in time, Keyboard Maestro and RegEx are well above my capabilities. But I am trying to learn :)

    So, if it wouldn't be too much to ask, would you mind taking a look at what I have so far and see if you can bridge the gap for me? I'd be very grateful.

    In brief, this is what I'm trying to achieve:

    1. I use a space-space between my datetime ID and filename. For the life of me, including the use of online RegEx generators, I can't seem to work out how to remove the two spaces and one dash from the filename, without removing too much or too little, for the zettelTitle variable. The variable currently outputs: - this is a filename instead of this is a filename

    2. In the YAML, I'm trying to change (Date: %Variable%day% %Variable%month% %Variable%year% at %Variable%time%) to read as humanTime (as in your YAML). I got it to work, but it was reading today's date rather than the %zettelUID%. (I'm assuming this is because it is referencing an existing variable and not a newly created one). I removed this action with the intention to try figure it out later, thus it is not included in the macro attached.

    3. Referencing this source (after a lot of googling): Is there a way to prepend text to a file? - Questions & Suggestions - Keyboard Maestro Discourse I attempted to tweak the 'amend' to 'prepend'. I somehow got this working, but then the humanTime got me in a muddle, now I can't remember what I did to make it work.

    the outcome i'm hoping to achieve

    https://www.dropbox.com/s/3900xmt4vbd554l/prepend metdata to all notes.kmmacros?dl=0

    All the best and thank you in advance.

  • @shauxesis What do you want to capture with your regex? Do you want to get all but the space-space part, or only the title?

    Author at Zettelkasten.de • https://christiantietze.de/

  • @ctietze I want to capture the entire filename That follows the ‘ID - entire filename’

  • Then the first link to an interactive regex should serve your needs, right?

    Author at Zettelkasten.de • https://christiantietze.de/

  • edited May 2020

    @ctietze Nearly there :) Can the RegEx also include the extension .md?

    I tried this: (?<=[0-9]{12}\s-\s)(.+)(.[^.]+)

    Where (.[^.]+) is the extension, I believe, but I can't get it to remove from the output leaving just the filename.

    Appreciate your help!

    Post edited by shauxesis on
  • edited May 2020

    @shauxesis Working with regex is addictive. Here is a simpler all-purpose regex to parse your file names. To get note title and extension call groups $3$4.

    (.*)(\s-\s)(.+)(\..*)

    This regex creates 4 groups that can be reformated (substituted) in a variety of ways.
    $1 - this group is the 12 digit UID
    $2 - this group is - and can be left out of the substitution
    $3 - is the title of the note
    $4 - the file extension

    Don't call the ones you don't want This little regex can be reused in other scripts that only what the UID or want the title in front of the UID. Just call them in the order you want them.

    Post edited by Will on

    Will Simpson
    My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
    kestrelcreek.com

  • This is a very complicated thread. I want to go back to the beginning where @Will described the Keyboard Maestro macro that he uses to create the structure for most of his notes. @Will has done us all a service by describing both a useful structure and a way to automate its creation.

    The forum has many threads devoted to this topic--all seeking: (1) the "best" structure for a note, and (2) how to create it painlessly.

    Having recently migrated from TA to Drafts, I thought it would be useful to describe how this problem can be approached with Drafts.

    One option is to use Keyboard Maestro. @Will's macros should work immediately in Drafts. I use KM a lot, so @Will's approach is very appealing. But, it is not optimal for Drafts because it requires a person to purchase and learn to use KM, and because KM does not work on iOS, while Drafts definitely does.

    Another question is whether there is a "best" structure that should be automated? I think the answer is no.

    Example: Assume that you are doing an ecological study of a National Park.

    (1) Your research might involve analyzing a half-dozen books. You might want to use a structure very similar to the one that @Will uses. But, wouldn't it be more convenient to use a different structure for each book so that relevant tags and bibliographical information were filled out only once?
    (2) You might create notes based on analysis of various kinds of maps - weather, hydraulic, topographic, tax parcels, etc. Maps would require different kinds of information than do books.
    (3) You would probably want to conduct oral interviews - with park rangers, academics, and the occasional grizzly bear. The information needed to document an oral interview would be much different from the bibliographical information recorded for a book. Phone numbers, email addresses, whether the interview was recorded, where the interview recording is stored, etc.
    (4) Finally, you would undoubtedly hike through the park, making observations as you go. You would use your iPhone to dictate notes, or at least the beginnings of notes. Your preferred structure might automatically add the latitude and longitude of the observation - one of the many advantages of a mobile ZK. You don't need latitude and longitude for your ZK if you are sitting patiently in front of your computer -- but, is there no where else to learn?

    The assumption that a ZK is developed sitting in front of a computer reading a book is severely limiting. The possibilities of collecting information extend far beyond your local library. Even if you do all of your research reading books in front of a computer (what a painful way to read a book!) your needs are unlikely to precisely match those of all the other people developing sore necks reading books in front of their computers.

    So, IMO, no single structure suffices. It would not be unusual for a particular ZK to benefit from several different structures. And, most Zettelkastens would benefit from the ability to collect information while not sitting in front of your computer -- perhaps far afield using your iPhone.

    In Drafts flexibility is provided by: (1) It works on iOS - it goes where you go, and (2) Use of "templates." A template in Drafts is just another draft (note in TA, sheet in Ulysses) that has the tag "template" assigned. Templates are easy to create and can be used to initiate notes with many different structures. If you create structures manually -- without the assistance of automation such as that provided by @Will's KM macros then you already know how to create a template.

    How does this work? A "New with Template" Action provided by the developer is used. It works immediately; no configuration or third-party software is required. When you activate it (say by keyboard shortcut) the Action pops up a menu of all templates (i.e., drafts with the tag "template"). When you make a selection, a new draft is created.

    A couple of other things: When you use a template to create a draft, any tags assigned to the template are automatically added. Templates and the "New with Template" action work on your Mac, iPhone and iPad.

    A template looks much like the structure that @Will uses with KM, customized for any special requirement. Need a date? Add this to the template: [[date]] Need a UID, add this: [[date|%Y%m%d%h%m]] All the Markdown formatting codes work. Latitude and longitude can be added when working with your iPhone in the field -- or museum, or crime scene, or classroom, or looking for a new house, or bird watching, or tracking grizzly bears.

    Put your ZK in your pocket and use whichever template is appropriate in the moment.

  • @Will Thank you for your help. I will have a play. This is really becoming an education which is much needed and appreciated! :)

    @bjbarry Drafts is indeed a fantastic app. I am a subscribed user. For my own purposes however, as a Zettelkasten, it is still limited in function due to the database lock-in of notes. I use DEVONthink to index my Zettelkasten (which lives in Dropbox) and can find links and connections across my curated and created content. For my specific use, it is a powerful and efficient system for cross-knowledge management. However, if usage and function does not extend to these requirements, yes, Drafts is a great Zettelkasten holder indeed with action and templating superpowers. If the developers ever opened up the app to allow external folders (much like Ulysses has), it would indeed be a compelling alternative. Until then, the steep learning curve with KM, RegEx and scripting (as illustrated in the above previous posts) continues with the very kind help and guidance of @Will ;)

  • edited May 2020

    This is fun for me as I get to learn a bunch too.

    @shauxesis said:
    2. In the YAML, I'm trying to change (Date: %Variable%day% %Variable%month% %Variable%year% at %Variable%time%) to read as humanTime (as in your YAML). I got it to work, but it was reading today's date rather than the %zettelUID%. (I'm assuming this is because it is referencing an existing variable and not a newly created one). I removed this action with the intention to try figure it out later, thus it is not included in the macro attached.

    The humanTime is set as the current time in the action "Set Variable “humanTime” to Text
    %ICUDateTime%MM-dd-yyyy hh:mm a%" of the YAML Keyboard Maestro macro.

    %ICUDateTime% is a built-in function in Keyboard Maestro that returns the current time which is what you want when you are creating a file. I use this macro when I'm creating a Zettel. I'm still looking at converting a UID to a readable date and time. I got the date looking pretty but still working on the time.

    3. Referencing this source (after a lot of googling): Is there a way to prepend text to a file? - Questions & Suggestions - Keyboard Maestro Discourse I attempted to tweak the 'amend' to 'prepend'. I somehow got this working, but then the humanTime got me in a muddle, now I can't remember what I did to make it work.

    Please be careful

    Yes, I made a few tweaks. This takes into account the - in your file names. Image below shows what I've been able to come up with for prepending metadata to EVERY NOTE. Review the macro and be sure you understand how it works. In an ideal world, you'd set up a test environment. I am a bit apprehensive as this is a global change and will affect your 3829 (just a guess) notes. Many if not most would not benefit from this treatment. Most of these notes will just get the blank metadata block and you will not take the time to visit and fill in the unique parts. Maybe it would be better to have this macro only act on the note you are looking at, prepending the metadata when you have time and are able to fill in the unique data. One at a time. I'm not sure how much time you'll save applying this across you zettelkasten as apposed to applying this as you are working. This way you could easily have different metadata blocks for different purposes. This is how I'd approach this.

    It might be better to copy a select group of your notes to a temp directory then run this macro prepending the metadata then copy them back if satisfied with the change. These macros are sensitive to file naming conventions and can easily break. I've added a rudimentary backup sequence the might save the day. Dropbox has a versioning system but it would be very cumbersome to restore 3829 files one at a time.

    My Changes

    Will Simpson
    My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
    kestrelcreek.com

  • @Will Thank you so much! I will take some time to get familiar with what you've done before implementing anything. I'll report back once I have full digested the info. Your help has been greatly appreciated!

  • @Will I have now had a chance to look at the macro and test. Thank you! It works great. Very smart to build in the backup test folders as a failsafe ;) Moving forward, this will definitely make my life a little easier processing curated work, but it will be used lightly in conjunction with your wonderful 'create new Zettel note' macro. Truly grateful for your help, wisdom and efforts in this endeavour!

  • edited January 2021

    how do you handle the title as a YAML key value? When using title: no explanation needed we run into a problem when the title contains a colon followed by space:

    title: this: title
    

    to solve this we can place the title in parenthesis:

    title: "this: title"
    

    but additionally we need to handle unmatched quotes:

    title: "this: "title"
    

    i am going to simply remove all colons from the title because i think i won't ever need it.

    title: this title
    

    A more robust solution is to replace all quotes with single quotes and place the title always in double quotes:

    title: "this: 'title"
    

    my first Zettel uid: 202008120915

  • title: "this: \"test"

  • edited February 2021

    @pryley i see it is working, thank you! I tested character escaping before but outside the quotations and this didn't work. I didn't realize i overlooked the most obvious :p

    I am going to always quote the title and escape all double quotes. use single quotes instead of escaping because it looks nicer.

    my first Zettel uid: 202008120915

Sign In or Register to comment.