From mercurial-bounces@selenic.com Wed Jul 13 12:47:34 2011 Return-Path: Delivered-To: unknown Received: from imap.cs.helsinki.fi (128.214.9.1:993) by bq.la.iki.fi with IMAP4-SSL; 13 Jul 2011 09:47:34 -0000 Delivered-To: lealanko@cs.helsinki.fi Received: from mail.waste.org (waste.org [66.93.16.53]) by mail.cs.helsinki.fi with esmtp; Sat, 06 Dec 2008 11:17:39 +0200 id 0008C17E.493A4336.00001A24 Received-SPF: none (Address does not pass the Sender Policy Framework) SPF=HELO; sender=mail.waste.org; remoteip=66.93.16.53; remotehost=waste.org; helo=mail.waste.org; receiver=mail.cs.helsinki.fi; Received: from waste.org (staticwaste [66.93.16.53]) by mail.waste.org (Postfix) with ESMTP id EED8D5C81A5; Sat, 6 Dec 2008 03:17:01 -0600 (CST) Received: from twin.jikos.cz (root@twin.jikos.cz [213.151.79.26]) by waste.org (8.13.8/8.13.8/Debian-3) with ESMTP id mB69HeYH007884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 6 Dec 2008 03:17:42 -0600 Received: from twin.jikos.cz (jen@twin [127.0.0.1]) by twin.jikos.cz (8.13.6/8.13.6) with ESMTP id mB69Gmes032351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 6 Dec 2008 10:16:49 +0100 Received: from localhost (jen@localhost) by twin.jikos.cz (8.13.6/8.13.6/Submit) with ESMTP id mB69GlLf032344 for ; Sat, 6 Dec 2008 10:16:47 +0100 X-Authentication-Warning: twin.jikos.cz: jen owned process doing -bs Date: Sat, 6 Dec 2008 10:16:47 +0100 (CET) From: Jan Capek To: mercurial@selenic.com Subject: Re: retrieve custom 'name:value' pairs in the [web] section, from the templates In-Reply-To: <5B7D565E-8D02-474A-8C1C-34A75925C80C@jupiter-jazz.com> Message-ID: References: <5B7D565E-8D02-474A-8C1C-34A75925C80C@jupiter-jazz.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_courier-6692-1228555067-0001-2" X-Virus-Scanned: by amavisd-new X-BeenThere: mercurial@selenic.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: mercurial-bounces@selenic.com Errors-To: mercurial-bounces@selenic.com X-Originating-ASN: AS29208 DIALTELECOM-AS Dial Telecom A.S., Bratislava X-Bogosity: No, tests=bogofilter, spamicity=0.00000015, version=2007-08-13 This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_courier-6692-1228555067-0001-2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On Fri, 5 Dec 2008, Paolo Berto wrote: > Hello, > > I'd like to add custom 'name:value' pairs in the [web] section of hgrc > files of my repos, eg: > > [web] > licensetype = BSD > > > And then retrieve this information from my hgwebdir template, is it > actually possible? What is the syntax to retrieve this properly, I > assume this should be done in index.tmpl & relative map file. > > Would this be correct? > > License Type > # index.tmpl > > {licensetype|license} # map > > > cheers, > Paolo Hi, this is not currently possible as far as I know. Somebody asked something similar a couple days ago. Below is my original post, showing how to add a new template. This was in mercurial 1.0.x, not sure if the interfaces are now changed allowing adding new template keywords. Cheers, Jan From jen@jikos.cz Tue Dec 2 09:06:31 2008 Date: Tue, 2 Dec 2008 09:05:31 +0100 (CET) From: Jan Capek To: Subject: Re: hgweb and templating > Matt Mackall wrote: > > It is possible to add my own keys to the map? > > I'm trying to add some common header stuff in a "headerend" template > like this: > > in my map file I have: > headerend = headerend.tmpl > > in summary.tmpl I have: > > #header# > #repo|escape#: Summary > #headerend# > > in headerend.tmpl: > > > > >

Welcome

