[tw] Re: [TW5] Local macro doesn't work with <$maketid> widget

2014-09-23 Thread 'c pa' via TiddlyWiki
Tomas. You can't set variables and use them in the same code block.

Try This it worked for me. You can see it on 
http://cpashow.tiddlyspot.com/#Tomas

\define tituloPaper(autor:"Anónimo",titulo:"No se sabe")
$autor$: "$titulo$"
\end
\define missingdefine()
<$maketid  title="$(au)$ $(ti)$"tags="paper referencia" 
template="PaperSkeleton" edit="yes"><$button 
message="tw-new-tiddler">Agregar paper
\end

The input fields:

|>|!Título |<$edit-text tiddler="$:/temp/paper" field="titulo" 
placeholder="Título de la publicación" size="60"/>|
|>|!Autor |<$edit-text tiddler="$:/temp/paper" field="autor" 
placeholder="Autor de la publicación"  size="60"/>|


The button that creates the tiddler with the article information:

<$set name="au" value={{$:/temp/paper!!autor}}>
<$set name="ti" value={{$:/temp/paper!!titulo}}>
<>


This is a test of the macro that works:
<>

A button to clean de temp tiddler fields:

<$set tiddler="$:/temp/paper" set="!!titulo" setTo="">
<$set tiddler="$:/temp/paper" set="!!autor" setTo="">
<$button message="tw-set-field" param="SetField Target">Limpiar


-- 
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.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Local macro doesn't work with <$maketid> widget

2014-09-23 Thread Tomás Iglesias
Thanks it worked!

The final macro is:

\define missingdefine()
<$maketid  title="""$(au)$: "$(ti)$" """ tags="paper referencia" 
template="PaperSkeleton" edit="yes"><$button 
message="tw-new-tiddler">Agregar paper
\end

so the title can have the 'Someone et al (2014): "Something we 
investigated" ' format.

Thanks again!

Tomás

El martes, 23 de septiembre de 2014 20:07:06 UTC-3, c pa escribió:
>
> Tomas. You can't set variables and use them in the same code block.
>
> Try This it worked for me. You can see it on 
> http://cpashow.tiddlyspot.com/#Tomas
>
> \define tituloPaper(autor:"Anónimo",titulo:"No se sabe")
> $autor$: "$titulo$"
> \end
> \define missingdefine()
> <$maketid  title="$(au)$ $(ti)$"tags="paper referencia" 
> template="PaperSkeleton" edit="yes"><$button 
> message="tw-new-tiddler">Agregar paper
> \end
>
> The input fields:
>
> |>|!Título |<$edit-text tiddler="$:/temp/paper" field="titulo" 
> placeholder="Título de la publicación" size="60"/>|
> |>|!Autor |<$edit-text tiddler="$:/temp/paper" field="autor" 
> placeholder="Autor de la publicación"  size="60"/>|
>
>
> The button that creates the tiddler with the article information:
>
> <$set name="au" value={{$:/temp/paper!!autor}}>
> <$set name="ti" value={{$:/temp/paper!!titulo}}>
> <>
> 
>
> This is a test of the macro that works:
> <>
>
> A button to clean de temp tiddler fields:
>
> <$set tiddler="$:/temp/paper" set="!!titulo" setTo="">
> <$set tiddler="$:/temp/paper" set="!!autor" setTo="">
> <$button message="tw-set-field" param="SetField Target">Limpiar
> 
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Local macro doesn't work with <$maketid> widget

2014-09-23 Thread Stephan Hradek
Why do you set the variables "au" and "ti" and don't use it in your 
tituloPaper macro? It should work. 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Local macro doesn't work with <$maketid> widget

2014-09-24 Thread Tomás Iglesias
Do'h!

It's been years since my first and only course on programming on Java, and 
I don't know anything about HTML so I didn't knew that I was defining a 
variable (now it seems so obvius). So, maybe this is a silly question, but 
when you use the <$set name="" value="">your are just 
defining a variable? Is this variable available to all 
macros/widgets/tiddlers in the current TW?



El miércoles, 24 de septiembre de 2014 03:44:27 UTC-3, Stephan Hradek 
escribió:
>
> Why do you set the variables "au" and "ti" and don't use it in your 
> tituloPaper macro? It should work. 
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Local macro doesn't work with <$maketid> widget

2014-09-24 Thread PMario
Hi Tomás,

On Wednesday, September 24, 2014 4:00:58 PM UTC+2, Tomás Iglesias wrote:
>
> It's been years since my first and only course on programming on Java,
>
and I don't know anything about HTML so I didn't knew that I was defining a 
> variable (now it seems so obvius).
>
 
TiddlyWiki can use plain HTML tags [1] like text test  .. 
which creates an ordered list with one list element. 

and it can combine it with TW5 specific widgets [2]. eg: <$set>  
  So if you use the set widget in a standard HTML page it won't 
work. Widgets need TiddlyWiki to create there magic :)

So, maybe this is a silly question, but when you use the <$set name="" 
> value="">your are just defining a variable? Is this variable 
> available to all macros/widgets/tiddlers in the current TW?
>

<$set name="" value="">  ..context..
The variable is only visible between the start and the end marker. I did 
name it ..context.. here.

-mario

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element  ... This is 
a good source for everything web related 
[2] http://tiddlywiki.com/#Widgets






-- 
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.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Local macro doesn't work with <$maketid> widget

2014-09-24 Thread Stephan Hradek


Am Mittwoch, 24. September 2014 17:19:01 UTC+2 schrieb PMario:
>
> <$set name="" value="">  ..context..
> The variable is only visible between the start and the end marker. I did 
> name it ..context.. here.
>

Please also note that in

\define macro()
…here…
\end
<$set name="" value="">  …context…<>…context…


the variables are also visible in the macro as it was called in the 
context. So it does not have lexical- but dynamic-scope 

.


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] Local macro doesn't work with <$maketid> widget

2014-09-24 Thread Tomás Iglesias
PMario,

Thanks for the links! They are going to the reference tiddler right now.
There are lots of things to learn.

Stephan,

The concepts of context and scope are new to me, and the Wikipedia link is
really useful to understand them well.

The work in the last month learning Latex, Git and now with TW (and R in
October) are time-comsuming because there is a lot of reading and trial and
error involved, but it's so fun! At least it's not lost time because you
end up with quite a few tools that can help you in the future.

Thanks to all!

Tomás

2014-09-24 15:19 GMT-03:00 Stephan Hradek :

>
>
> Am Mittwoch, 24. September 2014 17:19:01 UTC+2 schrieb PMario:
>>
>> <$set name="" value="">  ..context..
>> The variable is only visible between the start and the end marker. I did
>> name it ..context.. here.
>>
>
> Please also note that in
>
> \define macro()
> …here…
> \end
> <$set name="" value="">  …context…<>…context…
>
>
> the variables are also visible in the macro as it was called in the
> context. So it does not have lexical- but dynamic-scope
> 
> .
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/MhJUz71sIcM/unsubscribe.
> To unsubscribe from this group and all its topics, 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.
> 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.
For more options, visit https://groups.google.com/d/optout.