Replace sed-based customization with XSLT import

fix boostorg/docca#40
This commit is contained in:
Evan Lenz
2021-02-17 16:34:05 -08:00
parent 64d8d8618c
commit 6c6d6a1d6e
5 changed files with 31 additions and 69 deletions

View File

@@ -100,25 +100,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 "/<!-- INCLUDES_FOOT_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.
#
@@ -143,7 +131,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
@@ -174,7 +163,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
@@ -187,6 +177,10 @@ make stage2/results
# additional dependencies
emphasized-types.xsl
base-stage2.xsl
base-config.xsl
custom-overrides.xsl
common.xsl
:
saxonhe.saxonhe_dir
;
@@ -309,4 +303,4 @@ alias boostdoc ;
explicit boostdoc ;
alias boostrelease : beast ;
explicit boostrelease ;
explicit boostrelease ;

View File

@@ -1,36 +0,0 @@
<!-- CLASS_DETAIL_TEMPLATE BEGIN -->
<xsl:when test="$normal-tparam = 'Allocator'"> <xsl:text>__Allocator__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'AsyncStream'"> <xsl:text>__AsyncStream__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'AsyncReadStream'"> <xsl:text>__AsyncReadStream__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'AsyncWriteStream'"> <xsl:text>__AsyncWriteStream__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Body'"> <xsl:text>__Body__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'BufferSequence'"> <xsl:text>__BufferSequence__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'BufferSequence'"> <xsl:text>__BufferSequence__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'CompletionCondition'"> <xsl:text>__CompletionCondition__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'CompletionHandler'"> <xsl:text>__CompletionHandler__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'CompletionToken'"> <xsl:text>__CompletionToken__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'ConnectCondition'"> <xsl:text>__ConnectCondition__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'ConnectHandler'"> <xsl:text>__ConnectHandler__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'ConstBufferSequence'"> <xsl:text>__ConstBufferSequence__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'DynamicBuffer'"> <xsl:text>__DynamicBuffer__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'EndpointSequence'"> <xsl:text>__EndpointSequence__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'ExecutionContext'"> <xsl:text>__ExecutionContext__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Executor'"> <xsl:text>__Executor__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Executor_'"> <xsl:text>__Executor__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Executor1'"> <xsl:text>__Executor1__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Executor2'"> <xsl:text>__Executor2__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Fields'"> <xsl:text>__Fields__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Handler'"> <xsl:text>__Handler__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Handler_'"> <xsl:text>__Handler__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'IteratorConnectHandler'"> <xsl:text>__IteratorConnectHandler__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'MutableBufferSequence'"> <xsl:text>__MutableBufferSequence__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Protocol'"> <xsl:text>__Protocol__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'RangeConnectHandler'"> <xsl:text>__RangeConnectHandler__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'RatePolicy'"> <xsl:text>__RatePolicy__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'ReadHandler'"> <xsl:text>__ReadHandler__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'Stream'"> <xsl:text>__Stream__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'SyncStream'"> <xsl:text>__SyncStream__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'SyncReadStream'"> <xsl:text>__SyncReadStream__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'SyncWriteStream'"> <xsl:text>__SyncWriteStream__</xsl:text></xsl:when>
<xsl:when test="$normal-tparam = 'WriteHandler'"> <xsl:text>__WriteHandler__</xsl:text></xsl:when>
<!-- CLASS_DETAIL_TEMPLATE END -->

View File

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

View File

@@ -0,0 +1,18 @@
<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="'beast.ref'"/>
<xsl:variable name="doc-ns" select="'boost::beast'"/>
<xsl:variable name="include-private-members" select="false()"/>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/core')]" >core.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/http')]" >http.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/ssl')]" >ssl.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/websocket')]">websocket.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/zlib')]" >zlib.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file"/>
</xsl:stylesheet>

View File

@@ -1,8 +0,0 @@
<!-- INCLUDES_FOOT_TEMPLATE BEGIN -->
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/core')]" >core.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/http')]" >http.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/ssl')]" >ssl.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/websocket')]">websocket.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file[contains(., 'boost/beast/zlib')]" >zlib.hpp</xsl:template>
<xsl:template mode="convenience-header" match="@file"/>
<!-- INCLUDES_FOOT_TEMPLATE END -->