Future of LFS
Bruce Dubbs
bruce.dubbs at gmail.com
Sun May 18 21:28:07 MDT 2008
Bruce Dubbs wrote:
> Gerard Beekmans wrote:
>
>> > I would also like to add the boot scripts to the book as appendices
>>
>> Do you mean the source code of them as-is? I can see this become a bit
>> of a hassle as the actual scripts are updated. We'd then have to
>> remember to copy each change into the appendix as well so it matches.
>>
>> We could consider an automatic method where during each commit (of the
>> entire book or only have it trigger when a certain appendix is updated)
>> it finds the bootscript code and imports it verbatim.
>
> What I had in mind was a way to include each script. A page in the appendix
> would just pull in the actual script, probably into some kind of <pre>
> structure. We can't use an xinclude though because it isn't a proper xml
> structured file. We may be able to do something via entities though. I'll
> research it and see what I cna come up with.
OK, this is a proof of concept, but it kinda works.
I created test.xml in the LFS main directory:
-----------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY script SYSTEM "../bootscripts/lfs/init.d/rc.test">
]>
<article>
<title>Testing</title>
<screen>&script;</screen>
</article>
------------------
I had to process the rc file with:
sed -e s/\&/\&\;/g -e 's/</\<\;/' rc > rc.test
to put ampersands and less-than symbols into xml friendly forms.
------------------
I then ran
xmllint --nonet --noent -o testout.xml test.xml
xsltproc --nonet stylesheets/lfs-chunked.xsl testout.xml
and it created index.html like I had in mind in my above post.
In other words, we can easily automate including the current bootscripts into an
appendix. Adding a new bootscript will require a manual entry of course, but
that would be only a few lines of xml.
Do you want me to start on adding this to the book as Appendix D?
-- Bruce
More information about the lfs-dev
mailing list