OK PMario, thanks for the information.
By the way, the 'plusminus' was just an example.
In another envornment (dokuwiki) I used markdown for automatic text to html 
processing.
Then I used javascript to extend functionalities. Reference to js modules 
in dokuwiki could be placed in the template, so to be accessible from all 
articles.
So I could use dom to retrieve elements, attributes, classes, etc. and to 
perform other useful replacements.

For instance, I could replace §{#id .'myclass' ... inline html code ... }§ 
with <span class='myclass' id='id'> inline html code </span>. So the 
dictionary elements were not just math symbols, but replacement for html 
code. Moreover, I use mathjax because allows inline math ${...}$ while it 
seems not available in katex...
Or I could create automatically bidirectional footnotes, based on links 
with special classes.

I could do this because the js code was kept in the final rendered code and 
executed by the browser. 
Therefore I thought to use js macro in tiddlywiki, but how to reference the 
code in all tiddlers without calling it explicitly from each one?
Maybe there's another way to do the same...

Thanks and regards 
Paul Netsaver,
Rome, IT

Il giorno venerdì 18 maggio 2018 00:58:16 UTC+2, PMario ha scritto:
>
> Hi,
>
> On Wednesday, May 16, 2018 at 10:14:33 PM UTC+2, Paul Netsaver wrote:
>
>> .... moreover... are JS macros processed from the browser, after the 
>> final tiddlywiki html conversion or are they a sort of  'tiddlywiki 
>> middleware'?
>>
>
> Macros are more like "text substitusions" used by endusers. If you will 
> ... it's like middleware. 
>
> As you found out, if you want to manipulate tiddler source content, you'll 
> need javascript. ... but no js macros. 
>  
>
>> I've to know if I can program JS macros as for usual html+js websites, 
>> thinking to common dom structure or text utf-8 coding. 
>>
>
> No. 
>
> Manipulating the DOM in TW does absolutely nothing. ... It's the other way 
> around. As soon as you manipulate tiddler content, the DOM will be redrawn 
> to match tiddler state. 
>  
>
>> In the example above, §+- would be replaced with &plusmn;
>>
>
> What you describe here is a parser-rule, similar to the dash-parser [1]. 
>
>
> But I'm not 100% sure, what you want to achieve. ... If you need 
> mathematical symobls, the katex-plugin may be a much simpler and much more 
> powerful possibility. 
>
> see: https://tiddlywiki.com/plugins/tiddlywiki/katex/
>
> have fun!
> mario
>
>
> [1] 
> https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/parsers/wikiparser/rules/dash.js
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/12b70830-e5f3-4a21-acb2-76b8a4dda512%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to