> > But the "#headerend#" string is just replaced with an empty string. > > -- > Trygve > Hi, I have just subscribed to the mailing list and seen your post, so I am sorry for not replying to it directly. I have lately done something similar. Essentially, the problem is that the set of defined templating keywords has to be known to the template engine. I am not a guru here, but here is what I had to do to introduce a new template element: - modify hgweb_mod.py and register a new template keyword - required registering the template callback - look at for example at the 'footer' implementation - modify the .tmpl files to use it (that's what you did) Anybody knows a more simple approach? To give you an idea, attached is a small patch that introduces 'logo' support based on the hgrc configuration. Cheers, Jan [ Part 2, "logo-support.patch" Text/PLAIN (Name: "logo-support") ] [ 43 lines. ] [ Unable to print this part. ] [ Part 3: "Attached Text" ] _______________________________________________ Mercurial mailing list Mercurial@selenic.com http://selenic.com/mailman/listinfo/mercurial > > > _______________________________________________ > Mercurial mailing list > Mercurial@selenic.com > http://selenic.com/mailman/listinfo/mercurial > --=_courier-6692-1228555067-0001-2 Content-Type: text/plain; charset=us-ascii; name=logo-support Content-Transfer-Encoding: base64 Content-ID: Content-Description: logo.patch Content-Disposition: attachment; filename=logo-support bG9nb197YWx0LHNyYyxsaW5rfSB0ZW1wbGF0ZXMgZm9yIGhnd2ViDQoNCi0g aGdyYyBzdXBwb3J0cyBhIG5ldyBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMg dGhhdCBhbGxvdyBzZXR0aW5nIGxvZ28NCiAgdGVtcGxhdGUuIFRoaXMgdGVt cGxhdGUgaXMgdGhhbiBhdmFpbGFibGUgZm9yIHVzZSBpbiB0aGUgd2ViDQog IGludGVyZmFjZSAudG1wbCBmaWxlcy4NCg0KLSBleGFtcGxlIGNvbmZpZ3Vy YXRpb246DQpbd2ViXQ0KIyBjdXN0b21pemVkIHRlbXBsYXRlcyBmb3IgdGhh dCB1c2UgdGhlIGxvZ28NCnRlbXBsYXRlcyA9IC9zcnYvd3d3L2hnd2ViLXRl bXBsYXRlcy8NCiMgc3RhdGljIGZpbGVzIG1vZGlmaWVkIGFsc28gc2l0ZSBz cGVjaWZpYw0Kc3RhdGljID0gL3Nydi93d3cvZXhhbXBsZS5vcmcvaGcvc3Rh dGljDQojIGN1c3RvbSBzdHlsZSB0YWlsb3JlZCBmcm9tIGdpdCBhbmQgZXh0 ZW5kZWQgd2l0aCBsb2dvDQpzdHlsZSA9IGdpdC13ZWItd2l0aC1sb2dvDQoN CiMgbG9nbyBzZXR0aW5ncw0KbG9nb19saW5rID0gaHR0cDovL2hnLmV4YW1w bGUub3JnLw0KIyB0aGUgbG9nbyBoYXMgdG8gYmUgc3RvcmVkIGludG8gL3Ny di93d3cvZXhhbXBsZS5vcmcvaGcvc3RhdGljDQpsb2dvX3NyYyA9IGhnLWxv Z28ucG5nDQpsb2dvX2FsdCA9IFNvbWUgYWx0IHRleHQgd2hlbiBsb2dvIGlz IG1pc3NpbmcNCkluZGV4OiBoZ3dlYi9oZ3dlYl9tb2QucHkNCj09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT0NCi0tLSBoZ3dlYi5vcmlnL2hnd2ViX21vZC5weQky MDA4LTExLTI3IDE0OjQ2OjUyLjAwMDAwMDAwMCArMDEwMA0KKysrIGhnd2Vi L2hnd2ViX21vZC5weQkyMDA4LTExLTI3IDE0OjQ3OjMwLjAwMDAwMDAwMCAr MDEwMA0KQEAgLTMwNSw2ICszMDUsMTQgQEANCiAgICAgICAgIGRlZiBtb3Rk KCoqbWFwKToNCiAgICAgICAgICAgICB5aWVsZCBzZWxmLmNvbmZpZygid2Vi IiwgIm1vdGQiLCAiIikNCiANCisgICAgICAgIGRlZiBsb2dvKCoqbWFwKToN CisgICAgICAgICAgICB5aWVsZCB0bXBsKCJsb2dvIiwNCisgICAgICAgICAg ICAgICAgICAgICAgIGxvZ29fc3JjID0gc2VsZi5jb25maWcoJ3dlYicsICds b2dvX3NyYycsJycpLA0KKyAgICAgICAgICAgICAgICAgICAgICAgbG9nb19h bHQgPSBzZWxmLmNvbmZpZygnd2ViJywgJ2xvZ29fYWx0JywnTm8gbG9nbycp LA0KKyAgICAgICAgICAgICAgICAgICAgICAgbG9nb19saW5rID0gc2VsZi5j b25maWcoJ3dlYicsICdsb2dvX2xpbmsnLA0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly93d3cuc2Vs ZW5pYy5jb20vbWVyY3VyaWFsJyksDQorICAgICAgICAgICAgICAgICAgICAg ICAqKm1hcCkNCisNCiAgICAgICAgIGRlZiBzZXNzaW9udmFycygqKm1hcCk6 DQogICAgICAgICAgICAgZmllbGRzID0gW10NCiAgICAgICAgICAgICBpZiAn c3R5bGUnIGluIHJlcS5mb3JtOg0KQEAgLTMzOSw2ICszNDcsNyBAQA0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJo ZWFkZXIiOiBoZWFkZXIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgImZvb3RlciI6IGZvb3RlciwNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibW90ZCI6 IG1vdGQsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgImxvZ28iOiBsb2dvLA0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICJzZXNzaW9udmFycyI6IHNlc3Np b252YXJzDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB9KQ0KICAgICAgICAgcmV0dXJuIHRtcGwNCg== --=_courier-6692-1228555067-0001-2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Mercurial mailing list Mercurial@selenic.com http://selenic.com/mailman/listinfo/mercurial --=_courier-6692-1228555067-0001-2--