On Thursday, April 24, 2014 1:02:59 AM UTC+2, Danielo Rodríguez wrote:
>
> I didn't know a codemirror plugin exist for TWC already. I have to say it
> is very well looking and looks well implemented.
> I have to admit I'm a bit frustrated with this because I asked several
> times how to get syntax highlighting with the codemirror plugin and nobody
> answers. Nobody did it before with TW5?
>
Can you point me to those posts? .... If I didn't respond, I did miss them.
If you do a search for "codemirror" in the TW group you'll get plenty hits
for TWc.
> About this:
>
>> IMO the only way to deal with cm is to automate the build process.
>> ... a command line driven build process, that loads the .js libraries,
>> adds the .meta files to make them work with TW and build a custom edition.
>> ... or a TW based build process, that let's you download a striped down
>> version.
>>
> yes, that is exactly what I was looking for. But I have no idea of how to
> configure the process.
>
I think, the "plugin mechanism", that will let TiddlyWiki download and
install TW plugins, will also let us download and create / include 3rd
party plugins. ...
but this plugin mechanism doesn't exist yet :/
> What I would like also is to load just the needed js librares for the
> currently selected mode(of available ones), and do it without needing
> reload. How can I relate the selected mode with the needed js libraries?
> Can this be loaded and unloaded during Execution time?
>
Dynamic dependency handling is one of the most complicated things for any
library. ... The codemirror modes eg: foldcode.js [1] depends on the
codemirror core.
As you can see in the 3rd line [1] it does a require() ... The problem here
is, that this imo ugly wrapper doesn't work with TiddlyWiki.
TW uses the require() mechanism, but the TW require("$:/..") has to work
with nodejs and in the browser. ... So we need to create the stuff in the
right way. see: [2] for more info.
[1] http://codemirror.net/addon/fold/foldcode.js
[2] https://github.com/Jermolene/TiddlyWiki5/issues/475
I was thinking in metadata fields that indicates the relationship between
> modes and the libraries.
>
Yes ... and it's not only the mode and the libraries. It's also the user
specific settings.
IMO with cm it is essential that users can have a different keyboard
behaviour for different modes. See my
CodeMirrorConfig<http://codemirror.tiddlyspace.com/#CodeMirrorConfig>tiddler.
eg: if you use javascript mode and type something like
if (a ==b) { ... and enter here... I do expect the cursor to create an
auto-indent for the next line
c = 10;
} ... If I close the brackets now.... I expect it to jump one level
back ...
} ... like so
... but this behaviour is nonsense for TW syntax editing mode. So every
mode needs its own keyboard and auto-indent settings.
... you may want to switch the "snippet set" and "auto-complete" also ..
--------
There are several more points, that need to be considered.
eg: If you have an SVG image, there are 2 modes.
a) the image mode :
https://dev.tweb.at/api/bags/default_public/tiddlers/button-image
b) the text representation:
https://dev.tweb.at/api/bags/default_public/tiddlers/button-text-plain
This is important for the edit mode and the view mode.
At the moment edit mode is always text mode but in the future, there may be
GUI for svg.
Or the other way around, if I need to see the text representation in view
and in edit mode.
TW5 doesn't handle this at the moment. For TWc I did modify the renderer to
do this in the right way.
So TW5 will need a plugin for this too.
Setting the mime type for edit and view mode, in the wrong way, has an
impact on a server based backend.
eg: TiddlyWeb ... This may not be important for every user but for me it is.
-----------
I think, we'll need to start small, with the download and create .tid file
mechanism first. The "edition" build process can be done by TW.
have fun!
mario
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.