Re: [twdev] [TW5] TiddlyWiki as an Application Platform for a Powershell GUI/IDE

2016-10-16 Thread Marc J. Cawood
A! The old security-kills-functionality. get's me every time. Sniff.

-- 
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/050d1bfa-64f4-4985-9536-cc98c2594586%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] TiddlyWiki as an Application Platform for a Powershell GUI/IDE

2016-10-16 Thread Jeremy Ruston
Hi Marc

> I see the wikis are not running as normal nw.js applications. How are you 
> launching them?

Wiki files are loaded in sandboxed iframes; they don't have access to Node.js 
features. The main process runs the backstage wiki, a privileged TiddlyWiki 
that runs in the background and provides the TiddlyDesktop user interface. That 
dichotomy lies behind my comment about needing to figure out a way to 
communicate between the two parts of the system.

Best wishes

Jeremy.

> -- 
> 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/565ee1cb-d2a8-4ca1-8975-b22a1b2251eb%40googlegroups.com.
> 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/93F23B2D-72A2-4ABC-8D83-598A91C3092C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] TiddlyWiki as an Application Platform for a Powershell GUI/IDE

2016-10-16 Thread Marc J. Cawood
Oh dear!
process is not defined

I see the wikis are not running as normal nw.js applications. How are you 
launching them?

-- 
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/565ee1cb-d2a8-4ca1-8975-b22a1b2251eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] TiddlyWiki as an Application Platform for a Powershell GUI/IDE

2016-10-16 Thread Marc J. Cawood
Well... naivety is one of my only virtues.

The following code works fine in standard nw.js and shows how the runtime 
is just browser+node:

Click Me!

I can even get `require('child_process').exec()` working without requiring 
any modules.

So why shouldn't this code run inside TiddlyDesktop?

-- 
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/bca66e6f-815e-4984-b6cd-2a638bd70e8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] TiddlyWiki as an Application Platform for a Powershell GUI/IDE

2016-10-16 Thread Jeremy Ruston
Hi Marc

> Thanks Jeremy. I'm looking at using the `child_process` module but I don't 
> see any node_modules/ folder in TW Desktop. Could you give me a leg up on how 
> to import a module?

TiddlyDesktop doesn’t use node_modules at the moment. You’ll need to research 
the details of how nw.js handles node_modules, but it definitely works.

> Bonus Question: If you could hack a small plugin which shows a button which 
> execs say `ls` and returns (alerts) the string that would be awesome.

It’s not a trivial amount of work, I’m afraid. There is no direct access 
between the TiddlyDesktop main process and the content of a wiki. To devise a 
way for the wiki to request that the main process executes a code fragment, you 
might want to to look at how saving is handled using the DOM for message 
transfer. You’d need to rig up something similar so that a hosted wiki can 
request that a code fragment be executed.

Just to be clear, your goals here are ambitious and unusual. I don’t know of 
anyone else who’s done the same thing. So there’s going to be quite a lot of 
slog to get there: you’ll need to learn a lot of the details of how things work 
so that you can copy/extend things. As a programmer, I’d say that it’s the 
recipe for absorbing entertainment, but it’s not for everyone :)

Best wishes

Jeremy

> 
>  const exec = require('child_process').exec;
>  exec('ls', (err, stdout, stderr) => {
>   if (err) {
>console.error(err);
>return;
>   }
>   console.log(stdout);
>  });
> 
> 
> -- 
> 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/9fee8f58-22e0-4627-9438-0ba7c1d6962c%40googlegroups.com
>  
> .
> 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/A5CE42B9-7D74-40D3-8345-9B92F0F02026%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [TW5] TiddlyWiki as an Application Platform for a Powershell GUI/IDE

2016-10-16 Thread Jeremy Ruston
Hi Marc

> I could use NW.js but then I'd have to build my own UI. My thinking is: 
> could/should I use TW5 Desktop?

If you wish to build a native app based on TiddlyWiki then TiddlyDesktop might 
be a reasonable place to start. Alternately, you could consider just adding the 
enhancements you need as TiddlyDesktop plugins - it’s very extensible, like 
TiddlyWiki itself.

> Can TW be leveraged as an application platform which is not necessarily a 
> wiki (i.e. info platform).

It’ll still be a wiki, at least in the sense that TW uses the term (roughly, an 
application for composing hypertext). But it doesn’t need to look like a wiki 
to the end user; by replacing $:/core/ui/PageTemplate one can have an entirely 
custom user interface.

> I think TiddlyWiki would be a great platform for a rich/hypertext version of 
> the Powershell Help System/Reference. But I want to add on top of that and 
> have, in addition to the cmdlet reference, a kind of builder UI. So I can 
> search or navigate to a cmdlet, read it's syntax, see some examples AND run 
> those examples AND build my own execution of that cmdlet.
> 
> Ideally the UI will allow a preview of the output objects of cmdlets (using 
> the `ConvertTo-JSON` cmdlet) as tables or trees and piping these outputs to 
> other cmdlets. Even more betterer would be a kind of flowchart drag and drop 
> like snaplogic but that's a way down the line.
> 
> So, in addition to the questions above, can plugins within TW Desktop work 
> like standard node modules and require modules like `node-powershell` and 
> just execute OS commands?

Yes, TiddlyDesktop plugins have access to Node.js APIs.

Best wishes

Jeremy

> 
> -- 
> 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/e0439414-f8c9-4d8f-aadd-6157332381d8%40googlegroups.com
>  
> .
> 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/BBDA239A-7FF0-4470-B8F6-D36DE43CFE34%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] [TW5] TiddlyWiki as an Application Platform for a Powershell GUI/IDE

2016-10-16 Thread Marc J. Cawood
So I've been learning Powershell and it's pretty, well, powerful and, since 
August, open-source and cross platform. And it's not only for server 
operators. But enough asides...

Powershell is command-line-based and I like making a GUI on top of useful 
command-lines (as I have done with AWK and WGET) because I am forgetful 
about syntax and a UI, with built-in reference, which builds and runs 
commands from a few clicks is just better than typing (and mistyping) a lot.

My preference for the presentation would be HTML and my preference for the 
logic would be JavaScript. However, I need access directly to the operating 
system (no browser sandbox).

I could use NW.js but then I'd have to build my own UI. My thinking is: 
could/should I use TW5 Desktop? Can TW be leveraged as an application 
platform which is not necessarily a wiki (i.e. info platform).

I think TiddlyWiki would be a great platform for a rich/hypertext version 
of the Powershell Help System/Reference. But I want to add on top of that 
and have, in addition to the cmdlet reference, a kind of builder UI. So I 
can search or navigate to a cmdlet, read it's syntax, see some examples AND 
run those examples AND build my own execution of that cmdlet.

Ideally the UI will allow a preview of the output objects of cmdlets (using 
the `ConvertTo-JSON` cmdlet) as tables or trees and piping these outputs to 
other cmdlets. Even more betterer would be a kind of flowchart drag and 
drop like snaplogic but that's a way down the line.

So, in addition to the questions above, can plugins within TW Desktop work 
like standard node modules and require modules like `node-powershell` and 
just execute OS commands?

-- 
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/e0439414-f8c9-4d8f-aadd-6157332381d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.