* [gentoo-dev] RFC: dohtml script
@ 2001-07-14 3:48 Tod M. Neidt
0 siblings, 0 replies; only message in thread
From: Tod M. Neidt @ 2001-07-14 3:48 UTC (permalink / raw
To: gentoo-dev@cvs.gentoo.org
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]
Hi!
I've been playing around with documentation ebuilds and noticed two
different ways that html documentation is being merged.
1) using the dodoc script (example: gimp-1.2.1-r1.ebuild, the libgimp
docs)
pro: gzipped to take up less disk space
con: can't follow local links
2) a straight cp (example: gimp-user-manual-2.0.ebuild)
pro: can follow local links between pages
con: uncompressed docs use more disk space
The attached script, dohtml, is a quick and dirty implementation to
gzip html docs and have your linkage too. It is a modification of the
dodoc script which seds the html files and and changes the relative
links from href="foo.html" to href="foo.html.gz" prior to gzipping and
installation.
I have only tested it on the gimp-1.2.1-r1.ebuild. The merge is fine.
And it is actually functional. You can browse the local gzipped
libgimpdocs. There is some mangling of the text,extra .gz's scattered
about...hey I said it was quick and dirty ;), but it illustrates the
concept.
Is this something that would be of interest to Gentoo?
If you want to give it a try change the line
dodoc devel-docs/libgimp/html/*.html
to
dohtml devel-docs/libgimp/html/*.html
in the gimp-1.2.1-r1.ebuild and copy the dohtml script to
/usr/lib/portage/bin
Criticism is appreciated.
tod
[-- Attachment #2: dohtml --]
[-- Type: text/plain, Size: 823 bytes --]
#!/bin/bash
#modified from dodoc by Tod Neidt <tneidt@fidnet.com>
for x in "$@"
do
if [ -e ${x} ]
then
cp ${x} ${x}.orig
#Edit URI html links in Anchor tags to append .gz
#then go back through and undo nonlocal links
#How do you icorporate a negate in first substitute :(
sed -e 's/\([(HREF|href)].*[(html|htm)]\)/\1.gz/g' \
-e 's/\([(HREF|href)].*http.*[(html|htm)]\)\.gz/\1/g' \
${x}.orig > ${x}
if [ ! -d ${D}usr/share/doc/${PF} ]
then
install -d ${D}usr/share/doc/${PF}
fi
if [ -z ${DOCDESTTREE} ]
then
install -m0644 ${x} ${D}usr/share/doc/${PF}
gzip -f -9 ${D}usr/share/doc/${PF}/${x##*/}
else
install -m0644 ${x} ${D}usr/share/doc/${PF}/${DOCDESTTREE}
gzip -f -9 ${D}usr/share/doc/${PF}/${DOCDESTTREE}/${x##*/}
fi
else
echo "${0}: ${x} does not exist."
fi
done
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-14 9:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-14 3:48 [gentoo-dev] RFC: dohtml script Tod M. Neidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox