Re: [tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-20 Thread Alex Hough
I like the uk.gov.uk site: I became a fan when I discovered TW old boy PSD
went to work there. Here we can see external link icons.

[image: Inline images 1]

In terms of credibility, especially when dealing with the pubic sector,
producing websites with a similar level of complexity to government
standards is a good strategy


If the external link plugin had the ability to add the icon, or it was in a
.external URL documentation marco -- I think it would be a good addtion

Alex

On 19 June 2015 at 11:00, PMario pmari...@gmail.com wrote:

 Hmm,
 As I wrote in my first response. The TW pretty link mechanism goes a long
 way, is bloody simple and works out of the box.
 -m

 --
 You received this message because you are subscribed to the Google Groups
 TiddlyWiki group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to tiddlywiki+unsubscr...@googlegroups.com.
 To post to this group, send email to tiddlywiki@googlegroups.com.
 Visit this group at http://groups.google.com/group/tiddlywiki.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/tiddlywiki/59d33f4f-b451-4388-b85e-4b7ca0052c84%40googlegroups.com
 https://groups.google.com/d/msgid/tiddlywiki/59d33f4f-b451-4388-b85e-4b7ca0052c84%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CALc1hYeQbP944gxu88gmq-q%2BmyK-EvyYhuQFNQpW8dBhup7%3D7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-20 Thread PMario
On Saturday, June 20, 2015 at 4:26:33 PM UTC+2, PMario wrote:

 background: transparent 
 url(data:image/gif;base64,R0lGODlhCAAIAIABAABmZv///yH5BAEKAAEALAAIAAgAAAIPjAMJd5q2HoQLsTpto84UADs=)
  
 no-repeat center;


The cool thing here is, that the used gif imo is extremely small. 
This mechanism was shown here: 
https://groups.google.com/forum/#!topic/tiddlywiki/DPv-2QBfQQA by Stephan 
Hradek

-mario

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/31a741c0-f76f-4ff9-90a6-36a01bb8fb95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-20 Thread PMario
On Saturday, June 20, 2015 at 11:27:16 AM UTC+2, AlexHough wrote:


 If the external link plugin had the ability to add the icon, or it was in 
 a .external URL documentation marco -- I think it would be a good 
 addtion


This can be achieved by pure CSS. 

Copy the following CSS definition into a tiddler eg: myExternalLinkStyle 
and tag it $:/tags/Stylesheet


a.tc-tiddlylink-external:after {
display: inline-block;
content: ;
width: 12px;
height: 8px;
background: transparent 
url(data:image/gif;base64,R0lGODlhCAAIAIABAABmZv///yH5BAEKAAEALAAIAAgAAAIPjAMJd5q2HoQLsTpto84UADs=)
 
no-repeat center;
}

if you use: 

a.tc-tiddlylink-external:before instead of :after the icon is in front of 
the link.

have fun!
mario


-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d7917373-5dcb-43de-acfe-9e00f046914c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-20 Thread Alex Hough
Great stuff Mario

Alex

On 20 June 2015 at 15:37, PMario pmari...@gmail.com wrote:

 On Saturday, June 20, 2015 at 4:26:33 PM UTC+2, PMario wrote:

 background: transparent
 url(data:image/gif;base64,R0lGODlhCAAIAIABAABmZv///yH5BAEKAAEALAAIAAgAAAIPjAMJd5q2HoQLsTpto84UADs=)
 no-repeat center;


 The cool thing here is, that the used gif imo is extremely small.
 This mechanism was shown here:
 https://groups.google.com/forum/#!topic/tiddlywiki/DPv-2QBfQQA by Stephan
 Hradek

 -mario

 --
 You received this message because you are subscribed to the Google Groups
 TiddlyWiki group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to tiddlywiki+unsubscr...@googlegroups.com.
 To post to this group, send email to tiddlywiki@googlegroups.com.
 Visit this group at http://groups.google.com/group/tiddlywiki.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/tiddlywiki/31a741c0-f76f-4ff9-90a6-36a01bb8fb95%40googlegroups.com
 https://groups.google.com/d/msgid/tiddlywiki/31a741c0-f76f-4ff9-90a6-36a01bb8fb95%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CALc1hYfV-TTsseo5cDf5qXXOEd0y_c0U5B3u6WWfx1B17drErQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-19 Thread PMario
Hmm, 
As I wrote in my first response. The TW pretty link mechanism goes a long 
way, is bloody simple and works out of the box. 
-m

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/59d33f4f-b451-4388-b85e-4b7ca0052c84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-19 Thread Jeremy Ruston
Hi Richard

Hi Mario - I found the github api and was just reading up on it. I thought
 it might be a good way for me to learn a bit more about how api calls work.

 I see your point about calling the api repeatedly - what do you think the
 best practice would be in this regard? ie; is there a way to limit the
 number of times it gets called (once?) - for example only when the wiki is
 loaded and store the result?


You definitely don't want to be making HTTP calls from macros or widgets;
by the time the call returns the widget/macro might have been destroyed and
recreated by the refresh mechanism.

Here's a potentially workable approach. Issue 1799 has the following URL:

https://github.com/Jermolene/TiddlyWiki5/issues/1799

As a convention, we could store the corresponding title in the text field
system tiddler:

$:/plugins/richardsmith/githubissues/
https://github.com/Jermolene/TiddlyWiki5/issues/1799

Then we need to display an issue we could do so with a transclusion that
falls through to displaying the URL if the title tiddler is missing:

$transclude
tiddler=$:/plugins/richardsmith/githubissues/$(issue-url)$
$(issue-url)$
/$transclude

Then we'd need a startup module or daemon that handles `tm-load-url`
messages, with parameters indicating the URL to load and the tiddler to
store the data. The loading would happen asynchronously, triggering a
refresh when the tiddler is eventually loaded. We would probably need to
take steps to avoid the same tiddler being repeatedly loaded (perhaps we
could rely on XMLHttpRequest to observe the incoming HTTP caching headers).

The final part is triggering the loading. That's tricky because we don't
currently have a way of triggering a message when a chunk of content is
displayed; messages are always triggered by external events like clicks or
timers. The easiest way to experiment would be with a JS macro that sends
the `tm-load-url` message when it is rendered.

That's only an outline, I'd be delighted to help with details. The url
loading mechanism is nicely generic, though.

Best wishes

Jeremy.




-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAPKKYJZ%3Dvwc9_5k2-GCm1AENYaB5kw6q%2Bv4BioBaAvKtAevSSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-17 Thread PMario
On Wednesday, June 17, 2015 at 8:32:50 AM UTC+2, Richard Smith wrote:

 I think you should only have one vertical bar in the pretty link? ie; 
 [[github issue: Allow saver to be specified for download|
 https://github.com/Jermolene/TiddlyWiki5/issues/1755]] 


Good catch :) thx for the fix. 
 

 I supposed that Mat intended to use it something like this; 

 github issue: Allow saver to be specified for download (prettylink 
 https://github.com/Jermolene/TiddlyWiki5/issues/1755) 

 Does GitHub have an api that will return the issue title? Or did you mean 
 copy-paste? 


Yes github has an api, but it would create a network request everytime the 
code is rendered, which may be every keystroke. 

For me, it would be ok, to ping Wikipedia, if I open a tiddler. 
But imo they won't be happy to get the same api request over and over again 
in a short period of time. It's quite likely, they'll block me.

And pinging all sorts of different pages with api requests, everytime I use 
a TW, it is a privacy concern for me.

-mario

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/cacd67c3-6b4b-4ece-a378-9517b960713a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-17 Thread Richard Smith
Hi Mario,

I think you should only have one vertical bar in the pretty link? ie;

[[github issue: Allow saver to be specified for 
download|https://github.com/Jermolene/TiddlyWiki5/issues/1755]]

I supposed that Mat intended to use it something like this;

github issue: Allow saver to be specified for download (prettylink 
https://github.com/Jermolene/TiddlyWiki5/issues/1755)

Does GitHub have an api that will return the issue title? Or did you mean 
copy-paste?

Regards,
Richard

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0e232bb0-e08d-49d3-89ba-1a6266368321%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-17 Thread Richard Smith



 Yes github has an api, but it would create a network request everytime the 
 code is rendered, which may be every keystroke. 

 For me, it would be ok, to ping Wikipedia, if I open a tiddler. 


Hi Mario - I found the github api and was just reading up on it. I thought 
it might be a good way for me to learn a bit more about how api calls work. 

I see your point about calling the api repeatedly - what do you think the 
best practice would be in this regard? ie; is there a way to limit the 
number of times it gets called (once?) - for example only when the wiki is 
loaded and store the result? Is there anywhere in the existing code that 
makes api calls?

Regards,
Richard

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ab6a24f9-242c-4efe-9dca-d2e5b6b3a671%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-17 Thread PMario
On Wednesday, June 17, 2015 at 11:43:26 AM UTC+2, Richard Smith wrote:

 Hi Mario - I found the github api and was just reading up on it. I thought 
 it might be a good way for me to learn a bit more about how api calls work. 

I see your point about calling the api repeatedly - what do you think the 
 best practice would be in this regard? ie; is there a way to limit the 
 number of times it gets called (once?) - for example only when the wiki is 
 loaded and store the result? 


You can cache the results in a data tiddler and check it prior to creating 
new api calls. 
 

  Is there anywhere in the existing code that makes api calls?


Yes the tiddlyweb sync adaptor plugin. It's probably not the perfect fit, 
but it shows how the http utility functions are used. 

see: 
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/utils/dom/http.js
 
and
https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/tiddlyweb
 


hope that helps
-mario

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7af64665-b6e0-4559-8c3a-bdef0719d090%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-16 Thread Mat
Ye haw! I'm as grateful as I am positively surprised that someone actually 
took charge and implemented it! My warmest thank you, Richard!

Some bits:


   - Shoud it perhaps be tagged $:/tags/Macro ?
   - I note that  adds #. This is a really nice touch for the github 
   issues but does not work so well for permalinks as they already have this 
   character after the slash sign so it results in double ##. It is of course 
   trivial to remove that bit from the code so I can do this myself. Something 
   else I will try is to let the user specify delimiter is but perhaps use / 
   as default. (I'll attempt to implement this too... good luck, Mat)
   - When I add it (to TWaddle), should/can I in the tiddler head add the 
   text:
   
creator: Richard Smith
source: https:
//dl.dropboxusercontent.com/u/83055414/prettifylinkexample.html#RS%2Fmacros%2Fprettifypath.js


   - ...and, if I manage to get something working with my tweaks for it, 
   how would I fairly credit you? Include original creator and original 
   source perhaps?
   - Maybe its worth making it into a plugin (ref Andreas Tinka) ?
   

:-)

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/484ca13e-3773-4243-940c-892cb7d5c3fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-16 Thread RichardWilliamSmith
Hi Mat, 


- Shoud it perhaps be tagged $:/tags/Macro ?

 hmmm... yes. Now you mention it, I'm not sure why it works without that - 
I guess because it's javascript and explicitly functions as a macro. 


- I note that  adds #. This is a really nice touch for the github 
issues but does not work so well for permalinks as they already have this 
character after the slash sign so it results in double ##. It is of course 
trivial to remove that bit from the code so I can do this myself. 
 Something 
else I will try is to let the user specify delimiter is but perhaps use 
 / 
as default. (I'll attempt to implement this too... good luck, Mat)


Good luck, Mat! It's really not so scary - you should be able to pass the 
delimiter as an optional second parameter 


- When I add it (to TWaddle), should/can I in the tiddler head add the 
text:
- 

 creator: Richard Smith
 source: https://
 dl.dropboxusercontent.com/u/83055414/prettifylinkexample.html#RS%2Fmacros%2Fprettifypath.js


I'd rather not commit to that file existing for any length of time.  


- ...and, if I manage to get something working with my tweaks for it, 
how would I fairly credit you? Include original creator and original 
source perhaps?

 I don't really care about credit, tbh (there are tens of thousands of 
Richard Smith's in the world anyway) but perhaps soon I will start to keep 
a github page of my own and that might be the place to point to 
(r1chard5mith)
 


- Maybe its worth making it into a plugin (ref Andreas Tinka) ?

 Perhaps, if we add some more features/options it will be worth rolling up 
into a plugin and we can maintain it together - your idea after all.

@Alex: good idea Alex - inexplicably, I hadn't looked at the documentation 
macros before. I will have a play later. The dropbox issue seems to be 
because you don't have it in your 'public' folder? Only the public folder 
gets permanent links but some people don't have a public folder. Thanks for 
attaching the file, will explore.

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b1e99939-5f1f-4a08-b4f7-51dc36688042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-16 Thread PMario
Hi Mat,

The github issue number imo has some room for improvements. You always have 
to click the link, to see the issue title. ... They should have used TW 
pretty links like so: 

[[github issue: Allow saver to be specified for download||
https://github.com/Jermolene/TiddlyWiki5/issues/1755]]

That's much clearer. The number is shorter, but imo makes no sense. 

just my 2 cents
mario

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7d1c1b8e-7237-4393-b49a-bc028f987c15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-15 Thread RichardWilliamSmith
Hi again Mat,

I think I did it. I put it in a dropbox wiki for you to look 
at: https://dl.dropboxusercontent.com/u/83055414/prettifylinkexample.html

I cloned one of the existing macros so that it had the right type  and 
module type and then fudged my way through it. The only vexing part was 
having to reload the wiki each time to see if it worked - I assume there 
must be a better way to do that.

The code looks like this (comments and criticism gladly accepted);

/*\
title: $:/RS/macros/prettifypath.js
type: application/javascript
module-type: macro

Resolves a relative path for an absolute rootpath.


 \*/
 (function(){/*jslint node: true, browser: true */
 /*global $tw: false */
 use strict;exports.name = prettifypath;exports.params = [
   {name: path},
 ];/*
 Run the macro
 */
 exports.run = function(path) {
 var arrayOfStrings = path.split(/);
 var returnValue = [[# + arrayOfStrings[arrayOfStrings.length-1] + 
 | + path  + ]];
 return returnValue;};})();


 

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2200c40c-7a72-4820-99dc-c75fd6b4eda8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] URL prettify macro, e.g to show git-issue links as #number

2015-06-12 Thread Richard Smith
Hi Mat,

I applaud your vigour in attempting to stretch wikitext to it's limits but 
I think we might be at it's limit here (Jeremy?)

Like you, I am 'not a coder', but I think it might be easier for us to 
figure out the necessary javascript (and start to become coders!) than to 
look for a wikitext solution.

Here is the dev page on js 
macros: http://tiddlywiki.com/dev/index.html#JavaScript%20Macros

And here are the examples from the 
core: https://github.com/Jermolene/TiddlyWiki5/tree/master/core/modules/macros

This is (presumably) the js function we would 
use: 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split

Presumably, this would be quite easy for our coding friends to achieve... 
What do you think?

Regards,
Richard

-- 
You received this message because you are subscribed to the Google Groups 
TiddlyWiki group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/90aef456-0667-4f76-afa8-60eee26ece5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.