Mailing List Archive

GuideXML: define values & use conditional tags
Hi *,

With a new release coming out soon(-ish), we're going to have to hunt and
update quite a few variable data such as snapshot names/locations, CD sizes,
kernel versions in all our handbooks.
Some time ago, we discussed the possibility of defining values at the
beginning of the handbooks so that we need only update each value once, always
at the same place.

Besides, allowing conditional bodies would let us solve bugs like
http://bugs.gentoo.org/show_bug.cgi?id=52856 or the latest
http://bugs.gentoo.org/show_bug.cgi?id=132816. Paragraphs like "Sparc users or
PPC machines blah blah di blah" are getting more and more common and
inconsistencies such as the partitioning schemes in the the hb-ARCH-disk.xml
files and the common hb-install-config.xml are inevitable without conditionals.

Please have a look at the following links and compare:

Define values in books:
http://gentoo.neysx.org/mystuff/handbook/handbook-mips.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/handbook-hppa.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/handbook-alpha.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/handbook-ppc64.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/handbook-ppc.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/handbook-sparc.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?passthru=1

Use them:
http://gentoo.neysx.org/mystuff/handbook/hb-install-config.xml?passthru=1

I did not want to make block tags conditional to avoid having to test all
p,table,pre,ul,dl... and added a test attribute to the body tag. The only
change to the DTD would be to make "body+" and add the test attribute.
The test can be any XPath expression that is evaluated and if it returns true,
the body is processed.

The result looks like:
http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=8
http://gentoo.neysx.org/mystuff/handbook/handbook-sparc.xml?part=1&chap=8
http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=8
http://gentoo.neysx.org/mystuff/handbook/handbook-ppc.xml?part=1&chap=8
http://gentoo.neysx.org/mystuff/handbook/handbook-ppc64.xml?part=1&chap=8
http://gentoo.neysx.org/mystuff/handbook/handbook-alpha.xml?part=1&chap=8
http://gentoo.neysx.org/mystuff/handbook/handbook-hppa.xml?part=1&chap=8
http://gentoo.neysx.org/mystuff/handbook/handbook-mips.xml?part=1&chap=8

The good side is we could deliver less encumbered handbooks and please our users.
The drawback is that it makes writing text that flows properly in all cases
more difficult for us.

If you guys like it, it goes in, but if you think is too complex or too much
work to maintain, I shall not push it down your throat :)


Feedback welcome,
--
/ Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/
Re: GuideXML: define values & use conditional tags [ In reply to ]
On Thu, 2006-06-22 at 13:11 +0200, Xavier Neys wrote:
> With a new release coming out soon(-ish), we're going to have to hunt and
> update quite a few variable data such as snapshot names/locations, CD sizes,
> kernel versions in all our handbooks.

I think for these, sed is usually all it takes.

> Some time ago, we discussed the possibility of defining values at the
> beginning of the handbooks so that we need only update each value once, always
> at the same place.

That being said, I really like the idea. It might take a little while
to get the wording to look correct and flow properly (as in the first
handbook or so using this might not flow the best), but I think that
overall it will end up giving a better experience for our users.

Of course, I'm also not going to request any such change. I definitely
think that how the Handbook is done (especially at the underlying
levels) is totally up to you guys. I'm just letting you know that I'd
definitely support it.

--
Chris Gianelloni
Release Engineering - Strategic Lead
x86 Architecture Team
Games - Developer
Gentoo Linux
Re: GuideXML: define values & use conditional tags [ In reply to ]
Xavier Neys wrote:

> Besides, allowing conditional bodies would let us solve bugs like
> http://bugs.gentoo.org/show_bug.cgi?id=52856 or the latest
> http://bugs.gentoo.org/show_bug.cgi?id=132816. Paragraphs like "Sparc users or
> PPC machines blah blah di blah" are getting more and more common and
> inconsistencies such as the partitioning schemes in the the hb-ARCH-disk.xml
> files and the common hb-install-config.xml are inevitable without conditionals.

Well... I had this exact problem with the MIPS handbook. There was
quite a bit of information, not relevant to other architectures, that I
needed to get across, which related to stageball selection.

Thus, MIPS is the only ARCH that has it's own stage selection section
(hb-install-mips-stage.xml), whereas the others all share a common file
(hb-install-stage.xml).

This meant I could go into greater detail, and thus made (IMHO) a higher
quality manual.

> The good side is we could deliver less encumbered handbooks and please our users.
> The drawback is that it makes writing text that flows properly in all cases
> more difficult for us.

Yeah, this is definitely an issue. It'd mean having to write the doc a
few times to get it right with all possible selections. Then again, the
solution I went with (to get around this issue) also involves a lot of
duplication of information, which has its drawbacks too.

