Re: [tw5] [Macro] datauri macro and svg images

2020-12-15 Thread Mohammad
@Jeremy
Many thanks for your clarification. 

@Sylvain
I understood both favicon and datauri need real svg image file. I am not 
sure if this is an efficient way or not but you can write your svg block 
like core image into another tiddler with correct type and xmlns part! But 
may be it does not make sense to create svg in this way.

My two cents.

-- Mohammad

On Tuesday, December 15, 2020 at 3:22:39 PM UTC+3:30 jeremy...@gmail.com 
wrote:

> Hi Sylvain
>
> Would it still be possible to make this evolve in the future (and consider 
> the favicon as a core image therefore and not an SVG XML image)?
>
>
> This isn’t a TiddlyWiki thing, this is how SVG is handled by browsers. The 
> browser requires a full SVG image for the favicon. Remember that inline 
> SVGs are actually HTML, and are not supported by favicons.
>
>
> Best wishes
>
> Jeremy
>
>
> (and play with fill="#fa4d60").
>
> Sylvain
>
> Le mardi 15 décembre 2020 à 11:55:31 UTC+1, Jeremy Ruston a écrit :
>
>> Hi Mohammad, Joshua
>>
>> This is the old chestnut of the confusing fact that there are two 
>> distinct types of SVG images, and they behave differently, and are defined 
>> differently. The core images are actually SVG elements designed to be 
>> transcluded directly into HTML documents; that’s what enables us to 
>> recolour these images with CSS. Full SVG images are XML documents with an 
>> embedded SVG element containing the image. They are displayed with the img 
>> tag, or as here, via CSS properties. It is not possible to use an SVG 
>> fragment as an image is the crucial thing.
>>
>> We try to explain it in the docs here:
>>
>> https://tiddlywiki.com/#Using%20SVG
>>
>> Best wishes
>>
>> Jeremy
>>
>>
>>
>> On 15 Dec 2020, at 01:41, Joshua Fontany  wrote:
>>
>> Interesting... I wonder if this is true for all SVGs or just the 
>> core. The core image tiddlers are not actually "type:image/svg+xml", they 
>> do not have a type value, and are interpreted as wiki-text when transcluded.
>>
>> Best,
>> Joshua F
>>
>>
>> On Wednesday, December 9, 2020 at 1:33:52 AM UTC-8 Mohammad wrote:
>>
>>> I tried to use an svg as background. I realized I cannot use core svg 
>>> images. One reason may be the tiddler type or perhaps the removed xlmns.
>>>
>>> See below example at 
>>>
>>>  .jack { background: url(<$macrocall $name="datauri" 
>>> title="Motovun Jack.jpg" $output="text/plain"/>); height: 300px; }  
>>>  
>>>
>>> Now if I replcae  Motovun Jack.jpg with $:/core/images/close-button as 
>>> below
>>>
>>>  .jack { background: url(<$macrocall $name="datauri" 
>>> title="Motovun Jack.jpg" $output="text/plain"/>); height: 300px; }  
>>>   
>>>
>>> It does not work! 
>>>
>>> What is the reason?
>>>
>>> --Mohammad
>>>
>>
>> -- 
>> 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+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/4236b4d1-5bdc-4e9f-b418-5717ced3c4edn%40googlegroups.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+...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/d54b15c9-9e1c-410d-bb7b-2f122b3ce11en%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/66235a2a-a5e8-4a67-98b8-f4829facde27n%40googlegroups.com.


Re: [tw5] [Macro] datauri macro and svg images

2020-12-15 Thread Sylvain Naudin
I still haven't found out if it's possible to do that, but the subtlety is 
that you would have to copy the final rendering and not the content of the 
text field because otherwise it goes back to the starting point ^^'.




Le mardi 15 décembre 2020 à 13:09:37 UTC+1, Sylvain Naudin a écrit :

