[twdev] Re: Saving on Dropbox with TiddlyWiki5 in the Sky?

2021-05-17 Thread stefano franchi
Ops, wrong Dl---blame gmail autocompletion...or my short attention span.

Sorry for the noise devs, keep up the good work!

On Mon, May 17, 2021 at 11:26 AM stefano franchi 
wrote:

> I have recently come back to my TW5 files after a couple of years hiatus
> and I cannot get the save to Dropbox to work any longer. I am using
> TiddlyWiki5 in the Sky and have a properly set up folder on my Dropbox. I
> am on Linux using Firefox as a browser.
>
> When TW5 saves its file, it uses Firefox's default download location and
> it never overwrites the previously existing one. I now have a few dozen
> versions of my current TW5 app, and all in the wrong folder...certainly a
> great backup solution, but not exactly what I want ;-) . Besides, it
> completely defeats using Dropbox if all saves are on my local desktop.
>
> Any hint on how to tell TW5 to both save and replace the current file? I
> think it is more of a Firefox issue than a TW5 issue, but I'm hoping
> someone may have encountered this problem before.
>
> Cheers,
>
> S.
> --
> ______
> Stefano Franchi
>
> stefano.fran...@gmail.com 
> *https://www.researchgate.net/profile/Stefano_Franchi*
> <https://www.researchgate.net/profile/Stefano_Franchi>
>


-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
*https://www.researchgate.net/profile/Stefano_Franchi*
<https://www.researchgate.net/profile/Stefano_Franchi>

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwa%2BEQHTcatSHMuf8RdfP%2BdkNt8FVcEid%3DgLDEVgORT--A%40mail.gmail.com.


[twdev] Saving on Dropbox with TiddlyWiki5 in the Sky?

2021-05-17 Thread stefano franchi
I have recently come back to my TW5 files after a couple of years hiatus
and I cannot get the save to Dropbox to work any longer. I am using
TiddlyWiki5 in the Sky and have a properly set up folder on my Dropbox. I
am on Linux using Firefox as a browser.

When TW5 saves its file, it uses Firefox's default download location and it
never overwrites the previously existing one. I now have a few dozen
versions of my current TW5 app, and all in the wrong folder...certainly a
great backup solution, but not exactly what I want ;-) . Besides, it
completely defeats using Dropbox if all saves are on my local desktop.

Any hint on how to tell TW5 to both save and replace the current file? I
think it is more of a Firefox issue than a TW5 issue, but I'm hoping
someone may have encountered this problem before.

Cheers,

S.
-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
*https://www.researchgate.net/profile/Stefano_Franchi*
<https://www.researchgate.net/profile/Stefano_Franchi>

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwbUwRNutVTMepgV%3D%2BYaMxnBfgxsF9jrzW_1GtbJnfuCmg%40mail.gmail.com.


[twdev] Getting a tiddler's fields from a widget plugin (JS)?

2019-03-03 Thread stefano franchi
I am sure this is stupid question whose answer is staring at me, but I
can't find it:

How do you access a tiddler from within a widget plugin's code?

All I was able to find is that
1. All tiddlers are accessible by title from $tw.wiki
2. The title of a tiddle is stored in the widget's parent's transcludeTitle

So, when I need the value of myField I end up with this expression in the
plugin code:

myFieldValue = $tw.wiki(this.parentWidget.transcludeTitle).fields["myField"]

which looks to me as going from New York to Boston via Tokyo. Besides, I
dislike using globals and would rather have the widget telling me the
tiddler data it is working on.

Surely there's a better way?

Cheers,

Stefano

-- 
______
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYDYLRJW4XZU36fTTK70sDT5GKPjZB7C%3DasW0CKJq0gDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: Help with saving a widget's tiddler content from external library code

2019-02-22 Thread stefano franchi
On Fri, Feb 22, 2019 at 2:20 PM Simon Huber 
wrote:

> I am having some trouble understanding how to update the text and other
>> fields of a tiddler my  widget editor works on.
>>
>> I am at the point where the editor is holding
>> (1) editor.widget, a ref to the widget it was called from and
>> (2) fieldUpdates,  an object with field/value pairs  for all the
>> tiddler's fields I want to update. My problem is which function to use to
>> get the task done.
>>
>
> If you're editing a tiddler with your editor and you want its title, the
> widget calling your editor must have it (...) ?
>
> what does console.log(editor.widget) say? is there no editTitle?
>
> is your editor called the standard tw way using factory.js?
>

No it isn't. Sorry for using a confusing terminology. Here is my scenario:

I have a widget plugin that creates a new Div element and then passes it
to  an external library. The latter builds a complete specialized editor
inside the Div. I also give the library a ref to the widget that calls it.
To be clearer, I have:

1. A tiddler with some specialized text format. Call it SF-Tiddler of type
text/SF-type
2. A widget that reads the content of tiddlers of type text/SF-type and
passes it to a specialized editor mini app
3. A specialized editor mini app, Call it SF-EditorApp, which starts out
with a copy of the text content of (1) and holds on to a ref to the calling
widget (2)
4. Editing operations within SF-EditorApp that need the internal copy of
the text to be written back to the text of (1) as soon as they are carried
out.

My problem is how to to reach (1) from a ref to (2).  SF-EditorApp has a
property "widget". IO have been looking at all the methods of Widget, as
well as staring at the object in the debugger, and I cannot find a ref to
the tiddler the widget is open on. I was expecting either something like:

SF-EditorApp.widget.getTiddler()

or

SF-EditorApp.widget.tiddler

Instead, after many trips through  the debugger, all I could find was:

SF-EditorApp.widget.parentWidget.transcludeTitle

which indeed points to the title of my tiddler (1), but has me even more
confused (to get from widget to tiddler I need to go up a level and descend
to a transclusion?)

What I am looking for is the reference chain that leads from (2) to (1) or
to (1)'s title.
And the fact I cannot find it after spending two hours looking at the code
can only mean I ma still fundamentally confused about TW's data model.


-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwatdUiH%3DE46wBrVrARyNx1m8b%3DgEEUCHyjjBJqRrkG8wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Help with saving a widget's tiddler content from external library code

2019-02-22 Thread stefano franchi
I am having some trouble understanding how to update the text and other
fields of a tiddler my  widget editor works on.

I am at the point where the editor is holding
(1) editor.widget, a ref to the widget it was called from and
(2) fieldUpdates,  an object with field/value pairs  for all the tiddler's
fields I want to update. My problem is which function to use to get the
task done.

