Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Bootstrap 5.2 #46

Merged
merged 16 commits into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dita-ot/header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<li class="nav-item">
<a
class="nav-link"
href="https://getbootstrap.com/docs/5.1"
href="https://getbootstrap.com/docs/5.2"
>Bootstrap Docs</a>
</li>
</ul>
Expand Down
13 changes: 13 additions & 0 deletions .github/dita-ot/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ footer {
margin: 1rem -0.75rem 0;
border: solid #dee2e6 1px;
}

.custom-popover {
--bs-popover-max-width: 200px;
--bs-popover-border-color: var(--bs-primary);
--bs-popover-header-bg: var(--bs-primary);
--bs-popover-header-color: var(--bs-white);
--bs-popover-body-padding-x: 1rem;
--bs-popover-body-padding-y: 0.5rem;
}

.custom-tooltip {
--bs-tooltip-bg: var(--bs-primary);
}
2 changes: 1 addition & 1 deletion Customization/xsl/accordion.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Accordion Component -->
<!-- https://getbootstrap.com/docs/5.1/components/accordion/ -->
<!-- https://getbootstrap.com/docs/5.2/components/accordion/ -->

<xsl:template match="*[contains(@class,' topic/bodydiv ') and contains(@outputclass, 'accordion')]">
<div>
Expand Down
2 changes: 1 addition & 1 deletion Customization/xsl/breadcrumb.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exclude-result-prefixes="xs dita-ot ditamsg"
>
<!-- Override to add Bootstrap breadcrumb component -->
<!-- https://getbootstrap.com/docs/5.1/components/breadcrumb/ -->
<!-- https://getbootstrap.com/docs/5.2/components/breadcrumb/ -->

<!-- Whether include a bootstrap breadcrumb component on each page. values are 'yes' or 'no' -->
<xsl:param name="BREADCRUMBS" select="'no'"/>
Expand Down
2 changes: 1 addition & 1 deletion Customization/xsl/card.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<!-- Customization to add Bootstrap Card Component -->
<!-- https://getbootstrap.com/docs/5.1/components/card/ -->
<!-- https://getbootstrap.com/docs/5.2/components/card/ -->

<xsl:template match="*[contains(@class,' topic/section ') and contains(@outputclass, 'card')]">
<div>
Expand Down
2 changes: 1 addition & 1 deletion Customization/xsl/carousel.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Carousel Component -->
<!-- https://getbootstrap.com/docs/5.1/components/carousel/ -->
<!-- https://getbootstrap.com/docs/5.2/components/carousel/ -->

<xsl:template
match="*[ (contains(@class,' topic/ul ') or contains(@class, ' topic/ol ')) and contains(@outputclass, 'carousel')]"
Expand Down
8 changes: 4 additions & 4 deletions Customization/xsl/collapse.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Collapse Component -->
<!-- https://getbootstrap.com/docs/5.1/components/collapse/ -->
<!-- https://getbootstrap.com/docs/5.2/components/collapse/ -->

<xsl:template match="*[contains(@class,' topic/bodydiv ') and contains(@outputclass, 'collapse-horizontal')]">
<xsl:variable name="id" select="dita-ot:generate-html-id(.)"/>
<xsl:variable name="id" select="if(@id) then dita-ot:generate-html-id(.) else generate-id(.)"/>
<div>
<xsl:if test="contains(@otherprops, 'style(')">
<xsl:attribute name="style">
Expand Down Expand Up @@ -68,8 +68,8 @@

<!-- Override to connect an collapsed element to a button -->
<xsl:template match="*[contains(@class,' topic/xref ') and contains(@props, 'collapse-toggle')]">
<xsl:variable name="href" select="replace(@href, '#', '')"/>
<xsl:variable name="id" select="dita-ot:generate-html-id(//*[@id=$href])"/>
<xsl:variable name="href" select="substring-after(@href, '#')"/>
<xsl:variable name="id" select="if(//*[@id=$href]) then dita-ot:generate-html-id(//*[@id=$href]) else generate-id(//*[@id=$href])"/>

<a data-bs-toggle="collapse">
<xsl:call-template name="commonattributes"/>
Expand Down
10 changes: 6 additions & 4 deletions Customization/xsl/nav.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
</xsl:template>

<!-- list-group sidebar toc processing to add Bootstrap list-group menu -->
<!-- https://getbootstrap.com/docs/5.1/components/list-group/ -->
<!-- https://getbootstrap.com/docs/5.2/components/list-group/ -->

<!-- partial list-group sidebar toc processing -->
<xsl:template match="*[contains(@class, ' map/map ')]" mode="list-group-toc-pull">
Expand Down Expand Up @@ -232,7 +232,7 @@
</xsl:template>

