Changeset 35d9770


Ignore:
Timestamp:
07/07/2007 10:30:37 AM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 12.2, 6.3, 6.3-rc1, 6.3-rc2, 6.3-rc3, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gimp3, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/for-12.3, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/spidermonkey128, xry111/test-20220226, xry111/xf86-video-removal
Children:
c425f86
Parents:
3c6bf83
Message:

Updated book rendering framework to use the new LFS-XSL Stylesheets.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@6842 af4574ff-66df-0310-9fd7-8a98e5e911e0

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r3c6bf83 r35d9770  
    44# $LastChangedBy$
    55# $Date$
     6
    67# Adjust these to suit your installation
    7 OUTPUTDIR = $(HOME)/public_html/blfs-book
     8BASEDIR= $(HOME)/public_html/blfs-book-xsl
    89DUMPDIR= $(HOME)/blfs-commands
    9 INSTALL = install
    10 JADE = openjade
    11 DOCBOOK = /usr/share/sgml/docbook/dsssl-stylesheets-1.78
    12 BASEDIR= $(HOME)/public_html/blfs-book-xsl
    13 TEXBASEDIR= $(HOME)/public_html/blfs-book-tex
     10CHUNK_QUIET=1
     11ROOT_ID=""
     12PDF_OUTPUT=BLFS-BOOK.pdf
    1413NOCHUNKS_OUTPUT=BLFS-BOOK.html
    15 SRCDIR = $(PWD)
    1614
    17 all: blfs
     15ifdef V
     16  Q =
     17else
     18  Q = @
     19endif
    1820
    19 blfs:
    20         @if [ -z $(BASEDIR) ]; then \
    21                 echo "Envar BASEDIR is not set!" ; \
    22                 exit 1 ; \
    23         fi
    24         @echo "Generating XHTML Version of BLFS Book with xsltproc..."
    25         @echo "  BASEDIR = $(BASEDIR)"
    26         @$(INSTALL) -d $(BASEDIR)
    27         xsltproc --xinclude --nonet -stringparam base.dir $(BASEDIR)/ \
    28           stylesheets/blfs-chunked.xsl index.xml
    29         if [ ! -e $(BASEDIR)/stylesheets ]; then \
     21blfs: validxml profile-html
     22        @echo "Generating chunked XHTML files..."
     23        $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
     24          -stringparam rootid $(ROOT_ID) -stringparam base.dir $(BASEDIR)/ \
     25          stylesheets/blfs-chunked.xsl /tmp/blfs-html.xml
     26
     27        @echo "Copying CSS code and images..."
     28        $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
    3029          mkdir -p $(BASEDIR)/stylesheets; \
    3130        fi;
    32         cp stylesheets/*.css $(BASEDIR)/stylesheets
    33         if [ ! -e $(BASEDIR)/images ]; then \
     31        $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
     32        $(Q)if [ ! -e $(BASEDIR)/images ]; then \
    3433          mkdir -p $(BASEDIR)/images; \
    3534        fi;
    36         cp images/*.png $(BASEDIR)/images
    37         cd $(BASEDIR); sed -i -e "s@../stylesheets@stylesheets@g" *.html
    38         cd $(BASEDIR); sed -i -e "s@../images@images@g" *.html
     35        $(Q)cp images/*.png $(BASEDIR)/images
     36        $(Q)cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html
     37        $(Q)cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html
    3938
    40         for filename in `find $(BASEDIR) -name "*.html"`; do \
     39        @echo "Running Tidy and obfuscate.sh..."
     40        $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
    4141          tidy -config tidy.conf $$filename; \
    4242          true; \
     
    4545        done;
    4646
     47pdf: validxml
     48        @echo "Generating profiled XML for PDF..."
     49        $(Q)xsltproc --nonet --stringparam profile.condition pdf \
     50          --output /tmp/blfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \
     51          /tmp/blfs-full.xml
    4752
    48 nochunks:
    49         @echo "Generating nochunks version of BLFS..."
    50         xsltproc --xinclude --nonet -stringparam profile.condition html \
    51         --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
    52         stylesheets/blfs-nochunks.xsl index.xml
     53        @echo "Generating FO file..."
     54        $(Q)xsltproc --nonet -stringparam rootid $(ROOT_ID) \
     55          --output /tmp//blfs-pdf.fo stylesheets/blfs-pdf.xsl /tmp/blfs-pdf.xml
     56        $(Q)sed -i -e 's/span="inherit"/span="all"/' /tmp/blfs-pdf.fo
    5357
    54         tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
     58        @echo "Generating PDF file..."
     59        $(Q)if [ ! -e $(BASEDIR) ]; then \
     60          mkdir -p $(BASEDIR); \
     61        fi;
     62        $(Q)fop /tmp/blfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
    5563
    56         sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
     64nochunks: validxml profile-html
     65        @echo "Generating non chunked XHTML file..."
     66        $(Q)xsltproc --nonet -stringparam profile.condition html \
     67          -stringparam rootid $(ROOT_ID) --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
     68          stylesheets/blfs-nochunks.xsl /tmp/blfs-html.xml
    5769
    58         sed -i -e "s@text/html@application/xhtml+xml@g"  \
    59           $(BASEDIR)/$(NOCHUNKS_OUTPUT)
     70        @echo "Running Tidy..."
     71        $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
     72        @echo "Running obfuscate.sh..."
     73        $(Q)sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
     74        $(Q)sed -i -e "s@text/html@application/xhtml+xml@g"  \
     75          $(BASEDIR)/$(NOCHUNKS_OUTPUT)
    6076
    61 pdf:
    62         xsltproc --xinclude --nonet --stringparam profile.condition pdf \
    63              --output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml
    64         xsltproc --xinclude --nonet --output blfs.fo \
    65                  stylesheets/blfs-pdf.xsl blfs-pdf.xml
    66         sed -i -e "s/inherit/all/" blfs.fo
    67         fop.sh blfs.fo blfs.pdf
    68         $(INSTALL) -d $(BASEDIR)/pdf
    69         rm blfs.fo
    70         mv blfs.pdf $(BASEDIR)/pdf
     77validxml:
     78        @echo "Validating the book..."
     79        $(Q)xmllint --nonet --noent --xinclude --postvalid \
     80          -o /tmp/blfs-full.xml index.xml
    7181
    72 tex:
    73         @if [ -z $(TEXBASEDIR) ]; then \
    74        echo "Envar TEXBASEDIR is not set!" ; \
    75        exit 1 ; \
    76     fi
    77         @echo "Generating TeX Version of BLFS Book with xsltproc..."
    78         @echo "  TEXBASEDIR = $(TEXBASEDIR)"
    79         @$(INSTALL) -d $(TEXBASEDIR)
    80 # Using profiles in book source to exclude parts of the book from TeX
    81 # i.e., Changelog
    82         xsltproc --nonet --output $(TEXBASEDIR)/index.xml \
    83         --stringparam "profile.role" "book" \
    84         http://docbook.sourceforge.net/release/xsl/current/profiling/profile.xsl \
    85             index.xml
    86         @cd $(TEXBASEDIR) && xsltproc --nonet -o blfs-book.tex \
    87             $(SRCDIR)/stylesheets/blfs-tex.xsl index.xml
     82profile-html: validxml
     83        @echo "Generating profiled XML for XHTML..."
     84        $(Q)xsltproc --nonet --stringparam profile.condition html \
     85          --output /tmp/blfs-html.xml stylesheets/lfs-xsl/profile.xsl \
     86          /tmp/blfs-full.xml
    8887
    89 dump-commands:
    90         xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
    91            stylesheets/dump-commands.xsl index.xml
     88blfs-patch-list: validxml
     89        @echo "Generating blfs-patch-list..."
     90        $(Q)xsltproc --nonet --output /tmp/blfs-patch-list \
     91          stylesheets/patcheslist.xsl /tmp/blfs-full.xml
     92        $(Q)sed -e "s|^.*/||" /tmp/blfs-patch-list > /tmp/blfs-patches
     93        $(Q)sort /tmp/blfs-patches > blfs-patch-list
    9294
    93 validate:
    94         xmllint --noout --nonet --xinclude --postvalid index.xml
     95wget-list: validxml
     96        @echo "Generating wget list..."
     97        $(Q)mkdir -p $(BASEDIR)
     98        $(Q)xsltproc --nonet --output $(BASEDIR)/wget-list \
     99          stylesheets/wget-list.xsl /tmp/lfs-full.xml
    95100
    96 validate-pdf:
    97         xsltproc --xinclude --nonet --stringparam profile.condition pdf \
    98              --output blfs-pdf.xml stylesheets/blfs-profile.xsl index.xml
    99         xmllint --noout --nonet --postvalid blfs-pdf.xml
     101test-links: validxml
     102        @echo "Generating test-links file..."
     103        $(Q)mkdir -p $(BASEDIR)
     104        $(Q)xsltproc --nonet --stringparam list_mode full \
     105          --output $(BASEDIR)/test-links stylesheets/wget-list.xsl \
     106          /tmp/lfs-full.xml
    100107
    101 blfs-patch-list:
    102         @echo "Generating blfs-patch-list..."
    103         xsltproc --xinclude --nonet \
    104              --output blfs-patch-list stylesheets/patcheslist.xsl index.xml
    105         sed -e "s|^.*/||" blfs-patch-list > blfs-patches
    106         sort blfs-patches > blfs-patch-list
    107         rm blfs-patches
    108 
    109 wget-list:
    110         mkdir -p $(BASEDIR)
    111         xsltproc --xinclude --nonet stylesheets/wget-list.xsl index.xml > $(BASEDIR)/wget-list
    112 
    113 test-links:
    114         mkdir -p $(BASEDIR)
    115         xsltproc --xinclude --nonet --stringparam list_mode full \
    116             stylesheets/wget-list.xsl index.xml > $(BASEDIR)/test-links
    117         rm -f $(BASEDIR)/{good,bad,true_bad}_urls
    118         for URL in `cat $(BASEDIR)/test-links`; do \
     108        @echo "Cheking URLs, first pass..."
     109        $(Q)rm -f $(BASEDIR)/{good,bad,true_bad}_urls
     110        $(Q)for URL in `cat $(BASEDIR)/test-links`; do \
    119111            wget --spider --tries=2 --timeout=60 $$URL >>/dev/null 2>&1; \
    120112            if test $$? -ne 0 ; then echo $$URL >> $(BASEDIR)/bad_urls ; \
     
    122114            fi; \
    123115        done
    124         for URL2 in `cat $(BASEDIR)/bad_urls`; do \
     116
     117        @echo "Cheking URLs, second pass..."
     118        $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \
    125119            wget --spider --tries=2 --timeout=60 $$URL2 >>/dev/null 2>&1; \
    126120            if test $$? -ne 0 ; then echo $$URL2 >> $(BASEDIR)/true_bad_urls ; \
     
    129123        done
    130124
    131 .PHONY : blfs-patch-list wget-list test-links
     125dump-commands: validxml
     126        @echo "Dumping book commands..."
     127        $(Q)xsltproc --output $(DUMPDIR)/ \
     128           stylesheets/dump-commands.xsl /tmp/lfs-full.xml
     129
     130validate:
     131        @echo "Validating the book..."
     132        $(Q)xmllint --noout --nonet --xinclude --postvalid index.xml
     133
     134all: blfs nochunks pdf
     135
     136world: all blfs-patch-list dump-commands wget-list test-links
     137
     138.PHONY : all blfs blfs-patch-list dump-commands nochunks pdf profile-html \
     139         test-links validate validxml wget-list world
  • introduction/welcome/changelog.xml

    r3c6bf83 r35d9770  
    4343
    4444    <listitem>
     45      <para>July 7th, 2007</para>
     46      <itemizedlist>
     47        <listitem>
     48          <para>[manuel] - Updated book rendering framework to use the new
     49          LFS-XSL Stylesheets.</para>
     50        </listitem>
     51      </itemizedlist>
     52    </listitem>
     53
     54    <listitem>
    4555      <para>July 6th, 2007</para>
    4656      <itemizedlist>
  • obfuscate.sh

    r3c6bf83 r35d9770  
    77# obfuscate email addresses in XML/HTML
    88# Script written (and slight perl modification) by Archaic <archaic AT linuxfromscratch D0T org>
     9# Modified from "sed -i" to old style "sed -e" by Manuel Canales <manuel AT linuxfromscratch D0T org>
     10# to prevent hangs on very long files, like nonckunked books.
    911# Original Perl expression by Anderson Lizardo <lizardo AT linuxfromscratch D0T org>
    1012# Released under the GNU General Public License
     
    2931#cp "$1" "$1".bak
    3032
    31 for i in `grep -o '"mailto:.*@.*"' "$1" |cut -d\" -f2|sed -e 's|^mailto:||' -e 's|"$||'`; do
     33for i in `grep -o '"mailto:.*@.*"' ${1} |cut -d\" -f2|sed -e 's|^"mailto:||' -e 's|"$||'`; do
    3234  link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'`
    3335  plaintext=`echo $i | sed -e 's|@| AT |' -e 's|\.| D0T |g'`
    34   sed -i "s|mailto:$i|mailto:$link|" "$1"
    35   sed -i "s|$i|$plaintext|" "$1"
     36  cp ${1}{,.tmp}
     37  sed -e "s|mailto:$i|mailto:$link|" \
     38      -e "s|$i|$plaintext|" ${1}.tmp > ${1}
     39  rm ${1}.tmp
    3640done
    37 
     41#rm $FILE.tmp
    3842#exit 0
Note: See TracChangeset for help on using the changeset viewer.