Ability to render HTML page fragment

Bug #822121 reported by Thomi Richards
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
loggerhead
Triaged
Low
Unassigned
loggerhead-breezy
Triaged
Low
Unassigned
sloecode
New
Undecided
Unassigned

Bug Description

It would be nice to have some sort of API in loggerhead to control exactly which parts of the HTML page is rendered.

Currently it's not easy to integrate loggerhead with a second WSGI app - requests must be either fully served by loggerhead or by the original app, which removes the possibility of showing loggerhead-generated content inside a second WSGI application.

If there was some form of API inside loggerhead so I could effectively say "Here's a branch, render this view (changelog, for e.g.) to HTML, with this path prefix, and give me the results" it would be trivial to integrate loggerhead with other web-apps in a sane manner.

Unfortunately, after having poked around in the loggerhead source, i can't see a trivial way to get this done.

Revision history for this message
Данило Шеган (danilo) wrote :

I am not familiar with loggerhead code enough (I mostly hack on Launchpad), but could you not have your app fetch data from loggerhead and then just extract the <body> contents? Then you could run loggerhead as strictly the internal service that your app would talk to.

Gary Poster (gary)
Changed in loggerhead:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote : Re: [Bug 822121] Re: Ability to render HTML page fragment

Hi,

On 8 August 2011 22:35, Данило Шеган <email address hidden> wrote:
> I am not familiar with loggerhead code enough (I mostly hack on
> Launchpad), but could you not have your app fetch data from loggerhead
> and then just extract the <body> contents? Then you could run loggerhead
> as strictly the internal service that your app would talk to.
>

Yes, we could send requests into loggerhead, and then parse the
returned HTML, strip out the unwanted parts, and then wrap that inside
our own HTML. However, I consider that approach rather cludgy, and
prone to breakage. I think a better way is to break up the loggerhead
templates into fragments, and allow control overwhich fragments are
rendered - perhaps with a parallel API to the main WSGI interface.

--
Thomi Richards

Jelmer Vernooij (jelmer)
Changed in loggerhead-breezy:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.