From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QZLwz-0005y5-3E for garchives@archives.gentoo.org; Wed, 22 Jun 2011 11:50:29 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ED5ED1C04C; Wed, 22 Jun 2011 11:50:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C0B671C04C for ; Wed, 22 Jun 2011 11:50:21 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5075D1B4025 for ; Wed, 22 Jun 2011 11:50:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A2CC88003C for ; Wed, 22 Jun 2011 11:50:20 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <19c7e031281df6bc25863a07ae3249530250df6f.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: / X-VCS-Repository: proj/pms-test-suite X-VCS-Files: setup.py X-VCS-Directories: / X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 19c7e031281df6bc25863a07ae3249530250df6f Date: Wed, 22 Jun 2011 11:50:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: c0e3807f6f3550f5b02e0f2be035c80e commit: 19c7e031281df6bc25863a07ae3249530250df6f Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Wed Jun 22 11:44:06 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Wed Jun 22 11:44:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D19c7e031 Support highlighting the source code. --- setup.py | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/setup.py b/setup.py index a0e47ac..46a50f5 100755 --- a/setup.py +++ b/setup.py @@ -59,12 +59,22 @@ class DocCommand(Command): ''' =20 + class LangAdder(markdown.treeprocessors.Treeprocessor): + def run(self, root): + for c in root.getiterator('pre'): + children =3D c.getchildren() + if len(children) =3D=3D 1 and children[0].tag =3D=3D 'code': + children[0].text =3D ':::python\n' + children[0].text + + return root + def extendMarkdown(self, md, md_globals): ska =3D self.HTMLSkelAdder() md.postprocessors.add('htmlskeladder', ska, '_end') md.treeprocessors.add('titlegrepper', self.TitleGrepper(ska), '_end'= ) + md.treeprocessors.add('langadder', self.LangAdder(), '