Rendering html-files from svn-repo and linking to them

85 views
Skip to first unread message

Gregor Dschung

unread,
Sep 1, 2008, 8:00:15 AM9/1/08
to trac-...@googlegroups.com
Hi,

I'm in the following situation: In my repository, there are a few
HTML-files. In the wiki, I want to refer to them (including anchors). If
I follow the link , the content itself should be rendered and not the
html source code. E.g., if I write

source:html/index.html

and follow the link, it will be opened in the trac-browser, but not
rendered. A value behind a # will be interpreted as the file-version...
and not used as an html-anchor.

Exists a solution for my issue? E.g. sth. like this:
render_source:html/index.html#start

Regards
Gregor

--
Gregor Dschung
System Life Guard, HiWi

Fraunhofer-Institut für Techno-
und Wirtschaftsmathematik ITWM
Fraunhofer-Platz 1
D-67663 Kaiserslautern

E-Mail: gregor....@itwm.fraunhofer.de
Internet: www.itwm.fraunhofer.de

Noah Kantrowitz

unread,
Sep 1, 2008, 12:10:45 PM9/1/08
to trac-...@googlegroups.com
Gregor Dschung wrote:
> Hi,
>
> I'm in the following situation: In my repository, there are a few
> HTML-files. In the wiki, I want to refer to them (including anchors). If
> I follow the link , the content itself should be rendered and not the
> html source code. E.g., if I write
>
> source:html/index.html
>
> and follow the link, it will be opened in the trac-browser, but not
> rendered. A value behind a # will be interpreted as the file-version...
> and not used as an html-anchor.
>
> Exists a solution for my issue? E.g. sth. like this:
> render_source:html/index.html#start
>

The /export handler and the export: link type. Requires 0.11.

--Noah

signature.asc

Gregor Dschung

unread,
Sep 3, 2008, 7:03:02 AM9/3/08
to trac-...@googlegroups.com
Hi Noah,

could you give me an example, please? I can't find s.th. on the website
related to export-handler or link type.

Thanks,
Gregor

Erik Andersson

unread,
Sep 4, 2008, 7:01:23 AM9/4/08
to trac-...@googlegroups.com
Hi

See http://trac.edgewall.org/wiki/TracLinks#export:links

Not sure though in which rev of 0.11 this was implemented.

Cheers / Erik

Christian Boos

unread,
Sep 4, 2008, 7:32:46 AM9/4/08
to trac-...@googlegroups.com
Erik Andersson wrote:
> Hi
>
> See http://trac.edgewall.org/wiki/TracLinks#export:links
>
> Not sure though in which rev of 0.11 this was implemented.

Very early 0.11dev, and it has been backported to 0.10.5 (see
http://trac.edgewall.org/ticket/5295).

-- Christian

Gregor Dschung

unread,
Sep 7, 2008, 1:45:20 PM9/7/08
to trac-...@googlegroups.com
Hi

it works! Thanks... didn't think it would be so easy.

But one issue seems to remain open: My browser wants to download the
.html-file. Sure, I can open the file with e.g. firefox, but then the
url looks like file:///tmp/... Therefor, the html-file is not beeing
rendered, because of missing css-files, images, etc.

On trac.edgewall.org, there is written "This can be very useful for
displaying HTML documentation with correct stylesheets and images, in
case that has been checked in the repository." ... so it seems, the
failure is on my side.

Thanks,

-Gregor

Erik Andersson wrote:
> Hi
>
> See http://trac.edgewall.org/wiki/TracLinks#export:links
>
> Not sure though in which rev of 0.11 this was implemented.
>
> Cheers / Erik
>
> On Wed, Sep 3, 2008 at 1:03 PM, Gregor Dschung
> <gregor....@itwm.fraunhofer.de

> <mailto:gregor....@itwm.fraunhofer.de>> wrote:
>
>
> Noah Kantrowitz wrote:
> > Gregor Dschung wrote:
> >
> >> Hi,
> >>
> >> I'm in the following situation: In my repository, there are a few
> >> HTML-files. In the wiki, I want to refer to them (including
> anchors). If
> >> I follow the link , the content itself should be rendered and
> not the
> >> html source code. E.g., if I write
> >>
> >> source:html/index.html
> >>
> >> and follow the link, it will be opened in the trac-browser, but not
> >> rendered. A value behind a # will be interpreted as the
> file-version...
> >> and not used as an html-anchor.
> >>
> >> Exists a solution for my issue? E.g. sth. like this:
> >> render_source:html/index.html#start
> >>
> >>
> >
> > The /export handler and the export: link type. Requires 0.11.
> >
> > --Noah
> >
> Hi Noah,
>
> could you give me an example, please? I can't find s.th

> <http://s.th>. on the website

Noah Kantrowitz

unread,
Sep 7, 2008, 2:46:45 PM9/7/08
to trac-...@googlegroups.com
On Sep 7, 2008, at 10:45 AM, Gregor Dschung wrote:

>
> Hi
>
> it works! Thanks... didn't think it would be so easy.
>
> But one issue seems to remain open: My browser wants to download the
> .html-file. Sure, I can open the file with e.g. firefox, but then the
> url looks like file:///tmp/... Therefor, the html-file is not beeing
> rendered, because of missing css-files, images, etc.
>
> On trac.edgewall.org, there is written "This can be very useful for
> displaying HTML documentation with correct stylesheets and images, in
> case that has been checked in the repository." ... so it seems, the
> failure is on my side.

No, this is a security concern. Allowing un-filtered HTML files to
execute in the context of the Trac site represents a security risk
(bad JavaScript, etc). You can use the "View" option to display the
file (though it will not be in the URL context of the Trac site).

--Noah

Gregor Dschung

unread,
Sep 8, 2008, 8:29:09 AM9/8/08
to trac-...@googlegroups.com
Noah Kantrowitz wrote:
> No, this is a security concern. Allowing un-filtered HTML files to
> execute in the context of the Trac site represents a security risk
> (bad JavaScript, etc). You can use the "View" option to display the
> file (though it will not be in the URL context of the Trac site).
>
> --Noah
>
Which "view" option? ... In trac.ini ?

Cheers,
Gregor


Noah Kantrowitz

unread,
Sep 8, 2008, 4:18:42 PM9/8/08
to trac-...@googlegroups.com
No, on your browsers download dialog.

--Noah

rupert thurner

unread,
Sep 9, 2008, 1:40:08 PM9/9/08
to Trac Users
has there not been an option to switch off/on this behaviour?
> >   Gregor- Hide quoted text -
>
> - Show quoted text -

Noah Kantrowitz

unread,
Sep 9, 2008, 1:43:56 PM9/9/08
to trac-...@googlegroups.com
Not that I know of. render_unsafe_content controls some related things, but
not the download flags IIRC.

--Noah

> -----Original Message-----
> From: trac-...@googlegroups.com [mailto:trac-...@googlegroups.com]
> On Behalf Of rupert thurner
> Sent: Tuesday, September 09, 2008 10:40 AM
> To: Trac Users
> Subject: [Trac] Re: Rendering html-files from svn-repo and linking to
> them
>
>
Reply all
Reply to author
Forward
0 new messages