On Thursday, April 23, 2015 at 1:06:10 AM UTC-7, Stephan Hradek wrote:
>
> For documentation purposes I've put some Perl code in tiddlers.
> At the moment I'm using "text/plain" as the tiddler type, but I'm 
> wondering how I could register a new type "text/perl".
> First it wouldn't be different from "text/plain", but maybe it's possible 
> then, to change, for example, the font size or the font, when the "proper" 
> mimetype is used?
>

Here's how you find the right place:

First, search by filter for [tag[$:/tags/EditTemplate]].... and you will 
find this tiddler:
    [[$:/core/ui/EditTemplate/type]

Next, examine the source of that tiddler, and you will find a <div> with
   class="tc-edit-type-down"

Within that <div>, there is a <$list> widget that uses the following filter 
to populate the dropdown list:
  
 [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]

Then, search by filter for [prefix[$:/language/Docs/Types/]], and you will 
find this tiddler:
   [[$:/language/Docs/Types/text/plain]]

To make add your own type, start by cloning the above tiddler, and name it:
   [[$:/language/Docs/Types/text/perl]]

Then, set the "description" field to "Perl Source Code" and the "name" 
field to "text/perl".

That's it.  Your newly defined type will be automatically added to the 
droplist.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://TiddlyTools.github.com/fundraising.html#MakeADonation

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/05d37c73-5509-42c7-ae71-e3a21a01d5eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to