Changeset 122ebf0 in clfs-embedded


Ignore:
Timestamp:
Jul 15, 2007, 6:13:18 AM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
master
Children:
39a9ea5
Parents:
c2f4c89
Message:

Updated Makefile to use the new stylesheets.

Location:
BOOK
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BOOK/Makefile

    rc2f4c89 r122ebf0  
    22DUMPDIR         := ~/cross-lfs-embedded-commands
    33DLLISTDIR       := ~/cross-lfs-embedded-dllist
     4RENDERTMP       := $(HOME)/tmp
    45CHUNK_QUIET     := 1
    5 XSLROOTDIR      := /usr/share/xml/docbook/xsl-stylesheets-1.69.1
     6ROOT_ID         :=
    67
    78S               := -
     
    1213ARCHS_NOCHUNKS  := $(ARCHS:%=%$(S)nochunks)
    1314ARCHS_PDF       := $(ARCHS:%=%$(S)pdf)
    14 ARCHS_TEXT      := $(ARCHS:%=%$(S)text)
    1515ARCHS_VALIDATE  := $(ARCHS:%=%$(S)validate)
    1616ARCHS_TROUBLE   := $(ARCHS:%=%$(S)trouble)
     
    1818ARCHS_DLLIST    := $(ARCHS:%=%$(S)dllist)
    1919
    20 .PHONY: lfs tidy render titlepage $(ARCHS_HTML) nochunks $(ARCHS_NOCHUNKS) pdf $(ARCHS_PDF) text $(ARCHS_TEXT) validate $(ARCHS_VALIDATE) trouble $(ARCHS_TROUBLE) dump-commands $(ARCHS_DUMP) download-list $(ARCHS_DLLIST)
     20ifdef V
     21  Q =
     22else
     23  Q = @
     24endif
    2125
    22 lfs: render tidy
     26.PHONY: lfs tidy render titlepage $(ARCHS_HTML) nochunks $(ARCHS_NOCHUNKS) pdf \
     27        $(ARCHS_PDF) validate $(ARCHS_VALIDATE) trouble $(ARCHS_TROUBLE) \
     28        dump-commands $(ARCHS_DUMP) download-list $(ARCHS_DLLIST) tmpdir
     29
     30lfs: tmpdir render tidy
     31
     32tmpdir:
     33        @echo "Creating and cleaning $(RENDERTMP)"
     34        $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
     35        $(Q)rm -f $(RENDERTMP)/*-{full,html,pdf}.xml
     36        $(Q)rm -f $(RENDERTMP)/*-pdf.fo
    2337
    2438ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
    2539tidy:
    26         @echo Running tidy on the created HTML
    27         @for filename in `find $(BASEDIR) -name "*.html"`; do \
    28           tidy -config tidy.conf $$filename; \
     40        @echo "Running tidy on the created HTML"
     41        $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
     42          tidy -config $(PWD)/tidy.conf $$filename; \
    2943          true; \
    30           sh obfuscate.sh $$filename; \
     44          sh $(PWD)/obfuscate.sh $$filename; \
    3145          sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
    3246        done;
    3347else
    3448tidy:
    35         @echo Tidy is not installed on this system
     49        @echo "Tidy is not installed on this system"
    3650endif
    3751
     
    3953
    4054titlepage:
    41         @xsltproc --nonet --output $(BASEDIR)/index.html $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml
     55        $(Q)xsltproc --nonet --output $(BASEDIR)/index.html \
     56          $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml
    4257
    4358$(ARCHS_HTML): override html_arch = $(@:%$(S)html=%)
    4459$(ARCHS_HTML):
    45         @echo "Rendering HTML of $(html_arch)..."
    46         @xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/$(html_arch)/ $(PWD)/stylesheets/lfs-chunked.xsl $(PWD)/$(html_arch)-index.xml
    47         @mkdir -p $(BASEDIR)/$(html_arch)/stylesheets
    48         @cp $(PWD)/stylesheets/*.css $(BASEDIR)/$(html_arch)/stylesheets
    49         @sed -i -e "s@../stylesheets@stylesheets@g" $(BASEDIR)/$(html_arch)/*.html
    50         @mkdir -p $(BASEDIR)/$(html_arch)/images
    51         @cp $(XSLROOTDIR)/images/*.png $(BASEDIR)/$(html_arch)/images
    52         @sed -i -e "s@../images@images@g" $(BASEDIR)/$(html_arch)/*.html
     60        @echo "Validating $(html_arch) book..."
     61        $(Q)xmllint --nonet --noent --xinclude --postvalid \
     62          -o $(RENDERTMP)/$(html_arch)-full.xml $(PWD)/$(html_arch)-index.xml
    5363
    54 nochunks: $(ARCHS_NOCHUNKS) tidy
     64        @echo "Generating profiled $(html_arch) book for XHTML..."
     65        $(Q)xsltproc --nonet --stringparam profile.condition html \
     66          --output $(RENDERTMP)/$(html_arch)-html.xml \
     67          $(PWD)/stylesheets/lfs-xsl/profile.xsl $(RENDERTMP)/$(html_arch)-full.xml
     68
     69        @echo "Rendering chunked XHTML of $(html_arch)..."
     70        $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
     71          -stringparam rootid "$(ROOT_ID)" \
     72          -stringparam base.dir $(BASEDIR)/$(html_arch)/ \
     73          $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$(html_arch)-html.xml
     74
     75        @echo "Copying CSS code and images..."
     76        $(Q)mkdir -p $(BASEDIR)/$(html_arch)/stylesheets
     77        $(Q)cp $(PWD)/stylesheets/lfs-xsl/*.css $(BASEDIR)/$(html_arch)/stylesheets
     78        $(Q)sed -i -e "s@../stylesheets@stylesheets@g" $(BASEDIR)/$(html_arch)/*.html
     79        $(Q)mkdir -p $(BASEDIR)/$(html_arch)/images
     80        $(Q)cp $(PWD)/images/*.png $(BASEDIR)/$(html_arch)/images
     81        $(Q)sed -i -e "s@../images@images@g" $(BASEDIR)/$(html_arch)/*.html
     82
     83nochunks: tmpdir $(ARCHS_NOCHUNKS) tidy
    5584
    5685$(ARCHS_NOCHUNKS): override nochunk_arch = $(@:%$(S)nochunks=%)
    5786$(ARCHS_NOCHUNKS):
     87        @echo "Validating $(nochunk_arch) book..."
     88        $(Q)xmllint --nonet --noent --xinclude --postvalid \
     89          -o $(RENDERTMP)/$(nochunk_arch)-full.xml $(PWD)/$(nochunk_arch)-index.xml
     90
     91        @echo "Generating profiled $(nochunk_arch) book for XHTML..."
     92        $(Q)xsltproc --nonet --stringparam profile.condition html \
     93          --output $(RENDERTMP)/$(nochunk_arch)-html.xml \
     94          $(PWD)/stylesheets/lfs-xsl/profile.xsl \
     95          $(RENDERTMP)/$(nochunk_arch)-full.xml
     96
    5897        @echo "Rendering Single File HTML of $(nochunk_arch)..."
    59         @xsltproc --xinclude --nonet -stringparam profile.condition html --output $(BASEDIR)/CLFS-BOOK-$(nochunk_arch).html $(PWD)/stylesheets/lfs-nochunks.xsl $(nochunk_arch)-index.xml
     98        $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
     99          --output $(BASEDIR)/CLFS-EMBEDDED-$(nochunk_arch).html \
     100          $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(nochunk_arch)-html.xml
    60101
    61 pdf: $(ARCHS_PDF)
     102        @echo "Running Tidy..."
     103        $(Q)tidy -config $(PWD)/tidy.conf $(BASEDIR)/CLFS-EMBEDDED-$(nochunk_arch).html || true
     104        @echo "Running obfuscate.sh..."
     105        $(Q)sh $(PWD)/obfuscate.sh $(BASEDIR)/CLFS-EMBEDDED-$(nochunk_arch).html
     106        $(Q)sed -i -e "s@text/html@application/xhtml+xml@g"  \
     107          $(BASEDIR)/CLFS-EMBEDDED-$(nochunk_arch).html
     108
     109pdf: tmpdir $(ARCHS_PDF)
    62110
    63111$(ARCHS_PDF): override pdf_arch =  $(@:%$(S)pdf=%)
    64112$(ARCHS_PDF):
     113        @echo "Validating $(pdf_arch) book..."
     114        $(Q)xmllint --nonet --noent --xinclude --postvalid \
     115          -o $(RENDERTMP)/$(pdf_arch)-full.xml $(PWD)/$(pdf_arch)-index.xml
     116
     117        @echo "Generating profiled $(pdf_arch) book for PDF..."
     118        $(Q)xsltproc --nonet --stringparam profile.condition pdf \
     119          --output $(RENDERTMP)/$(pdf_arch)-pdf.xml \
     120          $(PWD)/stylesheets/lfs-xsl/profile.xsl \
     121          $(RENDERTMP)/$(pdf_arch)-full.xml
     122
     123        @echo "Generating FO file of $(pdf_arch)..."
     124        $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
     125          --output $(RENDERTMP)/$(pdf_arch).fo $(PWD)/stylesheets/clfs-pdf.xsl \
     126          $(RENDERTMP)/$(pdf_arch)-pdf.xml
     127        $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/$(pdf_arch).fo
     128
    65129        @echo "Rendering PDF of $(pdf_arch)..."
    66         @xsltproc --xinclude --nonet --output $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo $(PWD)/stylesheets/lfs-pdf.xsl $(pdf_arch)-index.xml
    67         @sed -i -e "s/inherit/all/" $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo
    68         @fop.sh -q -fo $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo -pdf $(BASEDIR)/CLFS-BOOK-$(pdf_arch).pdf
    69         @rm $(BASEDIR)/clfs-$(pdf_arch)-pdf.fo
    70 
    71 text: $(ARCHS_TEXT)
    72 
    73 $(ARCHS_TEXT): override text_arch =  $(@:%$(S)text=%)
    74 $(ARCHS_TEXT):
    75         @echo "Rendering Text of $(text_arch)..."
    76         @xsltproc --xinclude --nonet --output $(BASEDIR)/clfs-$(text_arch)-text.fo $(PWD)/stylesheets/lfs-pdf.xsl $(text_arch)-index.xml
    77         @sed -i -e "s/inherit/all/" $(BASEDIR)/clfs-$(text_arch)-text.fo ; \
    78         @fop.sh -q -fo $(BASEDIR)/clfs-$(text_arch)-text.fo -txt $(BASEDIR)/CLFS-BOOK-$(text_arch).txt ; \
    79         @rm $(BASEDIR)/clfs-$(text_arch)-text.fo
     130        $(Q)fop $(RENDERTMP)/$(pdf_arch).fo $(BASEDIR)/CLFS-EMBEDDED-$(pdf_arch).pdf
    80131
    81132validate: $(ARCHS_VALIDATE)
     
    84135$(ARCHS_VALIDATE):
    85136        @echo "Validating $(validate_arch)..."
    86         @xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml
     137        $(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(validate_arch)-index.xml
    87138
    88139trouble: $(ARCHS_TROUBLE)
     
    91142$(ARCHS_TROUBLE):
    92143        @echo "Troubleshooting $(trouble_arch)..."
    93         @xmllint --xinclude --nonet --postvalid $(PWD)/$(trouble_arch)-index.xml > /tmp/dump-$(trouble_arch)
    94         @xmllint --xinclude --noout --nonet --valid /tmp/dump-$(trouble_arch)
    95         @echo "You can now look at /tmp/dump-$(trouble_arch) to see the errors"
     144        $(Q)xmllint --xinclude --nonet --postvalid \
     145          -o $(RENDERTMP)/dump-$(trouble_arch) $(PWD)/$(trouble_arch)-index.xml
     146        $(Q)xmllint --xinclude --noout --nonet --valid $(RENDERTMP)/dump-$(trouble_arch)
     147        @echo "You can now look at $(RENDERTMP)/dump-$(trouble_arch) to see the errors"
    96148
    97149dump-commands: $(ARCHS_DUMP)
     
    100152$(ARCHS_DUMP):
    101153        @echo "Extracting commands from $(dump_arch)..."
    102         @xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ $(PWD)/stylesheets/dump-commands.xsl $(dump_arch)-index.xml
     154        $(Q)xsltproc --xinclude --nonet --output $(DUMPDIR)/$(dump_arch)/ \
     155          $(PWD)/stylesheets/dump-commands.xsl $(PWD)/$(dump_arch)-index.xml
    103156
    104157download-list: $(ARCHS_DLLIST)
     
    107160$(ARCHS_DLLIST):
    108161        @echo "Creating download list for $(dllist_arch)..."
    109         @xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch).dl.list $(PWD)/stylesheets/wget.xsl $(dllist_arch)-index.xml
     162        $(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(dllist_arch).dl.list \
     163          $(PWD)/stylesheets/wget.xsl $(PWD)/$(dllist_arch)-index.xml
    110164
    111165help:
     
    118172        @echo "PDF Targets"
    119173        @echo -e "  \e[0;32mpdf \e[0;34m$(ARCHS_PDF)\e[0;0m"
    120         @echo
    121         @echo "Text Targets"
    122         @echo -e "  \e[0;32mtext \e[0;34m$(ARCHS_TEXT)\e[0;0m"
    123174        @echo
    124175        @echo "Validate Targets"
  • BOOK/stylesheets/top-index.xsl

    rc2f4c89 r122ebf0  
    1919        <style type="text/css">
    2020          <xsl:text>
     21/* Global settings */
    2122body {
    22   font-family: sans-serif;
     23  font-family: verdana, tahoma, helvetica, arial, sans-serif;
    2324  text-align: left;
    2425  background: #fff;
    25   color: #333;
     26  color: #222;
    2627  margin: 1em;
    2728  padding: 0;
     
    3132
    3233a:link { color: #22b; }
    33 a:visited { color: #7e4988; }
    34 a:hover, a:focus { color: #d30e08; }
    35 a:active { color: #6b77b1;}
     34a.ulink:link { font-weight: bold; color: #55f; }
     35a:visited { color: #7e4988 ! important; }
     36a:hover, a:focus { color: #d30e08 ! important; }
     37a:active { color: #6b77b1 ! important;}
    3638
    37 h1, h2 {
     39h1, h2 h3, h4 {
    3840  color: #000;
    3941  font-weight: bold;
    40 }
    41 
    42 h3, h4, h5, h6 {
    43   color: #222;
     42  line-height: 1em;
    4443}
    4544
    4645h1 { font-size: 173%; text-align: center; }
    47 h2 { font-size: 144%;  text-align: center; }
    48 h3 { font-size: 120%; padding-top: 0.2em; margin-top: 0.3em; }
    49 h4 { font-size: 110%;}
     46h2 { font-size: 144%; text-align: center; }
     47h3 { font-size: 120%; }
     48h4 { font-size: 110%; }
    5049
    51 div.toc {
     50.toc {
    5251  padding-left: 1em;
    53   margin-top: 1em;
    5452}
    5553
    56 div.toc ul li h3, div.toc ul li h4 {
     54.toc ul li h3, .toc ul li h4 {
    5755  margin: .4em;
    5856}
    5957
    60 div.book {
    61   padding-bottom: 0.5em;
    62 }
    63 
    64 div.book h1 {
     58.book h1 {
    6559  background: #f5f6f7;
    6660  margin: 0px auto;
     
    6862}
    6963
    70 div.book h2 {
     64.book h2 {
    7165  background: #dbddec;
    7266  margin: 0px auto;
    7367  padding: 0.2em;
    7468}
    75 div.authorgroup, div p.copyright {
     69.author, .copyright {
    7670  background: #f5f6f7;
    7771  margin: 0px auto;
    78   padding:  1em 0.5em;
     72  padding: 0.5em 1em;
    7973}
    8074
     
    9791  <xsl:template match="bookinfo">
    9892    <div class="book">
    99       <div class="titlepage">
    100         <xsl:apply-templates/>
    101         <hr/>
    102       </div>
     93      <xsl:apply-templates/>
     94      <hr/>
    10395      <div class="toc">
    10496        <h3>
     
    140132
    141133  <xsl:template match="title">
    142     <div>
    143       <h1 class="title">
    144         <xsl:value-of select="."/>
    145       </h1>
    146     </div>
    147     <div>
    148       <h2 class="subtitle">
    149         <xsl:text>Version &version;</xsl:text>
    150       </h2>
    151     </div>
     134    <h1 class="title">
     135      <xsl:value-of select="."/>
     136    </h1>
     137    <h2 class="subtitle">
     138      <xsl:text>Version &version;</xsl:text>
     139    </h2>
    152140  </xsl:template>
    153141
    154142  <xsl:template match="authorgroup">
    155     <div class="authorgroup">
    156       <h3 class="author">
    157         <xsl:value-of select="author[1]/firstname"/>
    158         <xsl:text> </xsl:text>
    159         <xsl:value-of select="author[1]/surname"/>
    160       </h3>
    161       <h3 class="author">
    162         <xsl:value-of select="author[2]/firstname"/>
    163         <xsl:text> </xsl:text>
    164         <xsl:value-of select="author[2]/surname"/>
    165       </h3>
    166       <h3 class="author">
    167         <xsl:value-of select="author[3]/firstname"/>
    168         <xsl:text> </xsl:text>
    169         <xsl:value-of select="author[3]/surname"/>
    170       </h3>
    171     </div>
     143    <h3 class="author">
     144      <xsl:value-of select="author[1]/firstname"/>
     145      <xsl:text> </xsl:text>
     146      <xsl:value-of select="author[1]/surname"/>
     147    </h3>
     148    <h3 class="author">
     149      <xsl:value-of select="author[2]/firstname"/>
     150      <xsl:text> </xsl:text>
     151      <xsl:value-of select="author[2]/surname"/>
     152    </h3>
     153    <h3 class="author">
     154      <xsl:value-of select="author[3]/firstname"/>
     155      <xsl:text> </xsl:text>
     156      <xsl:value-of select="author[3]/surname"/>
     157    </h3>
    172158  </xsl:template>
    173159
    174160  <xsl:template match="copyright">
    175     <div>
    176       <p class="copyright">
    177         <xsl:text>Copyright ©</xsl:text>
    178         <xsl:apply-templates/>
    179       </p>
    180     </div>
     161    <p class="copyright">
     162      <xsl:text>Copyright ©</xsl:text>
     163      <xsl:apply-templates/>
     164    </p>
    181165  </xsl:template>
    182166
     
    190174
    191175  <xsl:template match="bibliosource">
    192     <div>
    193       <p class="copyright">
    194         <em>
    195           <xsl:apply-templates/>
    196         </em>
    197       </p>
    198     </div>
     176    <p class="copyright">
     177      <em>
     178        <xsl:apply-templates/>
     179      </em>
     180    </p>
    199181  </xsl:template>
    200182
Note: See TracChangeset for help on using the changeset viewer.