Replace sed-based customization with XSLT import

fix boostorg/docca#40
This commit is contained in:
Evan Lenz
2021-02-25 12:54:48 -08:00
parent 3a1efd2078
commit d157311620
6 changed files with 23 additions and 40 deletions

View File

@ -101,26 +101,13 @@ make common.xsl : $(docca)/include/docca/common.xsl
make stage1.xsl : $(docca)/include/docca/stage1.xsl : @copy_script ;
make base-stage1.xsl : $(docca)/include/docca/base-stage1.xsl : @copy_script ;
make stage2.xsl : $(docca)/include/docca/stage2.xsl : @copy_script ;
make base-stage2.xsl : $(docca)/include/docca/base-stage2.xsl : @copy_script ;
make assemble-quickbook.xsl : $(docca)/include/docca/assemble-quickbook.xsl : @copy_script ;
make emphasized-types.xsl : $(docca)/include/docca/emphasized-types.xsl : @copy_script ;
make base-config.xsl : $(docca)/include/docca/base-config.xsl : @copy_script ;
make config.xsl
:
$(docca)/include/docca/config.xsl
xsl/config.xsl
xsl/class_detail.xsl
xsl/includes.xsl
:
@make_config
;
actions make_config
{
cp $(2[1]) $(1)
sed -i -e "/<!-- CONFIG_TEMPLATE -->/{r $(2[2])" -e "d}" $(1)
sed -i -e "/<!-- CLASS_DETAIL_TEMPLATE -->/{r $(2[3])" -e "d}" $(1)
sed -i -e "/<!-- INCLUDES_TEMPLATE -->/{r $(2[4])" -e "d}" $(1)
}
# Copy the project-specific config XSLT
make custom-overrides.xsl : xsl/custom-overrides.xsl : @copy_script ;
# Make a copy of the given file.
#
@ -145,7 +132,8 @@ make xml-pages.xml
# Make bjam aware of additional dependencies
base-extract-xml-pages.xsl
config.xsl
base-config.xsl
custom-overrides.xsl
common.xsl
:
saxonhe.saxonhe
@ -176,7 +164,8 @@ make stage1/results
# additional dependencies
xml-pages.xml
base-stage1.xsl
config.xsl
base-config.xsl
custom-overrides.xsl
common.xsl
:
saxonhe.saxonhe_dir
@ -189,6 +178,10 @@ make stage2/results
# additional dependencies
emphasized-types.xsl
base-stage2.xsl
base-config.xsl
custom-overrides.xsl
common.xsl
:
saxonhe.saxonhe_dir
;

View File

@ -1,3 +0,0 @@
<!-- CLASS_DETAIL_TEMPLATE BEGIN -->
<xsl:when test="$normal-tparam = 'InputIterator'"><xsl:text>__InputIterator__</xsl:text></xsl:when>
<!-- CLASS_DETAIL_TEMPLATE END -->

View File

@ -1,6 +0,0 @@
<!-- Variables (Edit for your project) -->
<xsl:variable name="doc-ref" select="'static_string.ref'"/>
<xsl:variable name="doc-ns" select="'boost::static_strings'"/>
<xsl:variable name="debug" select="0"/>
<xsl:variable name="include-private-members" select="false()"/>
<!-- End Variables -->

View File

@ -0,0 +1,11 @@
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
expand-text="yes">
<xsl:variable name="doc-ref" select="'static_string.ref'"/>
<xsl:variable name="doc-ns" select="'boost::static_strings'"/>
<xsl:variable name="include-private-members" select="false()"/>
</xsl:stylesheet>

View File

@ -1,5 +0,0 @@
<!-- INCLUDES_TEMPLATE BEGIN -->
<xsl:text>Defined in header [include_file </xsl:text>
<xsl:value-of select="substring-after($file,'include/')"/>
<xsl:text>]&#xd;&#xd;</xsl:text>
<!-- INCLUDES_TEMPLATE END -->

View File

@ -1,7 +0,0 @@
<!-- INCLUDES_FOOT_TEMPLATE BEGIN -->
<xsl:choose>
<xsl:when test="contains($file, 'supercalifragilisticexpialidocious')">
<xsl:text>&#xd;&#xd;Easter Egg&#xd;</xsl:text>
</xsl:when>
</xsl:choose>
<!-- INCLUDES_FOOT_TEMPLATE END -->