I tried/looked up the following approaches in my update function (located
in a loop in the external library that builds the editor object-)

a. editor.widget.parseTreeNode[field]=fieldsUpdates[field]
Result: "Compiles" but no results, tiddler text and fields do not
change.

b. editor.widget.wiki.setText(title, field, null, fieldUpdates[field])
Didn't get to try it because it calls for the tiddler's title, And I
haven't find a method to get it from the widget

c. editor.widget.wiki.setData(fieldUpdates)
   Didn't try it it either, because the code comments say it would change
the tiddler's type to app/json, which is definitely not desired.

What am I missing?

Cheers,

Stefano


-- 
______
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwayReu2EiCgneyHkGe73Xm8cGWdWqCgoSs_N91XVS9OQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: ANN: widget tutorial

2019-02-17 Thread stefano franchi
On Sun, Feb 17, 2019 at 1:25 PM Brian Theado  wrote:

>
>
> On Sun, Feb 17, 2019 at 10:25 AM stefano franchi <
> stefano.fran...@gmail.com> wrote:
> [...]
>
>> In particular, there is an issue I have not been able to solve yet, and I
>> hope you may help---where do I look to find examples of a callback function
>> that would allow the calling code to tell the external library  to save its
>> data?
>>
>
> This is backwards from the way I've implemented it and seen it implemented
> in other widgets. I think the expectation is that the external library
> provides a way to register a callback will will be called by the library
> every time anything changes. The widget can register a callback in which
> the code will ask the library to serialize its data. The resulting data is
> saved to some tiddler field in order to persist. In this way, the data is
> always in sync with the tiddler field. The widget does not get notified it
> is about to be destroyed (that I know of), so having the data always in
> sync is required.
>
> I think in a previous exchange you suggested to take a look at the
>> Codemirror plugin, but I could not find where the mechanism is implemented.
>> I guess it is because I am not really sure what I am looking for.
>>
>
>
> This is the code I had in mind
> https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/codemirror/engine.js#L121
>
> // Set up a change event handler
> this.cm.on("change",function() {
> self.widget.saveChanges(self.getText());
> });
>
> [...]
>
> /*
> Get the text of the engine
> */
> CodeMirrorEngine.prototype.getText = function() {
> return this.cm.getValue();
> };
>
>
> Here's an example I wrote, but it is much more complicated WRT the
> persisting of data:
> https://github.com/btheado/tweve/blob/master/src/plugins/btheado/tweve/files/eve-widget.js#L61
>
> Here's another one I wrote, but not well commented and probably not a good
> example to follow:
> https://github.com/btheado/jsoneditor/blob/master/jsoneditor-widget.js#L60
>
>
Hi Brian,

thanks for the pointers---all very useful. I had indeed missed that bit of
the codemirror code, which makes perfect sense now that I see it.


>
>> Your tutorial on the refresh mechanism does a great job of explaining how
>> a widget manages to keep itself in sync with the underlying tiddler. It is
>> the reverse procedure that is still baffling to me. In particular, is
>> complete sync the only option---sending back a call from the widget back to
>> the tiddler after every single update? That may not be feasible in case the
>> external library works on on  its own internal representation of the
>> underlying tiddler data and it may be expensive to convert back and forth
>> (as it is in my case). I am thinking a simpler "updateTiddlerOnExit" method
>> to call before the widget is destroyed would be more appropriate, but I
>> haven't found out how to manage this kind of tiddler-->widget communication.
>>
>
> See this related discussion, I don't think TW currently supports what you
> are after: https://github.com/Jermolene/TiddlyWiki5/issues/1784
>
>
I see, thanks for saving me hours of digging! That's exactly what I was
after. Too bad it's not supported yet.

So in your case you are saying the conversion back and forth is too
> expensive to always keep in sync? Have you already tried it and found it to
> be too slow?
>

I did and it is borderline. I will keep looking for solutions. But thanks a
lot for the help!

Cheers,

S.

-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYKocDJKN2cqmPzHkOcCGiQzU6CSO_X0Dm8fmq7%3DPDdaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: ANN: widget tutorial

2019-02-17 Thread stefano franchi
On Sun, Feb 17, 2019 at 8:22 AM Brian Theado  wrote:

> I have been making slow progress with this.
>
> I wrote additional sections:
>
> Widget attributes tutorial part II
> 3rd party library tutorial part I
> 3rd party library tutorial part II
>
> I also improved some of the examples of the previous sections.
>
> I still haven't written about child widgets. I also haven't covered the
> difficult topic of how to get the 3rd party library code suitable for
> loading into Tiddlywiki. I plan to add a few examples from my experience,
> but it won't be comprehensive as it is a large topic.
>
> See the update at https://btheado.github.io/tw-widget-tutorial/
>
> Stefano,
>
> > great work and greatly needed. Can't wait to read the 3rd party library
> tutorial!
>
> I would guess based on your other threads that you are already past the
> point where the 3rd party library tutorials would help you. Also based on
> those threads, I doubt what I've written so far would have helped you much.
> One difficulty you faced was how to get 3rd party code suitable for loading
> and I haven't written anything on that yet. Another difficulty was related
> to arranging files on the file system such that node.js would pick them up
> as plugins. This topic I don't plan to cover at all as I see that topic
> being orthogonal to writing widget code.
>
>

Hi Brian,

thanks for the tutorials, I have already learned a few things from them I
didn't know before. You are right that I am almost done with my external
library widget plugin, and I am working on a write-up of the process that
led me there, but that does not make less of a newbie to this fascinating
TW world.

In particular, there is an issue I have not been able to solve yet, and I
hope you may help---where do I look to find examples of a callback function
that would allow the calling code to tell the external library  to save its
data?
I think in a previous exchange you suggested to take a look at the
Codemirror plugin, but I could not find where the mechanism is implemented.
I guess it is because I am not really sure what I am looking for. Your
tutorial on the refresh mechanism does a great job of explaining how a
widget manages to keep itself in sync with the underlying tiddler. It is
the reverse procedure that is still baffling to me. In particular, is
complete sync the only option---sending back a call from the widget back to
the tiddler after every single update? That may not be feasible in case the
external library works on on  its own internal representation of the
underlying tiddler data and it may be expensive to convert back and forth
(as it is in my case). I am thinking a simpler "updateTiddlerOnExit" method
to call before the widget is destroyed would be more appropriate, but I
haven't found out how to manage this kind of tiddler-->widget communication.


