Skip to content

Commit

Permalink
Merge branch 'release/5.3.1'
Browse files Browse the repository at this point in the history
* release/5.3.1: (79 commits)
  Update remaining references to collapsible ToC
  Bump plug-in version to 5.3.1
  Edit README to fix minor formatting issues
  Fix icons header file reference
  Switch nav-toc to collapsible for CI builds
  Formatting
  Bump icons to 1.8.1
  © Update footer copyright ranges
  Run Prettier in CI check
  Bump devDependencies
  Reformat
  Fix indentation
  Reformat
  Re-run Prettier
  More frame options:
  Additional table frame support
  Update CSS, improve accessibility
  Amend padding
  Add collapse support
  Correct text.
  ...
  • Loading branch information
infotexture committed May 9, 2022
2 parents 34f1338 + 8a642ec commit ee9ca41
Show file tree
Hide file tree
Showing 135 changed files with 4,704 additions and 304 deletions.
15 changes: 15 additions & 0 deletions .github/dita-ot/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/dita-ot/footer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</p>
<p class="p-3">
<small>
© 2021
© 2017–2022
<a class="text-dark" href="https://infotexture.net/">infotexture</a>
</small>
</p>
Expand Down
4 changes: 2 additions & 2 deletions .github/dita-ot/header.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-4">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">

<div class="container">
<a class="navbar-brand" href="https://infotexture.github.io/dita-bootstrap">
Expand Down Expand Up @@ -53,7 +53,7 @@
<li class="nav-item">
<a
class="nav-link"
href="https://getbootstrap.com/docs/5.0"
href="https://getbootstrap.com/docs/5.1"
>Bootstrap Docs</a>
</li>
</ul>
Expand Down
6 changes: 5 additions & 1 deletion .github/dita-ot/html.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
<param name="args.css" value="theme.css"/>
<param name="args.csspath" value="css"/>
<param name="args.cssroot" path="."/>
<param name="args.favicon" value="favicon.svg"/>
<param name="args.faviconpath" value="favicon"/>
<param name="args.faviconroot" path="."/>
<param name="args.hdr" href="header.xml"/>
<param name="args.ftr" href="footer.xml"/>
<param name="html5.toc.generate" value="no"/>
<param name="args.rellinks" value="none"/>
<param name="nav-toc" value="list-group-full"/>
<param name="nav-toc" value="collapsible"/>
<param name="processing-mode" value="strict"/>
<param name="icons.include" value="yes"/>
<param name="popovers.include" value="yes"/>
</publication>
</deliverable>
</project>
4 changes: 0 additions & 4 deletions .github/dita-ot/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

/* ↓ Additional custom overrides ↓ */

.list-group-item-dark {
background-color: #e7f1ff;
}

footer {
background-color: #e7f1ff;
border-top: 1px solid rgba(0, 0, 0, 0.125);
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
apt-get install -qy --no-install-recommends nodejs
nodejs -v
plugins: |
https://github.com/jason-fox/fox.jason.extend.css/archive/master.zip
fox.jason.extend.css
https://github.com/infotexture/dita-bootstrap/archive/develop.zip
https://github.com/jason-fox/fox.jason.prismjs/archive/master.zip
fox.jason.prismjs
fox.jason.favicon
project: .github/dita-ot/html.xml
- name: Deploy HTML 🚀
uses: JamesIves/[email protected]
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow checks code formatting

name: Run Prettier

# This action works with pull requests and pushes

on:
pull_request:
push:
branches:
# Push events on development branch
- develop

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.ref }}

