Changeset 5c560cb


Ignore:
Timestamp:
Apr 23, 2011, 2:45:35 PM (13 years ago)
Author:
Joe Ciccone <jciccone@…>
Children:
d10f81a
Parents:
5f27dfa
Message:

This is the first part of the 2nd format to use as a simplification.
This format proposes using a completely custom stylesheet. Instead
of trying to merge together with docbook. The first attempt works it
is just extremely problematic. This is much easier, and it is the goal
anyway.

Location:
BOOK
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • BOOK/schema/clfs/0.1/rng/clfs.rnc

    r5f27dfa r5c560cb  
    1313       | refentry.class+
    1414       | sect2+
    15          | simplesect+),
    16     nav.class*
    17     } | clfs.sect1.package )
     15       | simplesect+),
     16      nav.class*
     17    } | clfs.sect.package )
    1818}
    1919
     
    2424  clfs.attrib.multilib
    2525
    26 # Custom attributes unsed in this schema
     26# Profiling Attributes
    2727clfs.attrib.arch = attribute c:arch { text }?
    2828clfs.attrib.bits = attribute c:bits { text }?
    2929clfs.attrib.multilib = attribute c:multilib { "true" | "false" }?
    30 clfs.attrib.multibuild = attribute c:multibuild { "true" | "false" }
    3130
    32 # Package element to be used inside of the chapter element
    33 clfs.sect1.package =
     31# Inline Elements
     32
     33clfs.inline =
     34  (clfs.inline.strong |
     35   clfs.inline.dirname |
     36   clfs.inline.filename |
     37   clfs.inline.command |
     38   text)+
     39
     40clfs.inline.strong =
     41  element c:strong {
     42    clfs.inline
     43  }
     44clfs.inline.dirname =
     45  element c:dirname {
     46    clfs.inline
     47  }
     48clfs.inline.filename =
     49  element c:filename {
     50    clfs.inline
     51  }
     52clfs.inline.command =
     53  element c:command {
     54    clfs.inline
     55  }
     56
     57# Block Elements
     58
     59clfs.block.para =
     60  element c:para {
     61    clfs.inline
     62  }
     63 
     64clfs.block.note =
     65  element c:note {
     66    clfs.block.para*
     67  }
     68
     69clfs.block.command =
     70  element c:command {
     71    clfs.attrib.arch,
     72    clfs.attrib.bits,
     73    clfs.attrib.multilib,
     74    attribute c:nodump {
     75      "true" | "false"
     76    }?,
     77    (element c:literal { text } | text)+
     78  }
     79
     80# The Package
     81clfs.sect.package =
    3482  element c:package {
    3583    attribute id { text },
     
    3785    clfs.attrib.bits,
    3886    clfs.attrib.multilib,
    39     clfs.attrib.multibuild,
    40     sect1
     87    attribute c:multibuild {
     88      "true" | "false"
     89    },
     90   
     91    element c:title { text },
     92    element c:version { text },
     93    element c:description { clfs.inline },
     94   
     95    element c:install {
     96      (clfs.block.para |
     97       clfs.block.command |
     98       clfs.block.note)+
     99    }+
    41100  }
    42 
    43 # Switch case to be used inside of a sect1
    44 clfs.sect1.switch =
    45   element c:switch {
    46     element c:case {
    47       clfs.attrib.arch,
    48       clfs.attrib.bits,
    49       clfs.attrib.multilib
    50     }*,
    51     element c:default {
    52       empty
    53     }
    54   }
  • BOOK/schema/clfs/0.1/rng/clfs.rng

    r5f27dfa r5c560cb  
    4545          </zeroOrMore>
    4646        </element>
    47         <ref name="clfs.sect1.package"/>
     47        <ref name="clfs.sect.package"/>
    4848      </choice>
    4949    </define>
     
    5555    <ref name="clfs.attrib.multilib"/>
    5656  </define>
    57   <!-- Custom attributes unsed in this schema -->
     57  <!-- Profiling Attributes -->
    5858  <define name="clfs.attrib.arch">
    5959    <optional>
     
    7676    </optional>
    7777  </define>
    78   <define name="clfs.attrib.multibuild">
    79     <attribute name="c:multibuild">
     78  <!-- Inline Elements -->
     79  <define name="clfs.inline">
     80    <oneOrMore>
    8081      <choice>
    81         <value>true</value>
    82         <value>false</value>
     82        <ref name="clfs.inline.strong"/>
     83        <ref name="clfs.inline.dirname"/>
     84        <ref name="clfs.inline.filename"/>
     85        <ref name="clfs.inline.command"/>
     86        <text/>
    8387      </choice>
    84     </attribute>
     88    </oneOrMore>
    8589  </define>
    86   <!-- Package element to be used inside of the chapter element -->
    87   <define name="clfs.sect1.package">
     90  <define name="clfs.inline.strong">
     91    <element name="c:strong">
     92      <ref name="clfs.inline"/>
     93    </element>
     94  </define>
     95  <define name="clfs.inline.dirname">
     96    <element name="c:dirname">
     97      <ref name="clfs.inline"/>
     98    </element>
     99  </define>
     100  <define name="clfs.inline.filename">
     101    <element name="c:filename">
     102      <ref name="clfs.inline"/>
     103    </element>
     104  </define>
     105  <define name="clfs.inline.command">
     106    <element name="c:command">
     107      <ref name="clfs.inline"/>
     108    </element>
     109  </define>
     110  <!-- Block Elements -->
     111  <define name="clfs.block.para">
     112    <element name="c:para">
     113      <ref name="clfs.inline"/>
     114    </element>
     115  </define>
     116  <define name="clfs.block.note">
     117    <element name="c:note">
     118      <zeroOrMore>
     119        <ref name="clfs.block.para"/>
     120      </zeroOrMore>
     121    </element>
     122  </define>
     123  <define name="clfs.block.command">
     124    <element name="c:command">
     125      <ref name="clfs.attrib.arch"/>
     126      <ref name="clfs.attrib.bits"/>
     127      <ref name="clfs.attrib.multilib"/>
     128      <optional>
     129        <attribute name="c:nodump">
     130          <choice>
     131            <value>true</value>
     132            <value>false</value>
     133          </choice>
     134        </attribute>
     135      </optional>
     136      <oneOrMore>
     137        <choice>
     138          <element name="c:literal">
     139            <text/>
     140          </element>
     141          <text/>
     142        </choice>
     143      </oneOrMore>
     144    </element>
     145  </define>
     146  <!-- The Package -->
     147  <define name="clfs.sect.package">
    88148    <element name="c:package">
    89149      <attribute name="id"/>
     
    91151      <ref name="clfs.attrib.bits"/>
    92152      <ref name="clfs.attrib.multilib"/>
    93       <ref name="clfs.attrib.multibuild"/>
    94       <ref name="sect1"/>
    95     </element>
    96   </define>
    97   <!-- Switch case to be used inside of a sect1 -->
    98   <define name="clfs.sect1.switch">
    99     <element name="c:switch">
    100       <zeroOrMore>
    101         <element name="c:case">
    102           <ref name="clfs.attrib.arch"/>
    103           <ref name="clfs.attrib.bits"/>
    104           <ref name="clfs.attrib.multilib"/>
     153      <attribute name="c:multibuild">
     154        <choice>
     155          <value>true</value>
     156          <value>false</value>
     157        </choice>
     158      </attribute>
     159      <element name="c:title">
     160        <text/>
     161      </element>
     162      <element name="c:version">
     163        <text/>
     164      </element>
     165      <element name="c:description">
     166        <ref name="clfs.inline"/>
     167      </element>
     168      <oneOrMore>
     169        <element name="c:install">
     170          <oneOrMore>
     171            <choice>
     172              <ref name="clfs.block.para"/>
     173              <ref name="clfs.block.command"/>
     174              <ref name="clfs.block.note"/>
     175            </choice>
     176          </oneOrMore>
    105177        </element>
    106       </zeroOrMore>
    107       <element name="c:default">
    108         <empty/>
    109       </element>
     178      </oneOrMore>
    110179    </element>
    111180  </define>
  • BOOK/stylesheets/clfs-profile.xsl

    r5f27dfa r5c560cb  
    7272    <xsl:param name="bits" /> <!-- Which bit sizes to create a package for -->
    7373    <xsl:param name="multibuild" /> <!-- Are there multiple instances of this package? -->
    74 
     74   
     75    <!-- Translate the package into a sect1 -->
     76    <xsl:element name="sect1">
     77     
     78      <!-- Set the ID of the target Sect1 -->
     79      <xsl:attribute name="id">
     80        <xsl:value-of select="concat($id, $idsuffix)" />
     81      </xsl:attribute> 
     82     
     83      <!-- New Line -->
     84      <xsl:text>
     85</xsl:text>
     86     
     87      <!-- Set the Target Filename -->
     88      <xsl:processing-instruction name="dbhtml">
     89        <xsl:text>filename=&quot;</xsl:text>
     90        <xsl:value-of select="concat($id, $idsuffix)" />
     91        <xsl:text>.html&quot;</xsl:text>
     92      </xsl:processing-instruction>
     93     
     94      <!-- New Line x2 -->
     95      <xsl:text>
     96
     97</xsl:text>
     98     
     99      <!-- Determine if the title is going to have a suffix or not -->
     100      <xsl:variable name="titlesuffix">
     101        <xsl:if test="contains($clfs.multilib, ',') and ($multibuild = 'true')">
     102          <xsl:choose>
     103            <xsl:when test="$bits = '32'">
     104              <xsl:text>32Bit</xsl:text>
     105            </xsl:when>
     106            <xsl:when test="$bits = 'n32'">
     107              <xsl:text>N32</xsl:text>
     108            </xsl:when>
     109            <xsl:when test="$bits = '64'">
     110              <xsl:text>64Bit</xsl:text>
     111            </xsl:when>
     112          </xsl:choose>
     113        </xsl:if>
     114      </xsl:variable>
     115     
     116      <!-- title: Write out a new title tag -->
     117      <xsl:element name="title">
     118        <xsl:value-of select="c:title" />
     119        <xsl:text>-</xsl:text>
     120        <xsl:value-of select="c:version" />
     121        <xsl:if test="string-length($titlesuffix) > 0">
     122          <xsl:text> - </xsl:text>
     123          <xsl:value-of select="$titlesuffix"/>
     124        </xsl:if>
     125      </xsl:element><!-- title -->
     126
     127      <!-- New Line x2 -->
     128      <xsl:text>
     129
     130</xsl:text>
     131
     132      <!-- indexterm: Add the Intex Entry for this package -->
     133      <xsl:element name="indexterm">
     134        <xsl:attribute name="zone">
     135          <xsl:value-of select="concat($id, $idsuffix)" />
     136        </xsl:attribute>
     137        <xsl:text>
     138  </xsl:text>
     139        <xsl:element name="primary">
     140          <xsl:attribute name="sortas">
     141            <xsl:text>a-</xsl:text>
     142            <xsl:value-of select="c:title" />
     143          </xsl:attribute>
     144          <xsl:value-of select="c:title" />
     145        </xsl:element>
     146        <xsl:if test="string-length($titlesuffix) > 0">
     147          <xsl:text>
     148  </xsl:text>
     149          <xsl:element name="secondary">
     150            <xsl:value-of select="$titlesuffix" />
     151          </xsl:element>
     152        </xsl:if>
     153        <xsl:text>
     154</xsl:text>
     155      </xsl:element><!-- indexterm -->
     156     
     157      <!-- New Line x2 -->
     158      <xsl:text>
     159
     160</xsl:text>
     161
     162      <!-- sect2[role="installation"]: Add the sect2 for the package header -->
     163      <xsl:element name="sect2">
     164        <xsl:attribute name="role">
     165          <xsl:text>installation</xsl:text>
     166        </xsl:attribute>
     167        <xsl:text>
     168  </xsl:text>
     169        <xsl:element name="title" />
     170        <xsl:text>
     171  </xsl:text>
     172        <xsl:element name="para">
     173          <xsl:copy-of select="c:description/@*|c:description/node()" />
     174        </xsl:element>
     175        <xsl:text>
     176</xsl:text>
     177      </xsl:element>
     178
     179      <!-- New Line x2 -->
     180      <xsl:text>
     181
     182</xsl:text>
     183
     184    </xsl:element><!-- Sect1 -->
     185   
     186<!--
    75187    <xsl:for-each select="sect1">
    76188
     
    146258
    147259    </xsl:for-each>
     260-->
    148261
    149262  </xsl:template>
  • BOOK/testpart.xml

    r5f27dfa r5c560cb  
    2121      </sect1>
    2222
    23       <c:package id="blah" c:multibuild="false">
    24         <sect1>
    25           <title><phrase>Blah</phrase></title>
     23<c:package id="ch-system-bash" c:multibuild="false">
     24  <c:title>Bash</c:title>
     25  <c:version>4.0.1</c:version>
     26  <c:description>The Bash package contains the Bourne-Again SHell.</c:description>
    2627
    27           <para>Testing... 1.. 2.. 3..</para>
     28  <c:install>
    2829
    29           <para c:bits="32">32</para>
    30           <para c:bits="n32">n32</para>
    31           <para c:bits="64">64</para>
     30    <c:para>Apply this patch</c:para>
    3231
    33         </sect1>
    34       </c:package>
     32<c:command>patch -Np1 -i ../&bash-branch_update-patch;</c:command>
    3533
    36       <c:package id="blarg" c:multibuild="true">
    37         <sect1>
    38           <title>Blarg</title>
     34    <c:para>Prepare the package for compilation</c:para>
    3935
    40           <para>Testing... 1.. 2.. 3..</para>
     36<c:command>./configure -prefix=/usr -bindir=/bin \
     37    -without-bash-malloc -with-installed-readline</c:command>
    4138
    42           <para c:multilib="true" c:bits="64">This is for 64bit multilib only</para>
     39    <c:para>Compile the package:</c:para>
    4340
    44           <para c:bits="32,n32">Only 32,N32</para>
     41<c:command>make</c:command>
    4542
    46 <screen c:bits="32"><userinput>echo 32bit Build</userinput></screen>
     43    <c:para>To test the results, issue:
     44    <c:command>make tests</c:command>.</c:para>
    4745
    48 <screen c:bits="32"><userinput>cat &lt;&lt; "EOF"
    49 <literal>Another
    50 32bit
    51 Command</literal>
    52 EOF</userinput></screen>
     46    <c:para>Install the package:</c:para>
    5347
    54           <para c:bits="64">Only 64</para>
     48<c:command>make htmldir=/usr/share/doc/bash-&bash-version; install</c:command>
    5549
    56 <screen c:bits="64"><userinput>echo 64bit Build</userinput></screen>
     50    <c:para>Run the newly compiled <c:command>bash</c:command> program (replacing
     51    the one that is currently being executed):</c:para>
    5752
    58           <sect2>
    59             <title>Hi There</title>
     53<c:command c:nodump="true">exec /bin/bash -login +h</c:command>
    6054
    61             <para>You should always see me</para>
     55    <c:note>
     56      <c:para>(note+warn) The parameters used make the <c:command>bash</c:command>
     57      process an interactive login shell and continue to disable hashing so
     58      that new programs are found as they become available.</c:para>
     59    </c:note>
    6260
    63             <para c:bits="32" c:multilib="true">You will only see me on multilib 32bit</para>
    64           </sect2>
     61  </c:install>
    6562
    66         </sect1>
    67       </c:package>
     63</c:package>
     64
     65
     66<c:package id="ch-system-test" c:multibuild="true">
     67  <c:title>TestPackage</c:title>
     68  <c:version>1.2.3</c:version>
     69  <c:description>The <c:strong>Test</c:strong> package contains a test.</c:description>
     70
     71  <c:install>
     72
     73    <c:para>Prepare the package for compilation</c:para>
     74
     75<c:command c:multilib="false">./configure --prefix=/usr</c:command>
     76<c:command c:multilib="true" c:bits="32">CC="gcc ${BUILD32}" ./configure --prefix=/usr</c:command>
     77<c:command c:multilib="true" c:bits="n32">CC="gcc ${BUILDN32}" ./configure --prefix=/usr</c:command>
     78<c:command c:multilib="true" c:bits="64">CC="gcc ${BUILD64}" ./configure --prefix=/usr</c:command>
     79
     80    <c:para>Compile the package:</c:para>
     81
     82<c:command>make</c:command>
     83
     84    <c:para>To test the results, issue:
     85    <c:command>make tests</c:command>.</c:para>
     86
     87    <c:para>Install the package:</c:para>
     88
     89<c:command>make install</c:command>
     90
     91  </c:install>
     92
     93</c:package>
    6894
    6995    </chapter>
Note: See TracChangeset for help on using the changeset viewer.