Hi I am working on some tiddlywiki development tools and wondering if there were a way to import pragma/macro/procedure definitions from a textarea field in the current tiddler.
To illustrate this I will show code that does not work
\import [all[current]get[local-pragma]]
This would allow me to separate out any pragma from R&D tiddlers text field so there is no need to scroll down to the tiddler body as the pragma gets longer.
- the Import variables widget has the same limitation as the filter only returns tiddler titles that are subsequently imported.
Perhaps there is a work around, however I would also be interested in seeing if a slight modification of the \import
pragma or another created, could be made to get it working.
- The pragma is defined here $:/core/modules/parsers/wikiparser/rules/import.js
- perhaps modify the importvariables widget, however it will need to be closed at the bottom of the tiddler
- it is defined here $:/core/modules/widgets/importvariables.js
- perhaps this could be given additional parameters tiddler (defaults to current tiddler) and field. Its in Javascript so I can’t understand it.
- Clone and modify to ImportVariablesHere is another approach
Why;
- Keep the scope of the design effort to one tiddler, no need to define global values in separate tiddlers
- When you have a lot of pragma simplify editing the body
- Allow the local override of a core widget or macro like in a “sandbox”
- Allow such tiddlers to be shared including their pragma
- Developing new utility procedures, widget, functions and filters in a “sandbox” like tiddler.
- No tagging etc… of an external tiddler.
I already have an equivalent form for a local view template that is drawn from a textarea field. I just add the field and the local view template is applied.
- I may try and do something similar for local styles as well