Hi Jeremy

First - many thanks for TiddlyWiki, it truly is wonderful.

I have followed your instructions posted here to try to add the language 
'R' into the highlight.js plugin in my copy of 5.1.11.  Unfortunately this 
results in the red Internal JavaScript Error message.

I am pretty sure I followed your instructions to the letter but I assume 
that I must have made a mistake.  I can post the code I inserted (or an 
extract - maybe just the start and end) if you or another member of the 
TiddlyWiki group might be interested in looking at it...?

It would be great to have R syntax highlighting in TiddlyWiki.

All the best

Brian



On Sunday, September 13, 2015 at 9:44:26 AM UTC+1, Jeremy Ruston wrote:

> Here's an approach that should let you hack additional language brushes 
> into the preview of 5.1.10. It modifies one of the shadow tiddlers within 
> the highlight plugin, which can cause problems with future upgrades; if 
> that happens, remove the shadow tiddler override and then re-apply the 
> technique described below.
>
> 1. Find the brush you want within the highlight.js GitHub repo in the 
> "src/languages" folder: 
> https://github.com/isagalaev/highlight.js/archive/8.8.0.zip
> 2. Copy the text of the language you want
> 3. Open the tiddler "$:/plugins/tiddlywiki/highlight/highlightblock.js"
> 4. Paste the following after the line "hljs.configure(...)":
>
> hljs.registerLanguage("<name_of_language>",<text_of_language_file>);
>
> Save the tiddler and restart.
>
> Let me know how you get on,
>
> Best wishes
>
> Jeremy.
>
>
>
>
>
> On Sat, Sep 12, 2015 at 6:59 PM, Bob Flandard <[email protected] 
> <javascript:>> wrote:
>
>> Hello Danielo,
>>
>> I had a look at the plugin code and got about as far as realizing that 
>> "hljs.registerLanguage" was the start of each new language. I thought about 
>> hijacking one of the existing languages that I'm unlikely to need for its 
>> intended purpose, but the minified code looked too impenetrable 
>> (combination of stripped down JavaScript and beastly regular expressions).
>>
>> Did you have any joy with your attempts? and if so do you have any 
>> pointers or time savers.
>>
>> The language I'm interested in is APDL from Ansys. Mainly the keywords 
>> for many hundreds of commands; some start with "/" e.g /view, some with "*" 
>> e.g *vget and others just normal "words" e.g save etc.
>>
>> Thanks, Bob
>>
>
>
>
> -- 
> Jeremy Ruston
> mailto:[email protected] <javascript:>
>

-- 
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/36be89b5-dde0-4297-b2cd-860f4d5bab93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to