alexmorozov / templated-docs

Generate PDF, MS Word and Excel documents from templates in Django
MIT License
114 stars 57 forks source link

Feature: hyperlinks #10

Open alexmorozov opened 7 years ago

alexmorozov commented 7 years ago

We should be able to make a certain part of a document a hyperlink. At the first glance, a custom template tag will suffice:

{% hyperlink 'http://site.com' %}
here goes a part of a document
{% endhyperlink %}
vasjapavlovic commented 7 years ago

In microsoft access query you do something like: {{ foo }} & "#" & {{ bar }} & "#" where hyperlink is defined between "#" characters. For me the question is how is hyperlink defined in ".odt" file so maybe it is possible to prepare custom context data with hyperlink allready attached.

alexmorozov commented 7 years ago

I've created a test document, and a simple text link looks like this:

<text:a xlink:href="http://site.ru" office:target-frame-name="_top" xlink:show="replace">
... link inner contents ...
</text:a>

So I think you could try use this tag.