Folks,
I would like to raise the question of “Adding code snippets to TiddlyWiki documentation or otherwise”.
The Question
As the new and improved ways to contribute to the documentation become available will we enhance the documentation with better examples and snippets?, or should we consider building a separate plugin containing these snippets ?
Background
If you surf your way through tiddlywiki.com you will often find examples that also include a snippet or example of code you can try and or copy to clipboard.
Now in the above example it may be of value to copy to to the clipboard and use this in your own code however it is not going to be that common.
If now you go to WidgetMessage: tm-add-field you see this;
- No examples, no snipits etc…
I would like to populate tiddlywiki.com with more code snippets with the various forms of a given widget so once we find what we are looking for there is a convenient copy to clipboard snippet to make use of that widget in our wikis.
Action send messages are a particularly good case to consider because they are usually part of a larger piece of code such as a button or an ActionSendMessageWidget and an example less likely.
Here is an example of the above with snipits and inline example.
We could
- Introduce a view template to all tiddlywiki.com tiddlers that looks for $:/snippits/tiddlername and displays it below the body and then as we build our snippets plugin if installed all the snipits become visible.
- OR just edit the existing tiddlers to include this extra “documentation”.
An advantage with the separate snippet plugin is it is a separate development effort and not so tied to the formal release of tiddlywiki.com even if it was installed by default.
What are your thoughts?