Nightly Build 2.5.0.2

191 views
Skip to first unread message

josip

unread,
Jan 9, 2013, 4:28:06 PM1/9/13
to write...@googlegroups.com
DL: http://writemonkey.com/__files/NB/wm2502NB.zip



- added (EXPERIMENTAL): You can optionally show non printable white space characters — paragraph breaks, tabs and redundant spaces. Useful if you want to keep your text file as clean and well formatted as possible. Use CTRL+8 to toggle on / off.

- added: Writemonkey plugin engine (early preview, very crude right now) …

... this will allow 3rd party extensions/plugins to add to and interact with existing core wm functionality. Since no technical documentation exists at the moment, I will just summarize some basics.

Plugins are stored in wm/plugins folder. Each sub folder represents a plugin and it needs to contain at least one plugin_name.js file. Wm supports javascript as it’s scripting language. It utilizes Jint javascript interpreter for .NET (http://jint.codeplex.com) which currently implements all concepts defined in ECMAScript version 3.0. Version 5.0 is not supported at the moment.

Javascript is commonly used for handling web browser’s DOM objects but in our case it can interact with:

  • .NET 4.0 core functionality – Your scripts can instantiate and use all generic classes and methods. The usage is the same as in C# (.NET flagship language) with some minor differences.
  • Special “monkey” object that allows you to interact with different aspects of current writemonkey instance. For example:

    monkey.selectedText = "this will be inserted at current caret position";

There are couple of quick and dirty examples already there; I wrote them more as a proof of a concept than anything else. You can open js files and see what’s inside, modify them. Note that you don’t need to use .NET stuff at all. You can just put together simple javascript “macros”.

Included proto plugins:

  • Lorem ipsum - generate random lorem ipsum text
  • Namely - generate random names using huge database of real names
  • Smarty pants - replace straight quotes with curly ones, -- to en dash, --- to em dash etc.
  • Start double return - automatically insert 2 paragraph breaks with a single key stroke
  • Wordwrap at 75 - hard break the text at certain position

Later on it will be possible to initialize plugins at startup (plugin “Set double return” would be a good candidate) but right now they can only be deployed by CTRL+F10. To run last used script, hit CTRL+ALT+F10.

Feedback welcomed.

Plugins will be available only to donors / wm key owners.

Kensai

unread,
Jan 9, 2013, 8:04:30 PM1/9/13
to write...@googlegroups.com
Cool, its finally starting to happen.  Kinda limited in scope due to the initialization limitation you've noted, but still fun.  In fact, the name generator has already proven to be distracting in how well it works ;-p

Anyhow so far, everything I've thought to use this for will have to wait on initialize on startup functionality (and it would be nice to see things like Smarty Pants work as you type rather than firing it off to alter a whole doc at once).  However, I do have a buddy who slings .NET and Javascript for his day job, so I'm looking for functions I might be able to tap him to generate for us.

Anyway, haven't found anything flopping about with this build yet.  Let the good times roll ...

Kensai

josip

unread,
Jan 10, 2013, 7:38:54 AM1/10/13
to write...@googlegroups.com
Initialize on startup is not hard to implement. It will be available in NB2.5.0.3. The plugin (js file) will be initialized on startup if it's name starts with "exe_".
i.
Reply all
Reply to author
Forward
0 new messages