<!-- nav-pill sidebar toc processing to add Bootstrap nav-pills menu -->
<!-- https://getbootstrap.com/docs/5.1/components/navs-tabs/ -->
<!-- https://getbootstrap.com/docs/5.2/components/navs-tabs/ -->

<!-- partial nav-pill sidebar toc processing -->
<xsl:template match="*[contains(@class, ' map/map ')]" mode="nav-pill-toc-pull">
Expand Down Expand Up @@ -262,7 +262,7 @@
</xsl:template>

<!-- collapsible sidebar toc processing to add Bootstrap collapsing menu classes -->
<!-- https://getbootstrap.com/docs/5.1/components/collapse/ -->
<!-- https://getbootstrap.com/docs/5.2/components/collapse/ -->
<xsl:template match="*" mode="collapsible-toc" priority="-10">
<xsl:param name="pathFromMaplist" as="xs:string"/>
<xsl:apply-templates select="*[contains(@class, ' map/topicref ')]" mode="collapsible-toc">
Expand All @@ -271,7 +271,7 @@
</xsl:template>

<!-- nav-pill menubar-toc submenu toc processing - a navbar with dropdowns -->
<!-- https://getbootstrap.com/docs/5.1/components/dropdowns/ -->
<!-- https://getbootstrap.com/docs/5.2/components/dropdowns/ -->
<xsl:template match="*" mode="menubar-toc" priority="-10">
<xsl:param name="pathFromMaplist" as="xs:string"/>
<xsl:apply-templates select="*[contains(@class, ' map/topicref ')]" mode="menubar-toc">
Expand Down Expand Up @@ -558,6 +558,8 @@
<xsl:when test="$BOOTSTRAP_MENUBAR_TOC = 'yes' and count(ancestor::*/@href) eq 0 and not($show-menu = 'show')">
<!-- no-op - if a menubar-toc is present, the nav-bar is reduced to current decendents only -->
</xsl:when>
<xsl:when test="not(.)">
</xsl:when>
<xsl:when test="normalize-space($title)">
<xsl:variable name="id" select="dita-ot:generate-html-id(.)"/>
<xsl:choose>
Expand Down
6 changes: 3 additions & 3 deletions Customization/xsl/offcanvas.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Offcanvas Component -->
<!-- https://getbootstrap.com/docs/5.1/components/offcanvas/ -->
<!-- https://getbootstrap.com/docs/5.2/components/offcanvas/ -->

<xsl:template match="*[contains(@class,' topic/section ') and contains(@outputclass, 'offcanvas-')]">
<xsl:param name="headLevel">
Expand Down Expand Up @@ -47,8 +47,8 @@

<!-- Override to connect an offcanvas to a button -->
<xsl:template match="*[contains(@class,' topic/xref ') and contains(@props, 'offcanvas-toggle')]">
<xsl:variable name="href" select="replace(@href, '#', '')"/>
<xsl:variable name="id" select="dita-ot:generate-html-id(../*[@id=$href])"/>
<xsl:variable name="href" select="substring-after(@href, '#')"/>
<xsl:variable name="id" select="if(//*[@id=$href]) then dita-ot:generate-html-id(//*[@id=$href]) else generate-id(//*[@id=$href])"/>

<a data-bs-toggle="offcanvas">
<xsl:call-template name="commonattributes"/>
Expand Down
2 changes: 1 addition & 1 deletion Customization/xsl/pagination.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<!-- Customization to add Bootstrap Pagination Component -->
<!-- https://getbootstrap.com/docs/5.1/components/pagination/ -->
<!-- https://getbootstrap.com/docs/5.2/components/pagination/ -->

<xsl:template
match="*[ (contains(@class, ' topic/ol ') or contains(@class, ' topic/ul ')) and contains(@outputclass, 'pagination')]"
Expand Down
15 changes: 11 additions & 4 deletions Customization/xsl/popovers.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Popover component -->
<!-- https://getbootstrap.com/docs/5.1/components/popovers/ -->
<!-- https://getbootstrap.com/docs/5.2/components/popovers/ -->

<xsl:template match="*" mode="add-bootstrap-popover">
<xsl:attribute name="data-bs-toggle">
Expand All @@ -34,9 +34,16 @@
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="*[contains(@class, ' topic/data ')][1]/*[contains(@class, ' topic/title ')][1]"/>
</xsl:attribute>
<xsl:if test="*[contains(@class, ' topic/data ') and contains(@name, 'title')][1]">
<xsl:attribute name="title">
<xsl:value-of select="*[contains(@class, ' topic/data ') and contains(@name, 'title')][1]"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="*[contains(@class, ' topic/data ') and contains(@name, 'class')][1]">
<xsl:attribute name="data-bs-custom-class">
<xsl:value-of select="*[contains(@class, ' topic/data ') and contains(@name, 'class')][1]"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="data-bs-content">
<xsl:value-of select="*[contains(@class, ' topic/desc ')][1]"/>
</xsl:attribute>
Expand Down
2 changes: 1 addition & 1 deletion Customization/xsl/scrollspy.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Scrollspy Component -->
<!-- https://getbootstrap.com/docs/5.1/components/scrollspy/ -->
<!-- https://getbootstrap.com/docs/5.2/components/scrollspy/ -->

