I’m still very much of a noob and trying to find my way around everything, but I am happy with a daily notes template I built using advice from here that adds a kanji depending on the work days. It works very well, but it does create an empty line at the very top that I’m unable to get rid of. I’m a bit stumped what to do and was hoping someone would have an idea so I don’t have to manually get rid of it every day.
This is the code I use. I don’t understand why it creates an empty line since it just starts with an if clause that then calls to insert a header, but if I remove the line break, the header doesn’t get formatted as a header when the template is applied, so I’m guessing it’s necessary.
The trick in this variant is that we declare the different characters(?)/texts for the various days in a table, and then do one lookup into that table depending on which day of week it is, and use that to build up a intermediate text, dayText, for later usage.
I believe this gives a cleaner solution, where it’s easier to see what your template actually produces. It also simplifies the logic, and reduce on the complexitiy and number of calls to tp.date.now().