OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook] Visualize whitespace and tab


Hi Mario,

you can write a simple customization layer for the stylesheets that transforms DocBook into FO. Your stylesheet imports the fo/docbook.xsl stylesheet and overwrites the template for text-nodes in the literallayout element, so that every space character will be translated to the character that you would like to see. For DocBook 5.x and the current Stylesheets its something like this:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:d="http://docbook.org/ns/docbook"; version="1.0"> ÂÂÂ <xsl:import href="http://cdn.docbook.org/release/xsl/current/fo/docbook.xsl"/>

ÂÂÂ <xsl:template match="d:literallayout/text()">
ÂÂÂÂÂÂÂ <xsl:value-of select="translate(., '&#32;','&#x2423;')"/>
ÂÂÂ </xsl:template>

</xsl:stylesheet>

This is only for space characters in the literallayout element, and maybe U+2423 is not the space symbol you are looking for, but you get the idea.

If it don't seem to work check the catalog files use the absolute or relative path to the fo/docbook.xsl Stylesheet on your system.

Sincerely, Frank Steimke

Am 23.07.2019 um 20:00 schrieb Mario Klebsch:
Hello,

I want to write some examples about possible use of whitespace in source code. So I am looking for a way to visualize the use of tab and whitespace in source code listing.

Editors like Word or Notepad can display tabs as little arrows and spaces as little grey dots. I know, I can figure out the unicode code point of these characters, but I would prefer to use tab and space in <literallayout> and have fop displaying the arrow or the dot automagically.

I hope somebody has an idea how this can be achieved,

Thanks in advance,

Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-help@lists.oasis-open.org



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]