Cheers,

Stefano



>
>
-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYdoH0_K%3Dwn7DfxDRN%2ByrnvPxMsW2bnJppTxyocaab-iQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Creating new tiddler types

2019-02-16 Thread stefano franchi
On Sat, Feb 16, 2019 at 3:51 AM Jeremy Ruston 
wrote:

> Hi Stefano
>
> I think you've got it exactly right. The details tying the mechanism
> together are in the wiki.parseText() method.
>
>
Thanks Jeremy,
now I finally get it. Inturn, it is the wiki.initParsers() method that sets
up the mapping. I had totally missed that.

Cheers,

S.
-- 
__________
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYauKQaaB15zgUB28_kwqdG-RVBjwRFNcSca4kMt67ikA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Creating new tiddler types

2019-02-15 Thread stefano franchi
How does the addition of new tiddler types work?

>From reading the railroad plugin code and the tw-dev pages on Parser and
Widget, I gather that it is as simple as creating a new parser module and
assigning the newly defined type to a specific widget.

Railroad does it in its  super-simple typed-parser.js module:
```
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

var RailroadParser = function(type,text,options) {
var element = {
type: "railroad",
tag: "$railroad",
text: text
};
this.tree = [element];
console.log(text);
};

exports["text/vnd.tiddlywiki.railroad"] = RailroadParser;

})();
...

The intent is clear, and the code could not be simpler. It maps the new
tiddler type text/vnd.tiddlywiki.railroad to the railroad plugin. But it
feels like a bit of magic. Where is that mapping actually established?  I
have not been able to find how it  actually implemented  in the core, and I
would like to get a better grasp of the overall mechanism. Where should I
look?

Cheers,

S.
-- 
__________
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwZodcay8hnXKBDK%2BJK%3DDs_X2NNfx9ZAXZeqdDDBiXvXBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to build a settings panel for a plugin

2019-02-14 Thread stefano franchi
On Fri, Feb 15, 2019 at 12:04 AM Mohammad Rahmani <
mohammad.rahm...@gmail.com> wrote:

> Stefano,
>  Could you please bruch up the procedure based on the received comments. I
> would like to add it to TW-Scripts.
>
>
Well, there isn't much to write up. As always the solution is simple once
it's been found...
But here we go:

1. How to create the panels that make up the various tabs of the plugin
page. It takes three steps:
 a - In the plugin.info file of the plugin you are writing, add a line with
"list" followed by a list of your panels in double quotes.
  In my case I wanted 6 panels: readme usage syntax example license and
config. So I added this line:
  "list": "readme usage syntax example license config"
b. Create the files corresponding to the panels in the "files" subdirectory
of your plugin, as plain text, or in wikitext, or HTML.
I wanted them in a separate dir to keep everything uncluttered, and i
put them in a new subdir files/doc
So I created 6 new files: files/doc/readme.txt, file/doc/usage.txt,
etc. and put some filler text in each just o be sure I could test if they
showed up in TW
c. Finally, in the tiddlywiki.files file in your files subfolder, add a
block for each one of the new file you have created, making sure the last
part of the
   "title" field is identical to what you wrote in the "list" line of your
plugin info, while the first part is the identifier of your plugin:
$:/plugins/yourName/YourPluginName/. In my case,
I am working on a plugin called "sgfeditor", and the name I am using is
"cleinias", so the name prefix is always "$:/plugins/cleinias/sgfeditor" .
   For example, to add the content of the files/doc/readme.txt file as a
"readme" panel, you would add the following block to the tiddlywiki.files
file:

 {
"file": "doc/readme.txt",
"fields": {
 "type": "text/plain",
"title": "$:/plugins/cleinias/sgfeditor/readme"
}
   },

   Notice two important things: (1) the path in the "file" line is relative
to the files sub directory, NOT to the plugin directory.
   (2) The last part  of the can title (i.e. "readme") can actually be
anything you want, AS LONG AS it corresponds to one of the
item in th e"list" line of plugin.info file. For instance, you could
have your readme info in README.txt (following usual
conventions), and then "readme" in all lowercase and no ext in the
"title" field.

2. How to create a settings for my plugin that would either be added to the
control panel or be accessible from the plugin page
   To have the settings accessible from the config panel, you need to
create a config file and then tag it with $:/tags/ControlPanel as PMario
said. If you want it as
  a tab (panel) in the plugins page add it to the "list" line in plugin.info
.
   In either case, the basic procedure is the same as above: create a file
in the format of your choice (see point 3 below) in the "files" subdir of
your plugin, then add a block describing
   it in the tiddlywiki.files in the files subdirectory. If you go for the
config panel, you also add a line with "tags": "$:/tags/ControlPanel" . I
went the second route, and decided to put my settings  in  a "config" panel
of the plugin, and to use the json format. So I created config.json, added
"config" to the "list" line in plugin.info and added this block to
tiddlywiki.files:
{
"file": "config.json",
"fields": {
"type": "application/json",
"title": "$:/plugins/cleinias/sgfeditor/config"
}
  },
   Notice that I changed the type to the correct json MIME type.

3. How to access said settings from the plugin code:
   I haven't tried to access the settings from the config panel, so I
cannot say anything about it. I only had to add two lines to read the
config tiddler from  my plugin code (I  copied them from the railroad
plugin):

// getTiddlerData reads a Json file into a javascript object:
var config = $tw.wiki.getTiddlerData(
"$:/plugins/cleinias/sgfeditor/config")

Then for every setting, I provide three options: the value in the config
panel, the value possibly present in a corresponding field of the tiddler
the plugin widget is working on, or a default value I set in code (this is
also copied from the railroad plugin). So I have an object that reads all
the config parameters:

var options = {
size :  this.getAttribute("size", config.size || 19),
panels :  this.ge

Re: [twdev] Re: How to build a settings panel for a plugin

2019-02-14 Thread stefano franchi
On Thu, Feb 14, 2019 at 2:49 PM Matthew Lauber  wrote:

> That should be correct.  Keep in mind, in the list field, the file will be
> named "readme" but the shadow tiddler needs to be named
> "$:/plugins/yourName/yourPlugin/readme"
>
>
My bad. I was using an overly complicated naming scheme and had made a
mistake. Thanks for pointing out my understanding was correct and directing
me to the real problem.

Cheers,

S.


-- 
__________
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYD_1WAbwmPYkjcq7F%3DR340wNjWG0RWfpzUtzckcTWpnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: How to build a settings panel for a plugin

2019-02-14 Thread stefano franchi
On Wed, Feb 13, 2019 at 11:30 PM stefano franchi 
wrote:

> Never mind again, got it from the Railroad plugin:
>
> 1. Create the panels the make up the various tabs of the plugin page
>>
>
> In  the plugin.info file, add a "list" field with the names of the
> panels, then create corresponding tiddlers with prefix
>
> $:/plugins/yourName/yourPlugin
>
>

I thought the above would be enough to get the aux files (Usage/Doc, etc)
to show up as tabs in the plugin page, but apparently it isn't.
I can't find anything else in the core plugins to explain how the tabs are
created. No additional info in the tiddlywiki.files, no tags in the
tiddlers themselves, etc.
Suggestions appreciated.

 Cheers,

S.
-- 
__________
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwY3dYQgZL2gZ%3DrP1HcT%3DjaL%3DFWfG17oWTnvTMRWc7Uv9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to get the size of an upcoming widget in a plugin declaration?

2019-02-14 Thread stefano franchi
On Thu, Feb 14, 2019 at 5:35 AM Simon Huber 
wrote:

>
>>
>> On Wed, Feb 13, 2019 at 5:06 PM Simon Huber 
>> wrote:
>>
>>>
>>>>
>>>> this is some basic information which I gathered by searching, reading
> and trying ...
> not everything must be necessarily correct, anyone, just correct me where
> I think we need to add some simple explanations somewhere
>
> Hi Simon,

thanks for your discussion of the general model behind TW's widget. Very
helpful.
When I am done, I am planning to produce a write-up of what it was like
writing a plugin for TW
with no JS, front-end development background and, most importantly, no
previous exposure to a one-page app.
It might be helpful to other clueless TW newbies like me who are eager to
harness the tool's potential.

Cheers,

S.



-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwZ02McsAGT6o944XT5_37mOPf2CdZEZt6S0B2YFDBEbJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: How to build a settings panel for a plugin

2019-02-13 Thread stefano franchi
Never mind again, got it from the Railroad plugin:

1. Create the panels the make up the various tabs of the plugin page
>

In  the plugin.info file, add a "list" field with the names of the panels,
then create corresponding tiddlers with prefix

$:/plugins/yourName/yourPlugin


> 2. Create a settings for my plugin that would either be added to the
> control panel or be accessible from the plugin page
>

 See above foe the plugin page panel. If going for the control panel, then
create and use a $:/config/myPlugin tiddler

> 3. Access said settings from the plugin code
>
>   use $tw.wiki.getTiddlerData()


-- 
__________
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

>

-- 
__________
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYhemf36gKNKEW-w91frR42MTZGm5ENdTsWvfqQMF%3D6ZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] How to build a settings panel for a plugin

2019-02-13 Thread stefano franchi
Is there a discussion of this anywhere? I couldn't find it the dev|user
docs and looking at the code brought scant enlightenment.
Besides, Google Groups seemed to have stopped working for me tonight.

I am working on node and I am not quite sure how to:

1. Create the panels the make up the various tabs of the plugin page
2. Create a settings for my plugin that would either be added to the
control panel or be accessible from the plugin page
3. Access said settings from the plugin code

Pretty basic stuff, I am afraid, all help greatly welcome. I promise to pay
back by writing this stuff up if it isn't already.


Cheers,
S.

-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwa-XTcB3ktheMRhtu-X23OpSKLLzKt3Lz7ihQyEmdCx0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to get the size of an upcoming widget in a plugin declaration?

2019-02-13 Thread stefano franchi
On Wed, Feb 13, 2019 at 5:06 PM Simon Huber 
wrote:

>
>>
>> On Wed, Feb 13, 2019 at 3:56 PM Simon Huber 
>> wrote:
>>
>>> Hi stefano,
>>>
>>> from within the render method it should be possible to access the parent
>>> if I recall correctly,
>>>
>>> could you post a bit of code to work with?
>>>
>>>
>> Well, it is all very rudimentary still, but the idea is the following:
>> In my plugin I import the library and instantiate it, then create the div
>> to pass to it. Then I call the constructor of my library's main object with
>> the div as its argument:
>> 
>> (function(){
>> /*jslint node: true, browser: true */
>> /*global $tw: false */
>> "use strict";
>> varWidget = require("$:/core/modules/widgets/widget.js").widget;
>>
>>
>>
> Stefano, here you should be able to get dimensions of the parent domnode by
>
> var rect = this.parentDomNode.getBoundingClientRect();
>
> for example ...
>
> var width = rect.width;
>
>
Brilliant!
It works like a charm.


One day I will understand TW's data model and its relationship to the DOM...
But that day is still far away.

Thanks a bunch.

S.
-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYu%3DeE5zRZpW1g9ggBULLSWTuB4E8Mf%2BhtkGnoEL4s%2B-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: How to get the size of an upcoming widget in a plugin declaration?

2019-02-13 Thread stefano franchi
idget yet Is there any way to get the width of the widget to be as
>> it is about to be inserted in the story river (or, even better in
>> general)??Is it provided by the theme and is it accessible?
>>
>> Thanks for the help,
>>
>> S.
>>
>> __
>> Stefano Franchi
>>
>> stefano...@gmail.com
>> http://stefano.cleinias.org
>>
> --
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywikidev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywikidev/dbda1e52-33d9-46c7-b401-5eb659ae8f9c%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywikidev/dbda1e52-33d9-46c7-b401-5eb659ae8f9c%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYnZ5iXS0CoRjEwRfx6wvLdPx%2B9vRuY_jPZYGZ0gUjiXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] How to get the size of an upcoming widget in a plugin declaration?

2019-02-13 Thread stefano franchi
The library I am adapting for a TW plugin builds a complex SVG structure
inside a div and the basic parameter it uses to compute the layout is the
width of the parent container it is inserted in, which it gets with:

parentWidth = parseFloat(getComputedStyle(container.parentElement).width)

This of course does not work in the plugin's render function, where I
instantiate the new div, because there is no parent yet and in fact there
is no widget yet Is there any way to get the width of the widget to be as
it is about to be inserted in the story river (or, even better in
general)??Is it provided by the theme and is it accessible?

Thanks for the help,

S.

__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwbqEPwvYSXP4kr060tQKsr-B%2BzmA0Qa7ya%3DQWSEfN8u7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] How to refer to images in a stylesheet?

2019-02-13 Thread stefano franchi
Never mind, dataURI is the answer, as explained in the docs.

Cheers,
S.

On Wed, Feb 13, 2019 at 10:15 AM stefano franchi 
wrote:

> In this GUI viewer plugin I am writing, I would like to use images as
> backgrounds of certain elements. That would be easy by putting the url of
> the image in the proper style class, such as, e.g.
>
> .myElement {
> background: url("../img/myElementBackground.jpg");
> }
>
> I am at a loss on the argument to url, though.
> Where can i put the image and how do I refer to it? Any theme using this
> method?
>
>
> Cheers,
>
> Stefano
>
> --
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywikidev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywikidev/13dd8fbe-5314-4a6b-8bce-b323c8331823%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywikidev/13dd8fbe-5314-4a6b-8bce-b323c8331823%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwbQztgvEwh9Y_hWFaZw6PZJM6uHJHxTPZTi%3D6%2BX68k15A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] How to refer to images in a stylesheet?

2019-02-13 Thread stefano franchi
In this GUI viewer plugin I am writing, I would like to use images as 
backgrounds of certain elements. That would be easy by putting the url of 
the image in the proper style class, such as, e.g.

.myElement {
background: url("../img/myElementBackground.jpg");
}

I am at a loss on the argument to url, though.
Where can i put the image and how do I refer to it? Any theme using this 
method?


Cheers,

Stefano

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/13dd8fbe-5314-4a6b-8bce-b323c8331823%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: External js library for a widget plugin on node-->where should it go?

2019-02-07 Thread stefano franchi
On Thu, Feb 7, 2019 at 7:49 AM Brian Theado  wrote:

> Stefano,
>
> On Wed, Feb 6, 2019 at 2:54 PM stefano franchi 
> wrote:
>
>
>> thanks for the tip. I hadn't added a title and module-type to the library
>> (in fact, I would rather not touch it, if possible), but doing so does not
>> change the outcome. I still get a module not found error.
>>
>
> To avoid changing the .js file, you can have a tiddlywiki.files which adds
> title and module-type for you. See
> https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/railroad/files
>
> Ah, that finally worked! Great, thank you.
I would be grateful if you could explain what the last section of the file
tiddlywiki.files means:


{
"prefix": "(function(document) {\n",
"suffix": "\n})($tw.node ? $tw.fakeDocument : window.document)\n"
}

That's quite cryptic to me, but it it is obviously needed, as the file
won't work if removed (I tried).


> If your require is failing, it likely means the tiddler containing your
> javascript library is not being loaded. So as a first step, I recommend
> doing an advanced search for your library tiddler to verify it is in fact
> present in the wiki.
>

Well, tiddlywiki wouldn't boot when it could not find the module, so my
options were quite limited in that regard. But I'll keep it in mind for
future ref.


Thanks again,

Stefano

-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwbmDiVtBOuQ%3D-FiZieQgypCxtS5NqDXKjZBHfaGMdeGEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] External js library for a widget plugin on node-->where should it go?

2019-02-05 Thread stefano franchi
Well, I thought I had finally sorted out how how to structure a demo site 
for developing  a new widget plugin on tiddlywiki/node, but I have one more 
problem:
Making tiddlywiki see the external library I need.

I have a local TW/Node site like this:

TW-Demo
+plugins
  +myPlugin
  +myPlugin.js
+
 |
+---files

+--myExtLibrary.js



How do I refer to myExtLIbrary.js within myPlugin.js? I tried the following:

var extLib = require("$:/plugins/myPlugin/files/myExtLibrary.js");

var extLib = require("$:/plugins/myPlugin/myExtLibrary.js");

var extLib = require("$:/myExtLibrary.js");

var extLib = require("$:files/myExtLibrary.js");

(I am clueless, obviously) 

Everytime I get a "Cannot find module" error. I would immensely grateful to 
anyone kind enough to explain to me the semantics of the expression in the 
require statement. How is the path computed? Is it relative to the 
tiddliwiki module? That seems to implied by the standard use of a statement 
like:

var  Widget = require("$:/core/modules/widgets/widget.js").widget;

But that can't be true, otherwise no local installation would ever use a 
plugin...
There's gotta be some magic somewhere that escapes me.


Cheers,
Stefano



-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/d50448e6-c03d-4051-9127-882db8c01d47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] More problems with dev environment on node...

2019-02-05 Thread stefano franchi
Hi Jeremy,

thanks for your reply. Indeed, I had figured out my wrong approach exactly
along the lines you sketch in your message.  I was about to write down an
addendum on "How to develop a plugin with Node and TW5 in your own repo"
for possible inclusion in the docs when I got your message.

Here is what I did, for future ref:

1. Blank slate: erased the local copy of the TW5, plugins folder, and son
on.

2. Installed tiddlywiki with my distribution's  package manager
 (pacman, as I am on Archlinux)

3. Created a local barebones tiddlywiki server edition with the usual
--init server command

4. Added a plugins/myplugin folder to the newly created, personal tiddlywiki

5. Created a plugin.info file and a skeletal myplugin.js plugin into that
folder

6. Added "plugins/myplugin" to the tiddlywiki.info file in the local
tiddlywiki root

7. Added Github repos for the plugin and external library

pretty much you suggested...


On Tue, Feb 5, 2019 at 9:27 AM Jeremy Ruston 
wrote:

> Hi Stefan
>
> Those were indeed the instructions I found first. But on the dev site, at
> https://tiddlywiki.com/dev/#Developing%20plugins%20using%20Node.js%20and%20GitHub,
> the instructions are different.
>
>
> Those instructions are for plugin development. They are focussed on adding
> the plugin to the TW5 repo because that’s what you’d need to do if you
> planned to submit the plugin as a PR to the core. We should probably add an
> update with instructions for working on a plugin within an independent repo.
>
> You can see plugins in their raw state in the plugins folder of the TW5
> repo. You can also add a “plugins” folder to your wiki folder (alongside
> the tiddlywiki.info file), and within that plugins folder have any number
> of named plugin folders (ie, the plugin folders will be something like
> mywiki/plugins/myplugin/plugin.info).
>
> They tell you to clone the github repo, and install the tw5.com edition,
> not the barebone server one.  This is what fails, and twice,  as I
> described in my post. First it fails to install the locally  modified
> TW5.com <http://tw5.com/> edition, and then it fails to boot  because it
> has the wrong path for the language tiddlers (and perhaps it would fail for
> other paths as well, but  boot.js crashes).
>
>
> The first problem in your OP seems to be a problem with the shell finding
> the right copy of TW, perhaps a problem with the PATH environment variable?
>
>
> Regardless, I gave up on installing tw5.com and and now focusing on the
> barebone server edition. The next obstacle is how to convice tiddlywiki to
> recognize a plugin written externally (i.e. directly as a .js file in an
> external editor). There appears to be some magic that escapes me.
>
>
> See the notes above.
>
> Best wishes
>
> Jeremy
>
>
> Cheers,
>
> Stefano
>
> BTW, I am indeed on linux and using the bash shell
>
> --
> Stefano Franchi
>
> stefano.fran...@gmail.com 
> http://stefano.cleinias.org
>
> --
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywikidev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwbfWcYZDOvDbekzw2C2%2BGkKZEODaWxn7uRZ%3D95tf7dQzg%40mail.gmail.com
> <https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwbfWcYZDOvDbekzw2C2%2BGkKZEODaWxn7uRZ%3D95tf7dQzg%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywikidev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywikidev/F11C39F6-9526-4D29-89DC-252DBC140A0C%40gmail.com
> <https://groups.google.com/d/msgid/tiddlywikidev/F11C39F6-9526-4D29-89DC-252DBC140A0C%40gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe fr

Re: [twdev] More problems with dev environment on node...

2019-02-04 Thread stefano franchi
BTW, I must say tiddlywiki reminds me of the Smalltalk environment (not the
language, the system). Beautiful and super-powerful, but it would quickly
turn into a nightmare as soon as you tried to interface it with the
external world, be it source control systems, editors, libraries, or what
have you.
I hope I am wrong, as the Smalltalk story did not end well.
S.

On Mon, Feb 4, 2019 at 10:41 PM stefano franchi 
wrote:

>
>
> On Mon, Feb 4, 2019 at 9:34 PM Brian Theado 
> wrote:
>
>> These steps work for me. If they work for you, maybe it can help you
>> track down your issue:
>>
>> 1. mkdir simple-tw-npm-test
>> 2. cd simple-tw-npm-test
>> # Ignore warnings here about missing package.json
>> 3. npm install tiddlywiki
>> 4. $(npm bin)/tiddlywiki wiki --init server
>> 5. $(npm bin)/tiddlywiki wiki --listen
>> 6. visit http://127.0.0.1:8080 in your browser
>>
>>
>> The tiddlers will be stored in the relative folder named 'wiki'
>>
>> BTW, '$(npm bin)' syntax in #4 and #5 is for bash. If you aren't using
>> Linux or Mac, then likely you aren't using bash. If that's the case, then
>> run the 'npm bin' command by itself and replace the '$(npm bin)' above with
>> the output you see. Also if you are on windows I guess you would need to
>> replace the forward slash with back slash.
>>
>> Now after typing this, I just realized it should be documented already
>> and I find it is:
>> https://tiddlywiki.com/#Installing%20TiddlyWiki%20on%20Node.js. Are
>> these the instructions you are already following?
>>
>
>
> Those were indeed the instructions I found first. But on the dev site, at
> https://tiddlywiki.com/dev/#Developing%20plugins%20using%20Node.js%20and%20GitHub,
> the instructions are different. They tell you to clone the github repo, and
> install the tw5.com edition, not the barebone server one.  This is what
> fails, and twice,  as I described in my post. First it fails to install the
> locally  modified TW5.com edition, and then it fails to boot  because it
> has the wrong path for the language tiddlers (and perhaps it would fail for
> other paths as well, but  boot.js crashes).
>
> Regardless, I gave up on installing tw5.com and and now focusing on the
> barebone server edition. The next obstacle is how to convice tiddlywiki to
> recognize a plugin written externally (i.e. directly as a .js file in an
> external editor). There appears to be some magic that escapes me.
>
> Cheers,
>
> Stefano
>
> BTW, I am indeed on linux and using the bash shell
>
> --
> Stefano Franchi
>
> stefano.fran...@gmail.com 
> http://stefano.cleinias.org
>


-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwafbZT%3DPpgB-VWuYzSkkT_uW-Gcksj95fJqWG1Bv5aeGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] More problems with dev environment on node...

2019-02-04 Thread stefano franchi
On Mon, Feb 4, 2019 at 9:34 PM Brian Theado  wrote:

> These steps work for me. If they work for you, maybe it can help you track
> down your issue:
>
> 1. mkdir simple-tw-npm-test
> 2. cd simple-tw-npm-test
> # Ignore warnings here about missing package.json
> 3. npm install tiddlywiki
> 4. $(npm bin)/tiddlywiki wiki --init server
> 5. $(npm bin)/tiddlywiki wiki --listen
> 6. visit http://127.0.0.1:8080 in your browser
>
>
> The tiddlers will be stored in the relative folder named 'wiki'
>
> BTW, '$(npm bin)' syntax in #4 and #5 is for bash. If you aren't using
> Linux or Mac, then likely you aren't using bash. If that's the case, then
> run the 'npm bin' command by itself and replace the '$(npm bin)' above with
> the output you see. Also if you are on windows I guess you would need to
> replace the forward slash with back slash.
>
> Now after typing this, I just realized it should be documented already and
> I find it is:
> https://tiddlywiki.com/#Installing%20TiddlyWiki%20on%20Node.js. Are these
> the instructions you are already following?
>


Those were indeed the instructions I found first. But on the dev site, at
https://tiddlywiki.com/dev/#Developing%20plugins%20using%20Node.js%20and%20GitHub,
the instructions are different. They tell you to clone the github repo, and
install the tw5.com edition, not the barebone server one.  This is what
fails, and twice,  as I described in my post. First it fails to install the
locally  modified TW5.com edition, and then it fails to boot  because it
has the wrong path for the language tiddlers (and perhaps it would fail for
other paths as well, but  boot.js crashes).

Regardless, I gave up on installing tw5.com and and now focusing on the
barebone server edition. The next obstacle is how to convice tiddlywiki to
recognize a plugin written externally (i.e. directly as a .js file in an
external editor). There appears to be some magic that escapes me.

Cheers,

Stefano

BTW, I am indeed on linux and using the bash shell

--
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwbfWcYZDOvDbekzw2C2%2BGkKZEODaWxn7uRZ%3D95tf7dQzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] More problems with dev environment on node...

2019-02-04 Thread stefano franchi
I'm encountering more troubles getting a demo wiki to work after setting up
the node/tiddlywiki as recommended. Two issues:

1. I cloned the TW5 repo from github into a local dir under my home dir and
modified the tw5.com tiddlywiki.info file as per on the devs site. I also
have a global version of the tiddlywiki source code installed in /usr/lib.
I cannot seem to find a way to convince the tiddlywiki executable to look
into the local version of the "editions" folder. It always uses the global
file in /ur/lib. If I try to pass the full path to the local version of
tw5.com to the tiddlywiki --init command, it always complains that the file
cannot be found.

2. If I do try to install a server version based on the global tw.com
templates, I end up being unable to start the server, because tiddlywiki
stops booting process complaining it cannot find the ca-ES.tid file.
Unsurprisingly so, since it looks for it in the wrong place, using a
relative path that leads it astray. Using the path-prefix options does not
seem to have any effect.

This is very frustrating.  I must be approaching what I I thought would be
a relatively  simple task the wrong way, . Either that or I am really dumb.

Any suggestions?


Cheers,

Stefano
-- 
______
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwaGVU2pFTRVy553Xg45Y-c3pNQvqHp2n2L%2BgC%3Dogk9y5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Plugin development environment under Node and Github with external js library---some guidance appreciated

2019-02-04 Thread stefano franchi
Brian,

thanks for the help, I'll look into that suggested structure.

Cheers,
Stefano

On Mon, Feb 4, 2019 at 11:03 AM Brian Theado  wrote:

> Stefano,
>
> I have a plugin at https://github.com/btheado/tw-ftlist which uses a
> structure I prefer. This one doesn't have any javascript code, but a
> javascript plugin can be structured like this as well (just that more will
> be needed).
>
> TW listed as a dev-dependency in package.json and installed via npm rather
> than as a git checkout as you've done. That should simplify the directory
> structure. And in my example, #2 and #3 are in the same repository. If you
> choose that approach you are down to just 2 repositories.
>
> That's only a partial answer, but I hope it helps.
>
> Brian
>
> On Mon, Feb 4, 2019 at 10:56 AM stefano franchi 
> wrote:
>
>> Dear all:
>>
>> I am starting to write my first widget plugin + external library in TW5
>> and I am not completely sure about the the correct / recommended / most
>> useful structure to give to the various pieces I need to orchestrate.
>> I am using the node + folder model, as recommended on the devs site.
>>
>> As I see it, there are 4 basic components:
>>
>> 1. TW5 itself
>> 2. My plugin code
>> 3. The demo/test site for the plugin
>> 4. The external js library code (which I maintain too)
>>
>> Here is what I did:
>> - I cloned the main TW5 repo  and created a second git repo under
>> TW5/plugins/myName/myPluginName
>> - I cloned the external library repo under
>> TW5/plugins/myName/myPluginName/files
>>
>> So I have this structure, which I basically copied from the Railroad
>> plugin I am using as a blueprint (and which seems already a bit too
>> complex):
>>
>> TW5 (git repo)
>>+->bin
>>+->boot
>>+-- .
>>+ >editions
>> |   +->server
>> |   +->tiddlywiki.info (updated
>> to include myPlugin)
>>+->plugins
>> +->tiddlywiki
>> +->stefano
>>  +-->myPlugin (git repo)
>>
>> +--->files (git repo for external library)
>>
>> |
>>
>> +>external_library.js
>> Questions:
>>
>> 1. Where would I put the demo/test site (which I also want to be under
>> git control)? Am i correct that any tiddlywik/node site I init from within
>> the TW5 directory above could be anywhere on disk and still have access to
>> myPlugin?
>>
>> 2. Mostly, I am not sure about the external library location. First, it
>> does not seem right to clone the entire external repo under files, which
>> presumably will contain also other local material (.css, tiddlywiki.files,
>> etc).
>> Perhaps the external library should be cloned under a subdir of files
>> and tiddlywiki.files structured accordingly, and tiddliwiki.files made to
>> point it to it? With demo/test site included it would look as follows:
>>
>>  +--TW5 (git repo)
>>  |   +->bin
>>  |   +->boot
>>  |   +-- .
>>  |   + >editions
>>  |   |   +->server
>>  |   |   +->tiddlywiki.info
>> (updated to include myPlugin)
>>  |   +->plugins
>>  |+->tiddlywiki
>>  |+->stefano
>>  | +-->myPlugin (git repo)
>>  |
>> +--->files
>>  |
>> +->  file.css
>>  |
>> +->  tiddlywiki.files
>>  |
>> +--> external_library-folder (git repo)
>>  |
>> |
>>  |
>> +-->external-library.js
>>  |
>>  |
>>  |
>>  +-->Demo/test site (git repo)
>>
>> This structure makes logical sense to me but with four different git
>> repos to keep updated seems like a maintenance nightmare (well 3+1, since I
>> am not involved with TW5, although I would have to pull from every now and
>> then).
>> Any suggestions on possible simplifications? How do you guys do it?
>>
>> --
>> 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 tiddlywikidev+unsubscr...@googlegrou

[twdev] Plugin development environment under Node and Github with external js library---some guidance appreciated

2019-02-04 Thread stefano franchi
Dear all:

I am starting to write my first widget plugin + external library in TW5 and 
I am not completely sure about the the correct / recommended / most useful 
structure to give to the various pieces I need to orchestrate.
I am using the node + folder model, as recommended on the devs site.

As I see it, there are 4 basic components:

1. TW5 itself
2. My plugin code
3. The demo/test site for the plugin
4. The external js library code (which I maintain too)

Here is what I did: 
- I cloned the main TW5 repo  and created a second git repo under 
TW5/plugins/myName/myPluginName
- I cloned the external library repo under 
TW5/plugins/myName/myPluginName/files

So I have this structure, which I basically copied from the Railroad plugin 
I am using as a blueprint (and which seems already a bit too complex):

TW5 (git repo)
   +->bin  
   +->boot
   +-- .
   + >editions
|   +->server
|   +->tiddlywiki.info (updated to 
include myPlugin)  
   +->plugins
+->tiddlywiki
+->stefano
 +-->myPlugin (git repo)
+--->files 
(git repo for external library)
  |
  
+>external_library.js 
Questions:

1. Where would I put the demo/test site (which I also want to be under git 
control)? Am i correct that any tiddlywik/node site I init from within the 
TW5 directory above could be anywhere on disk and still have access to 
myPlugin?

2. Mostly, I am not sure about the external library location. First, it 
does not seem right to clone the entire external repo under files, which 
presumably will contain also other local material (.css, tiddlywiki.files, 
etc).
Perhaps the external library should be cloned under a subdir of files 
and tiddlywiki.files structured accordingly, and tiddliwiki.files made to 
point it to it? With demo/test site included it would look as follows:

 +--TW5 (git repo)
 |   +->bin 
 |   +->boot
 |   +-- .
 |   + >editions
 |   |   +->server
 |   |   +->tiddlywiki.info 
(updated to include myPlugin) 
 |   +->plugins
 |+->tiddlywiki
 |+->stefano
 | +-->myPlugin (git repo)
 |
+--->files
 |  
+->  file.css
 |  
+->  tiddlywiki.files
 |  
+--> external_library-folder (git repo)
 |  

|
 |  

+-->external-library.js
 |
 |
 |
 +-->Demo/test site (git repo)

This structure makes logical sense to me but with four different git repos 
to keep updated seems like a maintenance nightmare (well 3+1, since I am 
not involved with TW5, although I would have to pull from every now and 
then).
Any suggestions on possible simplifications? How do you guys do it?

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/7618e06f-988b-4db8-8ed9-a53496d1ed54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: ANN: widget tutorial

2019-02-03 Thread stefano franchi
Brian,

great work and greatly needed. Can't wait to read the 3rd party library
tutorial!

Cheers,
Stefano

On Sun, Feb 3, 2019 at 9:35 PM Brian Theado  wrote:

> Tony and Mohammad, thanks for the feedback.
>
> I just added "Widget attributes tutorial part I".
>
> So now these sections are written:
>
> Undefined widget tutorial
> Do nothing widget tutorial
> Hello World widget tutorial
> Widget refresh tutorial part I
> Widget refresh tutorial part II
> Widget refresh tutorial part III
> Widget attributes tutorial part I
>
>
> With these still left to write:
>
> Widget attributes tutorial part II
> 3rd party library tutorial part I
> 3rd party library tutorial part II
> Child widgets tutorial
>
>
> Brian
>
> On Sun, Feb 3, 2019 at 8:14 AM Brian Theado 
> wrote:
>
>> I have a work in progress tutorial for writing TW widgets at
>> https://btheado.github.io/tw-widget-tutorial/. It starts with the
>> simplest widget I could think of and builds from there. I will be adding
>> more over the coming days and weeks.
>>
>> It uses the innerwiki plugin to provide an interactive playground for the
>> javascript code. In fact I developed it all using a single file tiddlywiki.
>> The immediate feedback provided by the innerwiki widget was most helpful.
>>
>> Any feedback appreciated, especially if I've misrepresented anything.
>>
>> Brian
>>
> --
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywikidev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywikidev/CAO5X8CzUa3%3D50x2fFUW-EvMPzmUsDsrPW98ESLigEFp8zT8YmA%40mail.gmail.com
> <https://groups.google.com/d/msgid/tiddlywikidev/CAO5X8CzUa3%3D50x2fFUW-EvMPzmUsDsrPW98ESLigEFp8zT8YmA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwZ3RqwhEvEZc%2BMx%3DPpKP6h19Z%3D_Ve%3D6-2pY4zsF4RmrfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: Transforming ascii text into embeddable images?

2019-01-29 Thread stefano franchi
Thanks to all for the suggestions. The Railroad plugin+library looks very
similar to what I'm trying to do. I will start by looking at that code.

Cheers,
Stefano


On Tue, Jan 29, 2019 at 9:22 AM Jeremy Ruston 
wrote:

> The Railroad plugin in the official plugin library is an example of
> reusing such a library -- in this case, the underlying library is
> https://github.com/tabatkins/railroad-diagrams
>
>
> https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/railroad
>
> Best wishes
>
> Jeremy
>
>
>
> --
> Jeremy Ruston
> jer...@jermolene.com
> https://jermolene.com
>
> On 29 Jan 2019, at 08:04, TonyM  wrote:
>
> Stephano
>
> Mario's answer is to the point and correct. But could I suggest before you
> do such a thing you look at what other visualisation tools are available in
> Tiddlywiki, from the railroad plugins and others that require simple text
> and translate it into other forms, usually graphics and visualisations. You
> could then print them to a PDF printer.
>
> If you are comfortable sharing the details of "your a few lines of Ascii
> into an image" tool perhaps there is an equivalent already available.
>
> Regards
> Tony
>
> On Tuesday, January 29, 2019 at 6:23:46 PM UTC+11, PMario wrote:
>>
>> On Tuesday, January 29, 2019 at 12:58:17 AM UTC+1, stefano franchi wrote:
>>
>>> First newbie question: Am I right that I would need to write a new
>>> widget plugin to achieve what I have in mind?
>>>
>>
>> yes
>>
>>
>> --
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywikidev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywikidev/108d47f8-72f7-4465-a26c-a137c9bef00a%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywikidev/108d47f8-72f7-4465-a26c-a137c9bef00a%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 tiddlywikidev+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywikidev@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywikidev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywikidev/3950832F-D729-472F-9842-5FCAFF995E08%40gmail.com
> <https://groups.google.com/d/msgid/tiddlywikidev/3950832F-D729-472F-9842-5FCAFF995E08%40gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
__
Stefano Franchi

stefano.fran...@gmail.com 
http://stefano.cleinias.org

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/CAJODLwYKq3qyp0bvBr28rqeRTi5vcWDSf3sgWLgVeFWWV_pHxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Transforming ascii text into embeddable images?

2019-01-28 Thread stefano franchi
I just started using Tiddlywiki and I am trying to understand how I can 
customize for  my purposes. 
Here is the first issue I am facing:

1. Suppose I have a  tool that is capable of transforming a few lines of 
Ascii into an image (pdf/eps/png, etc). 
2. I want to be able to open a tiddler, insert those lines of text and 
have  the image produced by the tool embedded into the tiddler

First newbie question: Am I right that I would need to write a new widget 
plugin to achieve what I have in mind?

-- 
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 tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/62259969-f7a6-44cb-a15b-66b659b27ecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.