ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* URL hyperlinks
@ 2002-03-09 13:27 Michael Wiedmann
  2002-03-09 15:40 ` Berend de Boer
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Wiedmann @ 2002-03-09 13:27 UTC (permalink / raw)


How do I generate hyperlinks for URLs in PDF output?

Michael
-- 
mw@miwie.in-berlin.de                              http://www.miwie.org
mw@miwie.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: URL hyperlinks
  2002-03-09 13:27 URL hyperlinks Michael Wiedmann
@ 2002-03-09 15:40 ` Berend de Boer
  2002-03-10 16:17   ` Michael Wiedmann
  0 siblings, 1 reply; 6+ messages in thread
From: Berend de Boer @ 2002-03-09 15:40 UTC (permalink / raw)
  Cc: NTG ConTeXt

Michael Wiedmann <mw@miwie.in-berlin.de> writes:

> How do I generate hyperlinks for URLs in PDF output?

For example like this:

\useURL
  [context]
  [http://www.pragma-ade.com]

And don't forget to

\setupinteraction
  [state=start]

start the interactive mode.

-- 
Groetjes,

Berend. (-:


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: URL hyperlinks
  2002-03-09 15:40 ` Berend de Boer
@ 2002-03-10 16:17   ` Michael Wiedmann
  2002-03-11  7:04     ` Berend de Boer
  2002-03-11 21:33     ` Hans Hagen
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Wiedmann @ 2002-03-10 16:17 UTC (permalink / raw)
  Cc: NTG ConTeXt

* Berend de Boer <berend@pobox.com> [020309 16:40]:

> \useURL
>   [context]
>   [http://www.pragma-ade.com]

I got the general idea, but can't get the following peace of code do
what I want (surely due to my poor TeX/ConTeXt knowledge):

- given a peace of XML like:

  <ulink url="http://www.somewhere.net">some site</ulink>

- I want to map this XML to ConText hyperlinks like:

  \def\makeulink#1{%
    \useURL[one][\XMLpar{ulink}{url}{}]%
    \goto{#1}[URL(one)]}
  \defineXMLcommand[ulink] \makeulink

Two unsolved issues remain:

- only the first character of the XML element text ("s") is taken as the
  hyperlink text

- given the fact, that there might be many <ulink>s, do I need unique
  names for \useURL ("one" in the example) or can I reuse the same name
  for all instances?

Michael
-- 
mw@miwie.in-berlin.de                              http://www.miwie.org
mw@miwie.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: URL hyperlinks
  2002-03-10 16:17   ` Michael Wiedmann
@ 2002-03-11  7:04     ` Berend de Boer
  2002-03-11 19:04       ` Michael Wiedmann
  2002-03-11 21:33     ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: Berend de Boer @ 2002-03-11  7:04 UTC (permalink / raw)
  Cc: NTG ConTeXt

Michael Wiedmann <mw@miwie.in-berlin.de> writes:

> I got the general idea, but can't get the following peace of code do
> what I want (surely due to my poor TeX/ConTeXt knowledge):
> 
> - given a peace of XML like:
> 
>   <ulink url="http://www.somewhere.net">some site</ulink>
> 
> - I want to map this XML to ConText hyperlinks like:
> 
>   \def\makeulink#1{%
>     \useURL[one][\XMLpar{ulink}{url}{}]%
>     \goto{#1}[URL(one)]}
>   \defineXMLcommand[ulink] \makeulink

I suppose \goto can take a url directoryl, so you don't have to use
\useURL. Have you tried this?

> - only the first character of the XML element text ("s") is taken as the
>   hyperlink text

\useURL has four commands:

\useURL
  [ufdhc]
  [http://www.eiffel-forum.org/archive/dominicu/fdh.htm]
  []
  [Unix File/Directory Handling Cluster]

The 4th is the replacement text, so you get the text, and not the
URL. If the 4th is not provided, you just get the url.

-- 
Groetjes,

Berend. (-:


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: URL hyperlinks
  2002-03-11  7:04     ` Berend de Boer
@ 2002-03-11 19:04       ` Michael Wiedmann
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Wiedmann @ 2002-03-11 19:04 UTC (permalink / raw)
  Cc: NTG ConTeXt

* Berend de Boer <berend@pobox.com> [020311 08:04]:

> I suppose \goto can take a url directoryl, so you don't have to use
> \useURL. Have you tried this?

It does not work, I have to use \useURL. 
Multiple instances of the same label for \useURL seem to work, at least 
I did not get any errors in processing a document containing many <ulink>s.

> > - only the first character of the XML element text ("s") is taken as the
> >   hyperlink text

The probem was

\defineXMLcommand[ulink] \makeulink

it has to be

\defineXMLargument[ulink] \makeulink

Thanks
Michael
-- 
mw@miwie.in-berlin.de                              http://www.miwie.org
mw@miwie.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: URL hyperlinks
  2002-03-10 16:17   ` Michael Wiedmann
  2002-03-11  7:04     ` Berend de Boer
@ 2002-03-11 21:33     ` Hans Hagen
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2002-03-11 21:33 UTC (permalink / raw)
  Cc: NTG ConTeXt

At 05:17 PM 3/10/2002 +0100, Michael Wiedmann wrote:

>   <ulink url="http://www.somewhere.net">some site</ulink>
>
>- I want to map this XML to ConText hyperlinks like:
>
>   \def\makeulink#1{%
>     \useURL[one][\XMLpar{ulink}{url}{}]%
>     \goto{#1}[URL(one)]}
>   \defineXMLcommand[ulink] \makeulink

you need \defineXMLargument here

also, make sure to create a namespace, so \SOMETHINGmakeulink or so

you can reuse the symbolic name, and in case of temp ones, use [dummy]

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-03-11 21:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-09 13:27 URL hyperlinks Michael Wiedmann
2002-03-09 15:40 ` Berend de Boer
2002-03-10 16:17   ` Michael Wiedmann
2002-03-11  7:04     ` Berend de Boer
2002-03-11 19:04       ` Michael Wiedmann
2002-03-11 21:33     ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).