> OK,
> It's frustrating because with TW's ability to modify itself, one could 
> imagine just changing the colour of a fill element in the text field of the 
> SVG tiddler ;)
>
> I guess I can find a workaround by doing a macro to completely change the 
> text field of my tiddler.
>
> (Can $action-setfield be used to write the content of one tiddler from 
> another? So I can manipulate the content of one with the macro color and 
> have a button to apply the change to the favicon ?).
>
> Le mardi 15 décembre 2020 à 12:52:39 UTC+1, Jeremy Ruston a écrit :
>
>> Hi Sylvain
>>
>> Would it still be possible to make this evolve in the future (and 
>> consider the favicon as a core image therefore and not an SVG XML image)?
>>
>>
>> This isn’t a TiddlyWiki thing, this is how SVG is handled by browsers. 
>> The browser requires a full SVG image for the favicon. Remember that inline 
>> SVGs are actually HTML, and are not supported by favicons.
>>
>>
>> Best wishes
>>
>> Jeremy
>>
>>
>> (and play with fill="#fa4d60").
>>
>> Sylvain
>>
>> Le mardi 15 décembre 2020 à 11:55:31 UTC+1, Jeremy Ruston a écrit :
>>
>>> Hi Mohammad, Joshua
>>>
>>> This is the old chestnut of the confusing fact that there are two 
>>> distinct types of SVG images, and they behave differently, and are defined 
>>> differently. The core images are actually SVG elements designed to be 
>>> transcluded directly into HTML documents; that’s what enables us to 
>>> recolour these images with CSS. Full SVG images are XML documents with an 
>>> embedded SVG element containing the image. They are displayed with the img 
>>> tag, or as here, via CSS properties. It is not possible to use an SVG 
>>> fragment as an image is the crucial thing.
>>>
>>> We try to explain it in the docs here:
>>>
>>> https://tiddlywiki.com/#Using%20SVG
>>>
>>> Best wishes
>>>
>>> Jeremy
>>>
>>>
>>>
>>> On 15 Dec 2020, at 01:41, Joshua Fontany  wrote:
>>>
>>> Interesting... I wonder if this is true for all SVGs or just the 
>>> core. The core image tiddlers are not actually "type:image/svg+xml", they 
>>> do not have a type value, and are interpreted as wiki-text when transcluded.
>>>
>>> Best,
>>> Joshua F
>>>
>>>
>>> On Wednesday, December 9, 2020 at 1:33:52 AM UTC-8 Mohammad wrote:
>>>
 I tried to use an svg as background. I realized I cannot use core svg 
 images. One reason may be the tiddler type or perhaps the removed xlmns.

 See below example at 

  .jack { background: url(<$macrocall $name="datauri" 
 title="Motovun Jack.jpg" $output="text/plain"/>); height: 300px; } 
  
  

 Now if I replcae  Motovun Jack.jpg with $:/core/images/close-button as 
 below

  .jack { background: url(<$macrocall $name="datauri" 
 title="Motovun Jack.jpg" $output="text/plain"/>); height: 300px; } 
  
   

 It does not work! 

 What is the reason?

 --Mohammad

>>>
>>> -- 
>>> 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+...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/tiddlywiki/4236b4d1-5bdc-4e9f-b418-5717ced3c4edn%40googlegroups.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+...@googlegroups.com.
>>
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/d54b15c9-9e1c-410d-bb7b-2f122b3ce11en%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/94fd44cd-74be-4516-82c2-41f99240f24fn%40googlegroups.com.


Re: [tw5] [Macro] datauri macro and svg images

2020-12-15 Thread Sylvain Naudin
OK,
It's frustrating because with TW's ability to modify itself, one could 
imagine just changing the colour of a fill element in the text field of the 
SVG tiddler ;)

I guess I can find a workaround by doing a macro to completely change the 
text field of my tiddler.

(Can $action-setfield be used to write the content of one tiddler from 
another? So I can manipulate the content of one with the macro color and 
have a button to apply the change to the favicon ?).

Le mardi 15 décembre 2020 à 12:52:39 UTC+1, Jeremy Ruston a écrit :

> Hi Sylvain
>
> Would it still be possible to make this evolve in the future (and consider 
> the favicon as a core image therefore and not an SVG XML image)?
>
>
> This isn’t a TiddlyWiki thing, this is how SVG is handled by browsers. The 
> browser requires a full SVG image for the favicon. Remember that inline 
> SVGs are actually HTML, and are not supported by favicons.
>
>
> Best wishes
>
> Jeremy
>
>
> (and play with fill="#fa4d60").
>
> Sylvain
>
> Le mardi 15 décembre 2020 à 11:55:31 UTC+1, Jeremy Ruston a écrit :
>
>> Hi Mohammad, Joshua
>>
>> This is the old chestnut of the confusing fact that there are two 
>> distinct types of SVG images, and they behave differently, and are defined 
>> differently. The core images are actually SVG elements designed to be 
>> transcluded directly into HTML documents; that’s what enables us to 
>> recolour these images with CSS. Full SVG images are XML documents with an 
>> embedded SVG element containing the image. They are displayed with the img 
>> tag, or as here, via CSS properties. It is not possible to use an SVG 
>> fragment as an image is the crucial thing.
>>
>> We try to explain it in the docs here:
>>
>> https://tiddlywiki.com/#Using%20SVG
>>
>> Best wishes
>>
>> Jeremy
>>
>>
>>
>> On 15 Dec 2020, at 01:41, Joshua Fontany  wrote:
>>
>> Interesting... I wonder if this is true for all SVGs or just the 
>> core. The core image tiddlers are not actually "type:image/svg+xml", they 
>> do not have a type value, and are interpreted as wiki-text when transcluded.
>>
>> Best,
>> Joshua F
>>
>>
>> On Wednesday, December 9, 2020 at 1:33:52 AM UTC-8 Mohammad wrote:
>>
>>> I tried to use an svg as background. I realized I cannot use core svg 
>>> images. One reason may be the tiddler type or perhaps the removed xlmns.
>>>
>>> See below example at 
>>>
>>>  .jack { background: url(<$macrocall $name="datauri" 
>>> title="Motovun Jack.jpg" $output="text/plain"/>); height: 300px; }  
>>>  
>>>
>>> Now if I replcae  Motovun Jack.jpg with $:/core/images/close-button as 
>>> below
>>>
>>>  .jack { background: url(<$macrocall $name="datauri" 
>>> title="Motovun Jack.jpg" $output="text/plain"/>); height: 300px; }  
>>>   
>>>
>>> It does not work! 
>>>
>>> What is the reason?
>>>
>>> --Mohammad
>>>
>>
>> -- 
>> 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+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/4236b4d1-5bdc-4e9f-b418-5717ced3c4edn%40googlegroups.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+...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/d54b15c9-9e1c-410d-bb7b-2f122b3ce11en%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d2b82e7f-b6cc-4646-9726-392b41cc7a37n%40googlegroups.com.


Re: [tw5] [Macro] datauri macro and svg images

2020-12-15 Thread Jeremy Ruston
Hi Sylvain

> Would it still be possible to make this evolve in the future (and consider 
> the favicon as a core image therefore and not an SVG XML image)?

This isn’t a TiddlyWiki thing, this is how SVG is handled by browsers. The 
browser requires a full SVG image for the favicon. Remember that inline SVGs 
are actually HTML, and are not supported by favicons.


Best wishes

Jeremy


> (and play with fill="#fa4d60").
> 
> Sylvain
> 
> Le mardi 15 décembre 2020 à 11:55:31 UTC+1, Jeremy Ruston a écrit :
> Hi Mohammad, Joshua
> 
> This is the old chestnut of the confusing fact that there are two distinct 
> types of SVG images, and they behave differently, and are defined 
> differently. The core images are actually SVG elements designed to be 
> transcluded directly into HTML documents; that’s what enables us to recolour 
> these images with CSS. Full SVG images are XML documents with an embedded SVG 
> element containing the image. They are displayed with the img tag, or as 
> here, via CSS properties. It is not possible to use an SVG fragment as an 
> image is the crucial thing.
> 
> We try to explain it in the docs here:
> 
> https://tiddlywiki.com/#Using%20SVG 
> 
> Best wishes
> 
> Jeremy
> 
> 
> 
> 
>> On 15 Dec 2020, at 01:41, Joshua Fontany > > wrote:
>> 
> 
>> Interesting... I wonder if this is true for all SVGs or just the core. The 
>> core image tiddlers are not actually "type:image/svg+xml", they do not have 
>> a type value, and are interpreted as wiki-text when transcluded.
>> 
>> Best,
>> Joshua F
>> 
>> 
>> On Wednesday, December 9, 2020 at 1:33:52 AM UTC-8 Mohammad wrote:
>> I tried to use an svg as background. I realized I cannot use core svg 
>> images. One reason may be the tiddler type or perhaps the removed xlmns.
>> 
>> See below example at 
>> 
>>  .jack { background: url(<$macrocall $name="datauri" title="Motovun 
>> Jack.jpg" $output="text/plain"/>); height: 300px; }  > class="jack"/> 
>> 
>> Now if I replcae  Motovun Jack.jpg with $:/core/images/close-button as below
>> 
>>  .jack { background: url(<$macrocall $name="datauri" title="Motovun 
>> Jack.jpg" $output="text/plain"/>); height: 300px; }  > class="jack"/>  
>> 
>> It does not work! 
>> 
>> What is the reason?
>> 
>> --Mohammad
>> 
> 
>> -- 
>> 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+...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/4236b4d1-5bdc-4e9f-b418-5717ced3c4edn%40googlegroups.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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/d54b15c9-9e1c-410d-bb7b-2f122b3ce11en%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/91117CCC-F3D1-4DBB-A335-465F1E62AE4E%40gmail.com.


Re: [tw5] [Macro] datauri macro and svg images

2020-12-15 Thread Sylvain Naudin
Hi,

This is exactly the thread I wanted to search for yesterday when Google 
broke down ^^'

I wanted to add a setting to my SVG logo used as $:/favicon.ico


Unless I made a mistake, I have to fix it with the SVG document type, so I 
can't insert the macro <> to reference the colour of my palette.

Would it still be possible to make this evolve in the future (and consider 
the favicon as a core image therefore and not an SVG XML image)?
(and play with fill="#fa4d60").

Sylvain

Le mardi 15 décembre 2020 à 11:55:31 UTC+1, Jeremy Ruston a écrit :

> Hi Mohammad, Joshua
>
> This is the old chestnut of the confusing fact that there are two distinct 
> types of SVG images, and they behave differently, and are defined 
> differently. The core images are actually SVG elements designed to be 
> transcluded directly into HTML documents; that’s what enables us to 
> recolour these images with CSS. Full SVG images are XML documents with an 
> embedded SVG element containing the image. They are displayed with the img 
> tag, or as here, via CSS properties. It is not possible to use an SVG 
> fragment as an image is the crucial thing.
>
> We try to explain it in the docs here:
>
> https://tiddlywiki.com/#Using%20SVG
>
> Best wishes
>
> Jeremy
>
>
>
> On 15 Dec 2020, at 01:41, Joshua Fontany  wrote:
>
> Interesting... I wonder if this is true for all SVGs or just the core. The 
> core image tiddlers are not actually "type:image/svg+xml", they do not have 
> a type value, and are interpreted as wiki-text when transcluded.
>
> Best,
> Joshua F
>
>
> On Wednesday, December 9, 2020 at 1:33:52 AM UTC-8 Mohammad wrote:
>
>> I tried to use an svg as background. I realized I cannot use core svg 
>> images. One reason may be the tiddler type or perhaps the removed xlmns.
>>
>> See below example at 
>>
>>  .jack { background: url(<$macrocall $name="datauri" 
>> title="Motovun Jack.jpg" $output="text/plain"/>); height: 300px; }  
>>  
>>
>> Now if I replcae  Motovun Jack.jpg with $:/core/images/close-button as 
>> below
>>
>>  .jack { background: url(<$macrocall $name="datauri" 
>> title="Motovun Jack.jpg" $output="text/plain"/>); height: 300px; }  
>>   
>>
>> It does not work! 
>>
>> What is the reason?
>>
>> --Mohammad
>>
>
> -- 
> 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+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/4236b4d1-5bdc-4e9f-b418-5717ced3c4edn%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d54b15c9-9e1c-410d-bb7b-2f122b3ce11en%40googlegroups.com.


Re: [tw5] [Macro] datauri macro and svg images

2020-12-15 Thread Jeremy Ruston
Hi Mohammad, Joshua

This is the old chestnut of the confusing fact that there are two distinct 
types of SVG images, and they behave differently, and are defined differently. 
The core images are actually SVG elements designed to be transcluded directly 
into HTML documents; that’s what enables us to recolour these images with CSS. 
Full SVG images are XML documents with an embedded SVG element containing the 
image. They are displayed with the img tag, or as here, via CSS properties. It 
is not possible to use an SVG fragment as an image is the crucial thing.

We try to explain it in the docs here:

https://tiddlywiki.com/#Using%20SVG

Best wishes

Jeremy



> On 15 Dec 2020, at 01:41, Joshua Fontany  wrote:
> 
> Interesting... I wonder if this is true for all SVGs or just the core. The 
> core image tiddlers are not actually "type:image/svg+xml", they do not have a 
> type value, and are interpreted as wiki-text when transcluded.
> 
> Best,
> Joshua F
> 
> 
> On Wednesday, December 9, 2020 at 1:33:52 AM UTC-8 Mohammad wrote:
> I tried to use an svg as background. I realized I cannot use core svg images. 
> One reason may be the tiddler type or perhaps the removed xlmns.
> 
> See below example at 
> 
>  .jack { background: url(<$macrocall $name="datauri" title="Motovun 
> Jack.jpg" $output="text/plain"/>); height: 300px; }   class="jack"/> 
> 
> Now if I replcae  Motovun Jack.jpg with $:/core/images/close-button as below
> 
>  .jack { background: url(<$macrocall $name="datauri" title="Motovun 
> Jack.jpg" $output="text/plain"/>); height: 300px; }   class="jack"/>  
> 
> It does not work! 
> 
> What is the reason?
> 
> --Mohammad
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/4236b4d1-5bdc-4e9f-b418-5717ced3c4edn%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/45FF2BE7-A6CF-4DA0-9C82-BF70C6BCBECA%40gmail.com.


[tw5] [Macro] datauri macro and svg images

2020-12-09 Thread Mohammad
I tried to use an svg as background. I realized I cannot use core svg 
images. One reason may be the tiddler type or perhaps the removed xlmns.

See below example at 

 .jack { background: url(<$macrocall $name="datauri" title="Motovun 
Jack.jpg" $output="text/plain"/>); height: 300px; }   

Now if I replcae  Motovun Jack.jpg with $:/core/images/close-button as below

 .jack { background: url(<$macrocall $name="datauri" title="Motovun 
Jack.jpg" $output="text/plain"/>); height: 300px; }

It does not work! 

What is the reason?

--Mohammad

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4a6d7aa1-0e97-4cd0-a4b5-9663dabe5d2cn%40googlegroups.com.