--
Stuart Longland (aka Redhatter) .'''.
Gentoo Linux/MIPS Cobalt and Docs Developer '.'` :
. . . . . . . . . . . . . . . . . . . . . . .'.'
http://dev.gentoo.org/~redhatter :.'

International Asperger's Year (1906 ~ 2006)
http://dev.gentoo.org/~redhatter/iay
Re: GuideXML: define values & use conditional tags [ In reply to ]
Chris Gianelloni wrote:
> On Thu, 2006-06-22 at 13:11 +0200, Xavier Neys wrote:
>> With a new release coming out soon(-ish), we're going to have to hunt and
>> update quite a few variable data such as snapshot names/locations, CD sizes,
>> kernel versions in all our handbooks.
>
> I think for these, sed is usually all it takes.

Not for translators. I usually look at the CVS diffs and don't use sed
as I can't be completely sure what else has changed.

Cheers,
-jkt

--
cd /local/pub && more beer > /dev/mouth
Re: GuideXML: define values & use conditional tags [ In reply to ]
Xavier Neys wrote:
> http://gentoo.neysx.org/mystuff/handbook/handbook-mips.xml?part=1&chap=8

"If our default MIPS partitioning example, /boot is usually the
/dev/sda1 partition (or /dev/sda* if you use SCSI or SATA drives)"

Better to combine the tags for inclusion with conditional <body> or
<p|warn|impo|...>, IMHO.

Cheers,
-jkt

--
cd /local/pub && more beer > /dev/mouth
Re: GuideXML: define values & use conditional tags [ In reply to ]
2006-06-22, Xavier Neys sanoi, jotta:

> With a new release coming out soon(-ish), we're going to have to hunt
> and update quite a few variable data such as snapshot
> names/locations, CD sizes, kernel versions in all our handbooks.
> Some time ago, we discussed the possibility of defining values at the
> beginning of the handbooks so that we need only update each value
> once, always at the same place.

> If you guys like it, it goes in, but if you think is too complex or
> too much work to maintain, I shall not push it down your throat :)
>
>
> Feedback welcome,

The change towards variables for version information and such is good
per se, but as translator I should probably remind, that using
variables does make creating good translations a bit harder. As an
example, translation of
"[...] <keyval id="arch"/> systems and <keyval id="arch"/>
clones [...]"
will be "<keyval id="arch"/>-järjestelmät ja <keyval
id="arch"/>-kloonit" if and only if <keyval/> doesn't contain spaces,
otherwise hyphens must be preceded by spaces. Variables also
practically prevent use of any affixes, which will reduce the quality of
translations in languages with rich morphology, such as Finnish.

So, what I'm basically suggesting is only to avoid overusing these
variables. While they are mostly fine in version numbers,
file system paths and such codes, they may cause problems in names,
phrases and such.
--
Flammie, Gentoo Linux Documentation’s Finnish head translator
and FlameEyes’ bot <http://dev.gentoo.org/~flammie>.
Re: GuideXML: define values & use conditional tags [ In reply to ]
Jan Kundrát wrote:
> Xavier Neys wrote:
>> http://gentoo.neysx.org/mystuff/handbook/handbook-mips.xml?part=1&chap=8
>
> "If our default MIPS partitioning example, /boot is usually the
> /dev/sda1 partition (or /dev/sda* if you use SCSI or SATA drives)"
>
> Better to combine the tags for inclusion with conditional <body> or
> <p|warn|impo|...>, IMHO.

I can live with conditional <p>, <note>, <impo> & <warn> tags. No more.
It will make it a bit easier than to have to use separate bodies just for a note.
If more content has to be conditional (pre, lists, tables...), then wrap them
up in a conditional body.


Cheers,
--
/ Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/
Re: GuideXML: define values & use conditional tags [ In reply to ]
Flammie Pirinen wrote:
> 2006-06-22, Xavier Neys sanoi, jotta:
>
>> With a new release coming out soon(-ish), we're going to have to hunt
>> and update quite a few variable data such as snapshot
>> names/locations, CD sizes, kernel versions in all our handbooks.
>> Some time ago, we discussed the possibility of defining values at the
>> beginning of the handbooks so that we need only update each value
>> once, always at the same place.
>
>> If you guys like it, it goes in, but if you think is too complex or
>> too much work to maintain, I shall not push it down your throat :)
>>
>>
>> Feedback welcome,
>
> The change towards variables for version information and such is good
> per se, but as translator I should probably remind, that using
> variables does make creating good translations a bit harder. As an
> example, translation of
> "[...] <keyval id="arch"/> systems and <keyval id="arch"/>
> clones [...]"
> will be "<keyval id="arch"/>-järjestelmät ja <keyval
> id="arch"/>-kloonit" if and only if <keyval/> doesn't contain spaces,
> otherwise hyphens must be preceded by spaces. Variables also
> practically prevent use of any affixes, which will reduce the quality of
> translations in languages with rich morphology, such as Finnish.
>
> So, what I'm basically suggesting is only to avoid overusing these
> variables. While they are mostly fine in version numbers,
> file system paths and such codes, they may cause problems in names,
> phrases and such.

I expect no less than translators being able to just cut'n'paste the values.
If it causes trouble to translators, something must be fixed asap and I trust
you'll report any issues :)


Cheers,
--
/ Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/
Re: GuideXML: define values & use conditional tags [ In reply to ]
Xavier Neys wrote:
Hi *,

Replying to the original post to keep links :)

> Please have a look at the following links and compare:
>
> Define values in books:
> http://gentoo.neysx.org/mystuff/handbook/handbook-mips.xml?passthru=1
> http://gentoo.neysx.org/mystuff/handbook/handbook-hppa.xml?passthru=1
> http://gentoo.neysx.org/mystuff/handbook/handbook-alpha.xml?passthru=1
> http://gentoo.neysx.org/mystuff/handbook/handbook-ppc64.xml?passthru=1
> http://gentoo.neysx.org/mystuff/handbook/handbook-ppc.xml?passthru=1
> http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?passthru=1
> http://gentoo.neysx.org/mystuff/handbook/handbook-sparc.xml?passthru=1
> http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?passthru=1

Use them in shared chapters across all architectures:
> http://gentoo.neysx.org/mystuff/handbook/hb-install-config.xml?passthru=1

and in merged x86 & amd64 arch-specific chapters
http://gentoo.neysx.org/mystuff/handbook/hb-install-x86+amd64-bootloader.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/hb-install-x86+amd64-disk.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/hb-install-x86+amd64-kernel.xml?passthru=1
http://gentoo.neysx.org/mystuff/handbook/hb-install-x86+amd64-medium.xml?passthru=1

> I did not want to make block tags conditional to avoid having to test all
> p,table,pre,ul,dl... and added a test attribute to the body tag. The only
> change to the DTD would be to make "body+" and add the test attribute.
> The test can be any XPath expression that is evaluated and if it returns true,
> the body is processed.

Now, I do want more tags that allow a condition. I tried both ways and the XML
ends up a lot easier to read when you don't have to create bodies around a
single block tag.
Even <li> and <tr> can be made conditional.
Look at the table about the video statement in the bootloader section
http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=10
http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=10
The only difference is an extra row. Using <tr test="...">... is a lot more
readable and easier to maintain than two separate tables inside different bodies.

> The result looks like:
> http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=8
> http://gentoo.neysx.org/mystuff/handbook/handbook-sparc.xml?part=1&chap=8
> http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=8
> http://gentoo.neysx.org/mystuff/handbook/handbook-ppc.xml?part=1&chap=8
> http://gentoo.neysx.org/mystuff/handbook/handbook-ppc64.xml?part=1&chap=8
> http://gentoo.neysx.org/mystuff/handbook/handbook-alpha.xml?part=1&chap=8
> http://gentoo.neysx.org/mystuff/handbook/handbook-hppa.xml?part=1&chap=8
> http://gentoo.neysx.org/mystuff/handbook/handbook-mips.xml?part=1&chap=8

and for the merged x86 & amd64 bits:
http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=2
http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=2
http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=4
http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=4
http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=7
http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=7
http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=10
http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=10

I'll try to add it all on www.g.o early next week, or early the week after.
I receive family this weekend and I'll be away the next one, and I don't
commit anything like this unless I know I can be available in case anything
goes wrong :)


Cheers,
--
/ Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/
Re: GuideXML: define values & use conditional tags [ In reply to ]
Xavier Neys wrote:

> I'll try to add it all on www.g.o early next week, or early the week after.
> I receive family this weekend and I'll be away the next one, and I don't
> commit anything like this unless I know I can be available in case anything
> goes wrong :)

Done. I'll amend xml-guide.xml next week though.

x86 & amd64 arch specific files have been merged.
hb-install-config.xml is now clean of foreign arches for all arches.
Other common files still need to be "cleaned up".
Feel free to file patches on bugs if you feel like trying it :)


What this feature is meant for:
1) define values that need to be changed at every release. Use values only,
don't even put units in there.
2) allow tests, usually on arch, to avoid foreign arches from common files.
3) possibly merge arch-specific files that are very similar, like x86 & amd64
which share the same tools, terminology, partition schemes...
4) possibly merge current & xxxx.y files as long as they are very similar
*and* stay similar at least until the next release.
FYI, xxxx.y docs are supposed to keep working as long as xxxx.y is the latest
version, current handbooks keep moving along.

What it is *not* meant for:
Merge everything back into huge files full of conditionals.

Feedback, questions? Use this ML or #gentoo-doc


Cheers,
--
/ Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/