- name: Prettify code
uses: creyD/[email protected]
with:
# This part is also where you can pass other options, for example:
prettier_options: --write **/*.{css,dita*,json,md,xml,yml}
# Install Prettier XML plugin
prettier_plugins: '@prettier/plugin-xml'
# Runs the action in dry mode. Files wont get changed and the action fails if there are unprettified files.
dry: true
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This file specifies files that Prettier should not format

backups
cfg/common/vars/strings.xml
out
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
"printWidth": 80
}
},
{
"files": "strings-*.xml",
"options": {
"printWidth": 100
}
},
{
"files": "*.xsl",
"options": {
Expand Down
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.0/components/accordion/ -->
<!-- https://getbootstrap.com/docs/5.1/components/accordion/ -->

<xsl:template match="*[contains(@class,' topic/bodydiv ') and contains(@outputclass, 'accordion')]">
<div>
Expand Down
99 changes: 99 additions & 0 deletions Customization/xsl/breadcrumb.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Bootstrap plug-in for DITA Open Toolkit.
See the accompanying LICENSE file for applicable licenses.
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot"
xmlns:ditamsg="http://dita-ot.sourceforge.net/ns/200704/ditamsg"
version="2.0"
exclude-result-prefixes="xs dita-ot ditamsg"
>
<!-- Override to add Bootstrap breadcrumb component -->
<!-- https://getbootstrap.com/docs/5.1/components/breadcrumb/ -->

<!-- Whether include a bootstrap breadcrumb component on each page. values are 'yes' or 'no' -->
<xsl:param name="BREADCRUMBS" select="'no'"/>
<!-- Dividers can be changed via an input parameter -->
<xsl:param name="BREADCRUMB_DIVIDER" select="'/'"/>

<!-- Add Bootstrap breadcrumb -->
<xsl:template match="*" mode="gen-user-breadcrumb">

<nav aria-label="breadcrumb">
<xsl:if test="not($BREADCRUMB_DIVIDER = '/')">
<xsl:attribute name="style">
<xsl:text>--bs-breadcrumb-divider: '</xsl:text>
<xsl:value-of select="$BREADCRUMB_DIVIDER"/>
<xsl:text>';</xsl:text>
</xsl:attribute>
</xsl:if>

<ol class="breadcrumb">
<xsl:for-each select="ancestor::node()">
<xsl:variable name="title">
<xsl:apply-templates select="." mode="get-navtitle"/>
</xsl:variable>
<xsl:if test="normalize-space($title)">
<li class="breadcrumb-item">
<xsl:choose>
<xsl:when test="@href">
<a>
<xsl:attribute name="href">
<xsl:if test="not(@scope = 'external')">
<xsl:value-of select="$PATH2PROJ"/>
</xsl:if>
<xsl:choose>
<xsl:when
test="@copy-to and not(contains(@chunk, 'to-content')) and
(not(@format) or @format = 'dita' or @format = 'ditamap') "
>
<xsl:call-template name="replace-extension">
<xsl:with-param name="filename" select="@copy-to"/>
<xsl:with-param name="extension" select="$OUTEXT"/>
</xsl:call-template>
<xsl:if test="not(contains(@copy-to, '#')) and contains(@href, '#')">
<xsl:value-of select="concat('#', substring-after(@href, '#'))"/>
</xsl:if>
</xsl:when>
<xsl:when
test="not(@scope = 'external') and (not(@format) or @format = 'dita' or @format = 'ditamap')"
>
<xsl:call-template name="replace-extension">
<xsl:with-param name="filename" select="@href"/>
<xsl:with-param name="extension" select="$OUTEXT"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@href"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="$title"/>
</a>
</xsl:when>
<xsl:otherwise>
<span>
<xsl:value-of select="$title"/>
</span>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:if>
</xsl:for-each>
<xsl:variable name="title">
<xsl:apply-templates select="." mode="get-navtitle"/>
</xsl:variable>
<xsl:if test="normalize-space($title)">
<li class="breadcrumb-item active" aria-current="page">
<xsl:value-of select="$title"/>
</li>
</xsl:if>
</ol>
</nav>
</xsl:template>


</xsl:stylesheet>
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.0/components/card/ -->
<!-- https://getbootstrap.com/docs/5.1/components/card/ -->

<xsl:template match="*[contains(@class,' topic/section ') and contains(@outputclass, 'card')]">
<div>
Expand Down
14 changes: 11 additions & 3 deletions 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.0/components/carousel/ -->
<!-- https://getbootstrap.com/docs/5.1/components/carousel/ -->

<xsl:template
match="*[ (contains(@class,' topic/ul ') or contains(@class, ' topic/ol ')) and contains(@outputclass, 'carousel')]"
Expand All @@ -29,12 +29,20 @@
<a class="carousel-control-prev" role="button" data-bs-slide="prev">
<xsl:attribute name="data-bs-target" select="concat('#' , $id)"/>
<span class="carousel-control-prev-icon" aria-hidden="true"/>
<span class="visually-hidden">Previous</span>
<span class="visually-hidden">
<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'Previous'"/>
</xsl:call-template>
</span>
</a>
<a class="carousel-control-next" role="button" data-bs-slide="next">
<xsl:attribute name="data-bs-target" select="concat('#' , $id)"/>
<span class="carousel-control-next-icon" aria-hidden="true"/>
<span class="visually-hidden">Next</span>
<span class="visually-hidden">
<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'Next'"/>
</xsl:call-template>
</span>
</a>
</div>
</xsl:template>
Expand Down
82 changes: 82 additions & 0 deletions Customization/xsl/collapse.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Bootstrap plug-in for DITA Open Toolkit.
See the accompanying LICENSE file for applicable licenses.
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0"
exclude-result-prefixes="xs xhtml dita-ot"
>
<!-- Customization to add Bootstrap Collapse Component -->
<!-- https://getbootstrap.com/docs/5.1/components/collapse/ -->

<xsl:template match="*[contains(@class,' topic/bodydiv ') and contains(@outputclass, 'collapse-horizontal')]">
<xsl:variable name="id" select="dita-ot:generate-html-id(.)"/>
<div>
<xsl:if test="contains(@otherprops, 'style(')">
<xsl:attribute name="style">
<xsl:analyze-string select="@otherprops" regex="[a-z]*\([^\)]*\)">
<xsl:matching-substring>
<xsl:variable name="var">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:variable name="attr">
<xsl:value-of select="substring-before($var, '(')"/>
</xsl:variable>
<xsl:attribute name="{$attr}">
<xsl:value-of select="substring-before(substring-after($var, '('),')')"/>
</xsl:attribute>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:attribute>
</xsl:if>
<div>
<xsl:attribute name="id" select="$id"/>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>

<xsl:template match="*[contains(@class, ' topic/div ') and contains(@otherprops, 'style(')]">
<div>
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="setid"/>
<xsl:attribute name="style">
<xsl:analyze-string select="@otherprops" regex="[a-z]*\([^\)]*\)">
<xsl:matching-substring>
<xsl:variable name="var">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:variable name="attr">
<xsl:value-of select="substring-before($var, '(')"/>
</xsl:variable>
<xsl:attribute name="{$attr}">
<xsl:value-of select="substring-before(substring-after($var, '('),')')"/>
</xsl:attribute>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:attribute>
<xsl:apply-templates/>
</div>
</xsl:template>


<!-- 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])"/>

<a data-bs-toggle="collapse">
<xsl:call-template name="commonattributes"/>
<xsl:attribute name="href" select="concat('#',$id)"/>
<xsl:attribute name="aria-expanded" select="'false'"/>
<xsl:attribute name="aria-controls" select="$id"/>
<xsl:apply-templates/>
</a>
</xsl:template>
</xsl:stylesheet>
Loading

0 comments on commit ee9ca41

Please sign in to comment.