* Re: Encoding reserved characters in URI query strings
2017-02-05 17:09 ` Aditya Mahajan
@ 2017-02-05 17:22 ` Rogers, Michael K
2017-02-07 12:24 ` Bibliography Jean-Pierre Delange
1 sibling, 0 replies; 5+ messages in thread
From: Rogers, Michael K @ 2017-02-05 17:22 UTC (permalink / raw)
To: mailing list for ConTeXt users
> On Feb 5, 2017, at 12:09 PM, Aditya Mahajan <adityam@umich.edu> wrote:
>
> On Sun, 5 Feb 2017, Rogers, Michael K wrote:
>
>> Let's say I want a link to plot x+2 in Wolfram|Alpha. I need to catenate "http://www.wolframalpha.com/input/?i=" and "plot+x%2B2". Is there any way already available in ConTeXt to translate reserved characters like "+" to the percent-hexcode "%2B"?
>>
>> Something like
>>
>> \encode[plot x+2]
>>
>> would become
>>
>> plot+x%2B2
>>
>> Or more generally, some languages have a query constructor like this
>>
>> \queryURI
>> [http://www.wolframalpha.com/input]
>> [i=plot x+2]
>>
>> which would construct the URI
>>
>> http://www.wolframalpha.com/input/?i=plot+x%2B2
>>
>> I could write my own, of course. But no need to reinvent the wheel.
>
> url.escape does exactly that.
>
> \startluacode
> local base="http://www.wolframalpha.com/input"
> local query="i=plot x+2"
> local fullname = base .. query
> print(url.escape(fullname))
> \stopluacode
>
> gives
>
> http%3A//www.wolframalpha.com/inputi%3Dplot%20x%2B2
>
> Also look at l-url.lua for other helper functions for parsing and escaping/unescaping urls.
>
> Aditya
Thanks! I figured there must be a function like that.
Michael
________________________________
This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.
If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Bibliography
2017-02-05 17:09 ` Aditya Mahajan
2017-02-05 17:22 ` Rogers, Michael K
@ 2017-02-07 12:24 ` Jean-Pierre Delange
2017-02-07 15:12 ` Bibliography Alan Braslau
1 sibling, 1 reply; 5+ messages in thread
From: Jean-Pierre Delange @ 2017-02-07 12:24 UTC (permalink / raw)
To: mailing list for ConTeXt users
Dear list,
Thanks to the list and to Hans and Alan's manual "mkiv-publications", I has achieved some footnotes with bibliographical dataset. All is fine and I success to manage what I want.
But I don't understand why the word 'Author' is printed at the end of each line as the following minimal sample below shows it, e.g. :
Aristote (n.d.). Les Politiques. Author.
Cicéron (n.d.). Tusculanes, V, 8. Author.
(see the sample's printed page 2)
Is there a question of language (english), or anything else ? How to avoid this 'Author' ? I use the APA style with \usebtxdefinitions, and maybe one can use some other style ?
Anyway, many thanks for your help !
JP
\startbuffer[biblio]
@book{Cicéron1,
author = {Cicéron},
title = {Tusculanes, V, 8},
}
@book{Aristote2,
author = {Aristote},
title = {Les Politiques},
}
\stopbuffer
\usebtxdataset[philosophie ancienne][biblio.buffer]
\usebtxdefinitions[apa]
\definebtxrendering[philosophie ancienne][apa][dataset=philosophie ancienne]
\setupbtxrendering[continue =yes]
\starttext
\startchapter[title={Introduction à la Philosophie}]
Dans les notes qui suivent, on s’intéressera à la pensée philosophique comme philosophie politique. Aristote, le philosophe grec qui publia et commenta les Constitutions des anciennes cités grecques, commence son ouvrage {\it les Politiques} par la thèse selon laquelle \quotation {l’homme est un animal politique}\footnote{\cite[alternative=entry][philosophie ancienne::Aristote2]}.
\blank
Cicéron, ce grand homme politique et cet écrivain savant, a eu la formule bien connue, selon laquelle \quotation{Socrate fit descendre la philosophie du ciel sur la terre.}\footnote{\cite[alternative=entry][philosophie ancienne::Cicéron1]}, qui désigne la question fondamentale de l’intérêt nourri par la philosophie pour les {\it choses humaines}.
\stopchapter
\starttext
\startbackmatter
\startchapter[title={Bibliographie}]
\startsection[title={Philosophie ancienne}]
\placelistofpublications[philosophie ancienne][method=local]
\stopsection
\stopchapter
\stopbackmatter
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread