Hi Jeremy

Thanks for the explanation.  I thought there'd be some way of determining
behaviour based on file extension or type: field.

As I would like SAS files to be interpreted as .tid, I added the following
in Chrome JS console:-

$tw.config.fileExtensionInfo[".sas"] = $tw.config.fileExtensionInfo[".tid"];

I checked it with:-

$tw.config.fileExtensionInfo[".sas"]

and got 'Object {type: "application/x-tiddler"}'

This is what I'm after, I believe.  However, importing the SAS file made no
difference with TW5 according a type of 'application/x-sas'.

If it's any help, the text I'm inserting is as follows (saved in a file
called 'tmp.sas'):-

    /*: Win/Unix
    title: Table for non-mutually exclusive groups
    caption: Non-mut excl grps
    type: application/x-tiddler
    tags: Output Table Percentages Test_Data
    sas: 9.3

    ! Purpose

    A simple way to output figures ....
    */

Thanks, Rich






On 13 June 2014 09:12, Jeremy Ruston <[email protected]> wrote:

> Hi Richard
>
> If I understand correctly, the problem here is that you've got a pile of
> text files with the extension .sas that you'd like to be able to easily
> import into TW5. Would you like them to be treated as if they were .txt
> files or .tid files? If so, we can create a very simple module that plugs
> .sas in as an alternative extension. If you need to massage the files in
> some non-standard way as they are imported, then we'd need a more complex
> module.
>
> TW5 has the concept of deserializer modules that extract tiddlers from
> different file formats. The mechanism starts by looking up the file
> extension within the JavaScript hashmap $tw.config.fileExtensionInfo. For
> example, open tiddlywiki.com and try this in the browser JS console:
>
> $tw.config.fileExtensionInfo[".tid"]
>
> You should see Object {type: "application/x-tiddler"}, which tells us that
> .tid files should be interpreted as being of the type application/x-tiddler.
>
> That type is then looked up in another hashmap:
>
> $tw.config.contentTypeInfo["application/x-tiddler"]
>
> For this example you should see:
>
> {encoding: "utf8", extension: ".tid", flags: Array[0], deserializerType:
> "application/x-tiddler"}
>
> The field "deserializerType" is then looked up amongst the module
> definitions for modules of type "tiddlerdeserializer". You can see the
> available deserializers listed:
>
> $tw.modules.types.tiddlerdeserializer
>
> Finally, the actual deserializer for application/x-tiddler is created by
> boot.js:
>
> https://github.com/Jermolene/TiddlyWiki5/blob/master/boot%2Fboot.js#L1170
>
> Most other deserialisers live in this file:
>
>
> https://github.com/Jermolene/TiddlyWiki5/blob/master/core%2Fmodules%2Fdeserializers.js
>
> So, we can plug in .sas so that it is treated as .txt with this single
> line of JavaScript:
>
> $tw.config.fileExtensionInfo[".sas"] =
> $tw.config.fileExtensionInfo[".txt"];
>
> Try running that line in your browsers JS console and then drag in a .sas
> file and see if it behaves as you expect. If so, we can look at baking that
> tweak into a module tiddler so that it runs each time you restart your wiki.
>
> Best wishes
>
> Jeremy
>
>
>
> On Thu, Jun 12, 2014 at 8:35 PM, Danielo Rodríguez <[email protected]>
> wrote:
>
>> What you want works wonderfully with javascript.
>>
>> Go to tiddlywiky5 github page. Enter in plugins and then check any of
>> them. You will se there is no tid file, just regular javascript code.
>> Inside each JS file there is a commented header. Field defined on that
>> header are converted to tid files with that fields. You can ask your
>> colleagues to include that header. Then use a custom view template based
>> on, for example a particular tag.
>>
>> Let my know if I explained myself.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "TiddlyWiki" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/tiddlywiki.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Jeremy Ruston
> mailto:[email protected]
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/HEqq8JZFCEI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywiki.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to