<xsl:template match="*" mode="scrollspy-href">
<xsl:call-template name="scrollspy-href"/>
Expand Down
64 changes: 51 additions & 13 deletions Customization/xsl/tables.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@
<!--override row processing - remove DITA row CSS class -->
<xsl:template match="*[contains(@class, ' topic/row ')]" name="topic.row">
<tr>
<xsl:attribute name="class" select="@outputclass"/>
<xsl:choose>
<xsl:when test="@valign">
<xsl:attribute name="class">
<xsl:value-of select="concat('align-', @valign)"/>
<xsl:value-of select="concat(' ', @outputclass)"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="@outputclass">
<xsl:attribute name="class" select="@outputclass"/>
</xsl:when>
</xsl:choose>
<xsl:apply-templates select="@xml:lang"/>
<xsl:apply-templates select="@dir"/>
<xsl:apply-templates
Expand All @@ -36,18 +46,27 @@

<div>
<!-- ↓ Add Bootstrap CSS frame processing ↑ -->
<xsl:if test="@frame = 'sides'">
<xsl:attribute name="class" select="'border-start border-end p-3'"/>
</xsl:if>
<xsl:if test="@frame = 'top'">
<xsl:attribute name="class" select="'border-top p-3'"/>
</xsl:if>
<xsl:if test="@frame = 'bottom'">
<xsl:attribute name="class" select="'border-bottom p-3'"/>
</xsl:if>
<xsl:if test="@frame = 'topbot'">
<xsl:attribute name="class" select="'border-top border-bottom p-3'"/>
</xsl:if>
<xsl:choose>
<xsl:when test="@frame = 'sides'">
<xsl:attribute name="class" select="'border-start border-end pt-3 ps-3 pe-3'"/>
</xsl:when>
<xsl:when test="@frame = 'top'">
<xsl:attribute name="class" select="'border-top pt-3'"/>
</xsl:when>
<xsl:when test="@frame = 'bottom'">
<xsl:attribute name="class" select="'border-bottom pt-3 ps-3 pe-3'"/>
</xsl:when>
<xsl:when test="@frame = 'topbot'">
<xsl:attribute name="class" select="'border-top border-bottom pt-3 ps-3 pe-3'"/>
</xsl:when>
<xsl:when test="@frame = 'all'">
<xsl:attribute name="class" select="'border pt-3 ps-3 pe-3'"/>
</xsl:when>
<xsl:when test="@frame = 'none'">
<xsl:attribute name="class" select="'border-0 pt-3 ps-3 pe-3'"/>
</xsl:when>
</xsl:choose>

<!-- ↑ End customization · Continue with DITA-OT defaults ↓ -->
<table>
<!-- ↓ Add Bootstrap CSS class processing ↑ -->
Expand Down Expand Up @@ -75,4 +94,23 @@
</xsl:if>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/entry ')]/@valign" mode="css-class">
<xsl:value-of select="concat('align-', .)"/>
</xsl:template>

<xsl:template match="@colsep" mode="css-class">
<xsl:if test=".='0' and not(../@rowsep='0')">
<xsl:value-of select="'border-start-0 border-end-0'"/>
</xsl:if>
<xsl:if test=".='1' and not(../@rowsep='1')">
<xsl:value-of select="'border-start border-end'"/>
</xsl:if>
</xsl:template>

<xsl:template match="@rowsep" mode="css-class">
<xsl:if test=".='0' and not(../@colsep='0')">
<xsl:value-of select="'border-top-0 border-bottom-0'"/>
</xsl:if>
</xsl:template>

</xsl:stylesheet>
6 changes: 3 additions & 3 deletions Customization/xsl/tabs.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Tabbed Dialog Component -->
<!-- https://getbootstrap.com/docs/5.1/components/navs-tabs/#tabs -->
<!-- https://getbootstrap.com/docs/5.2/components/navs-tabs/#tabs -->

<xsl:template match="*[contains(@class,' topic/bodydiv ') and contains(@outputclass, 'nav-tabs')]">
<ul role="tablist">
Expand All @@ -29,12 +29,12 @@
</xsl:template>

