I’ve just read about $:/core/ui/ViewTemplate/body/code
and have tied this in a tiddler:
<$tiddler tiddler={{!!target}}><$transclude tiddler="$:/core/ui/ViewTemplate/body/code"/></$tiddler>
This will display the code of the tiddler identified by the //target// field. Fine. Yet I have two questions:
- if the target is a tw5 tiddler, its code is shown but without syntax coloration. Is there a way to have this feature enabled?
- if the target tiddler had a //code// tag, could there be a way that, by itself, this tiddler would be displayed as code and yet interpreted as usual when transcluded? The new 5.2.1 mechanism of cascade would surely be of help.
I have tried creating a $:/config/EditTemplateBodyFilters/code
tiddler with the $:/tags/EditTemplateBodyFilter
tag and the following text:
[[$:/core/ui/EditTemplate/body/code]]
Then I edited the core tiddler $:/tags/EditTemplateBodyFilter
to get this in its list
field:
$:/config/EditTemplateBodyFilters/canonical-uri $:/config/EditTemplateBodyFilters/default $:/config/EditTemplateBodyFilters/code
But it’s not enough, even if my source code tiddler is tagged code
(just a wild trying, no objective reason to believe it would work).
Looking at the core source code, I saw some stuff in the //templates// folder, but it’s a bit confusing, especially with templates/javascript-tiddler.tid
and its <script
which is not closed before the </script>
Thank you for your help!