Hello! I am trying to figure out how to either delete the tags field altogether and then re-create it as a new field or change the output format when I export the tiddler.
The output that I am looking for is ['tag1', 'tag2', 'tag3']
Again it can either be in the tiddler itself or in the output of a custom exporter - the goal is to have that format when exported.
Thank you so much for working with this! What I have already done is create an exporter that exports to a markdown file. What I have done is create a way to create and edit blog posts in tiddlywiki and then export them for use in the nodejs static site generator eleventy. The tags are used as front matter and need to be in the format described. Originally I was using āpostTagā to generate my tags but I have found that most if not all pre made templates use ātagsā and it would probably be easier to change things on the tiddlywiki side.
`---`
<$fields exclude='text bag created modified modifier revision type published' template='$name$: $value$
'></$fields>`
---
`<$view field="text" format="text" />
```
as you can see I have kept the tags field in the exporter because right now I just use the one tag āpostā and that works fine but I need the desired output for multiple tags.
Here is what the exported final product looks like.
One idea I had which I will look into when I get up is excluding the default tags field and creating a custom field tagsFoo and finding a way to drop the Foo on export.
Thank you again for your consideration!!
edit: oh and it is a single file wiki but Iām just as comfortable transitioning to a node wiki I already have a couple of those as well.
How did I miss this plugin??? I have been looking for something like this for years! IMO Tiddlywikiās adoption will increase through itās use as a tool for outputting or connecting to other applications/platforms like this. After playing around with MySQL a couple years ago I had an epiphany and started looking at TW like a database instead of a wiki and it completely transformed how I used it.
Iāll play with the plugin tonight but yes it looks like the answer. I am a bit hesitant to rely too much on plugins since they might stop working with updates and a ānativeā answer would be educational but at this point probably not necessary.
Thank you both!!
edit: Iāll play around with it tonight and if it works Iāll mark it as the solution
Sadly this isnāt it. The output for the tag field is tags: ['post,Musings,Test'] and I need tags: ['post', 'Musings', 'Test']. Also, I donāt see any way to include the custom fields that I added in the export with this plugin. Iām sure it is possible with a much higher level of JS than I have but I am not even close to that yet. Hopefully there is a more ānativeā way to accomplish this. Any help is appreciated. Thanks!!
edit: Even just pointing me in a direction you think might help I am not looking for or expecting someone to solve the problem for me. I have played around with trying to delete and modify shadow tag tiddlers without any success.
Note how you use the wikify widget just in time, to remove unwanted wikification
I suggest you
use a -tags to not pass on the standard tags field during export
construct a "tags": <<format-tags>> in the correct format for your output, in the position your template would output the tags such as after the title.
But we will if you canāt proceed
I can help you more tomorrow (23hours from this reply) if necessary.
It took a lot of playing before I remembered that templates take returns literally when using the list widget (or any widget I guess bc I had to take out the return between the field widget and ātag:ā as well). The output was adding a return after each tag in the exported file but not in the test wiki which was maddening! Final product for my export template:
I use the official TW markdown plugin to edit the tiddler and then when it is exported with the view widget and format='text' the markdown is preserved. I pretty much do all my editing with markdown now since it is more portable and the plugin allows tiddlywikiās macros to work.
Hey man thank you again. I figured for learning sake I would try a solution with my original idea of subtracting a prefix by taking taking apart what you did. After an embarrassingly long time I came up with
where thetags field has the value mytags and the postTags field has the value of the set of tags in the desired format. The output is then tags : ['Musings', 'Test', 'Boop'] as desired. Of course I had to take the returns out for the template - which has led me to looking into inline vs block mode.
I like your solution better because itās nice to use the default tags behavior but itās cool to come up with another way.
All this is a very long winded way of saying thank you for the help and even more the lesson!
Oh. Thatās a bug in my plugin that you wouldāve been welcome to report. I havenāt seen this before, but I hope to fix it this weekend. (You probably have no need for it now, but others may.)
Adding custom fields to the YAML front matter is an interesting idea that I can probably add too.