<!-- Customization to add Bootstrap Tabbed Dialog with Pills Component -->
<!-- https://getbootstrap.com/docs/5.1/components/navs-tabs/#pills -->
<!-- https://getbootstrap.com/docs/5.2/components/navs-tabs/#pills -->

<xsl:template match="*[contains(@class,' topic/bodydiv ') and contains(@outputclass, 'nav-pills')]">
<xsl:choose>
<!-- Pills with Vertical alignment -->
<!-- https://getbootstrap.com/docs/5.1/components/navs-tabs/#vertical -->
<!-- https://getbootstrap.com/docs/5.2/components/navs-tabs/#vertical -->
<xsl:when test="contains(@outputclass, 'nav-pills-vertical')">
<div class="d-flex align-items-start">
<div role="tablist" aria-orientation="vertical">
Expand Down
7 changes: 6 additions & 1 deletion Customization/xsl/tooltips.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Tooltips component -->
<!-- https://getbootstrap.com/docs/5.1/components/tooltips/ -->
<!-- https://getbootstrap.com/docs/5.2/components/tooltips/ -->

<xsl:template match="*" mode="add-bootstrap-tooltip">
<xsl:attribute name="data-bs-toggle">
Expand All @@ -34,6 +34,11 @@
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:if test="*[contains(@class, ' topic/data ') and contains(@name, 'class')][1]">
<xsl:attribute name="data-bs-custom-class">
<xsl:value-of select="*[contains(@class, ' topic/data ') and contains(@name, 'class')][1]"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="*[contains(@class, ' topic/desc ')]/*">
<xsl:attribute name="data-bs-html">
Expand Down
8 changes: 4 additions & 4 deletions Customization/xsl/topic.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</xsl:template>

<!-- Override to add Bootstrap Alert classes and roles to Note elements -->
<!-- https://getbootstrap.com/docs/5.1/components/alerts/ -->
<!-- https://getbootstrap.com/docs/5.2/components/alerts/ -->
<xsl:template match="*" mode="process.note.common-processing">
<xsl:param name="type" select="@type"/>
<xsl:param name="title">
Expand Down Expand Up @@ -159,7 +159,7 @@
</xsl:template>

<!-- Customization to add Bootstrap Figure Content -->
<!-- https://getbootstrap.com/docs/5.1/content/figures/ -->
<!-- https://getbootstrap.com/docs/5.2/content/figures/ -->
<xsl:template match="*[contains(@class, ' topic/fig ')]" name="topic.fig">
<xsl:variable name="default-fig-class">
<xsl:apply-templates select="." mode="dita2html:get-default-fig-class"/>
Expand Down Expand Up @@ -271,7 +271,7 @@


<!-- Customization to add Bootstrap Borders to Codeblock elements-->
<!-- https://getbootstrap.com/docs/5.1/utilities/borders/ -->
<!-- https://getbootstrap.com/docs/5.2/utilities/borders/ -->
<xsl:template match="*[contains(@class, ' topic/pre ') and @frame]">
<xsl:variable name="default-fig-class">
<xsl:apply-templates select="." mode="dita2html:get-default-fig-class"/>
Expand Down Expand Up @@ -299,7 +299,7 @@
</xsl:template>

<!-- Customization to add Bootstrap Borders to Lines elements-->
<!-- https://getbootstrap.com/docs/5.1/utilities/borders/ -->
<!-- https://getbootstrap.com/docs/5.2/utilities/borders/ -->
<xsl:template match="*[contains(@class, ' topic/lines ') and @frame]">
<xsl:variable name="default-fig-class">
<xsl:apply-templates select="." mode="dita2html:get-default-fig-class"/>
Expand Down
8 changes: 5 additions & 3 deletions Customization/xsl/utility-classes.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<xsl:template match="*[contains(@class, ' topic/table ')]" mode="get-output-class">
<xsl:value-of select="$BOOTSTRAP_CSS_TABLE"/>
<xsl:choose>
<xsl:when test="@frame = 'all'"> table-bordered</xsl:when>
<xsl:when test="@frame = 'none'"> table-borderless</xsl:when>
<xsl:when test="@colsep='1' and @rowsep='1'"> table-bordered</xsl:when>
<xsl:when test="@colsep='0' and @rowsep='0'"> table-borderless</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:template>
Expand Down Expand Up @@ -311,7 +311,9 @@
<xsl:when test="@type='notice'">
<i class="pe-2 bi bi-info-circle-fill"/>
</xsl:when>
<!--xsl:when test="@type='note'"/-->
<xsl:when test="@type='note'">
<i class="pe-2 bi bi-pencil"/>
</xsl:when>
<!--xsl:when test="@type='other'"/-->
</xsl:choose>
</xsl:template>
Expand Down
Loading