[PATCH 1 of 1] paper: preserve whitespace on description instead of adding breaks
Laurens Holst
laurens.nospam at grauw.nl
Fri Apr 15 12:45:33 CDT 2011
Op 15-4-2011 11:51, Adrian Buehlmann schreef:
> # HG changeset patch
> # User Adrian Buehlmann<adrian at cadifra.com>
> # Date 1302857786 -7200
> # Node ID ebe1ddbbefd70dbea0f6cdb4c2f94bf3a7c98ab2
> # Parent 3d83c7d70a98a1fd4ff1ad4f840c8ce82100bfdb
> paper: preserve whitespace on description instead of adding breaks
>
> This preserves the indentation of text in the changeset description.
>
> This is useful for example for descriptions containing command line
> use case examples like:
>
> $ hg -q heads
> 13934:648a834cca14
> 13912:71ea5b2b9517
>
> Without this patch, such space-char indented text was just left aligned.
>
> diff --git a/mercurial/templates/paper/changeset.tmpl b/mercurial/templates/paper/changeset.tmpl
> --- a/mercurial/templates/paper/changeset.tmpl
> +++ b/mercurial/templates/paper/changeset.tmpl
> @@ -40,7 +40,7 @@
> files, or words in the commit message</div>
> </form>
>
> -<div class="description">{desc|strip|escape|addbreaks|nonempty}</div>
> +<div class="description">{desc|strip|escape|nonempty}</div>
>
> <table id="changesetEntry">
> <tr>
> diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css
> --- a/mercurial/templates/static/style-paper.css
> +++ b/mercurial/templates/static/style-paper.css
> @@ -210,6 +210,7 @@ div.description {
> border-left: 2px solid #999;
> margin: 1em 0 1em 0;
> padding: .3em;
> + white-space: pre;
> }
Maybe use a <pre> tag in the template to ‘semantically’ indicate it is
preformatted text (and style the pre to be non-monospace)?
~Laurens
--
~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, developer, Utrecht, the Netherlands
Website: www.grauw.nl. Backbase employee; www.backbase.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6034 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110415/15095975/attachment.bin>
More information about the Mercurial-devel
mailing list