[publican-list] Partial URL Entity Expansion in ulink?

Jeff Fearn jfearn at redhat.com
Wed Apr 10 23:05:07 UTC 2013


Hi Adam, which version of Publican?

On 04/11/2013 08:14 AM, AdamD. wrote:
> I've looked around the internet for examples of using expanded entities as
> ulink URLs, but in all the instances I've found they use the entire link,
> such as:
>
> <!ENTITIY myurl "http://www.thisismy.com/url"> or, the entire <ulink> tag
> structure as the entity.
>
> What I'm looking to do is use an entity to represent just part of a URL,
> leading up to the final file. I'm trying to put links to files distributed
> via HTTP, and while the filenames should remain fairly constant the DNS
> name/HTTP link of the URL may change names, and not having to go update
> individual URLs all through a document would be a huge time-saver.

Relative links aren't realistic?

> What seems to work when locally built (HTML, PDF, etc. on local machine) is
> putting the entity in the .ent file like <!ENTITY MYURL "
> http://docs.mysite.com/itfiles/tutorial"> and the ulink as:
>
> <ulink url="&MYURL;/awesomefile.txt">file</ulink>
>
> This correctly generates the URL to the external site in the PDF, HTML,
> etc. However, when this is packaged as an RPM and deployed on the
> documentation site, it makes the final URL as displayed  "
> http://docs.mysite.com/awesomefile.txt" instead of pointing to the correct
> external link (which happens to be on the same server, just a different
> URL).
>
> I saw a post about using correct XML, and putting the entity as
> "&MYURL;", but this just makes the URL"
> http://docs.mysite.com/&MYURL/awesomefile.txt" without expanding the
> entity, taking the literal text.
>
> Is there a proper way to do this, if at all?
>
> Thanks in advance.

You could try having all the data for the URL in the ent file.

<!ENTITY SITE "http://docs.mysite.com/docs/etc">
<!ENTITY AWESOME "&SITE;/awesomefile.txt">

<ulink url="&AWESOME;">file</ulink>


Cheers, Jeff.

-- 
Jeff Fearn <jfearn at redhat.com>
Senior Software Engineer
Infrastructure Engineering & Development (AEU)
Red Hat Asia Pacific Pty Ltd
GPG: 0x0357E8F0




More information about the publican-list mailing list