Skip to content

Commit

Permalink
Merge branch 'release/3.3'
Browse files Browse the repository at this point in the history
* release/3.3:
  Update package.version for 3.3 release
  Update ReadMe for 3.3 release
  Update navbar header examples for Bootstrap 4
  Update header link to latest Bootstrap (4.3.1) CSS
  Switch to responsive, fixed-width container
  Remove obsolete template mode customizations
  Move custom classes to new attribute sets
  Remove redundant container class
  Update viewport <meta> element for Bootstrap 4
  Remove unmodified default template
  Update grid classes for Bootstrap 4
  Add Relax NG schema & package.version
  • Loading branch information
infotexture committed Mar 4, 2019
2 parents 8f2e7ba + d1dc87f commit 797c743
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 145 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ A plug-in for [DITA Open Toolkit][1] that extends the default HTML5 output with

Use the `dita` command to add this plug-in to your DITA Open Toolkit installation:

DITA-OT 3.2:
DITA-OT 3.3:

dita --install net.infotexture.dita-bootstrap

DITA-OT 3.1 and older:
DITA-OT 3.2 and older:

dita --install https://github.com/infotexture/dita-bootstrap/archive/3.1.zip

Expand All @@ -40,7 +40,7 @@ The plug-in includes a default static navbar with a project name and global link
dita --input=path/to/your.ditamap --format=html5-bootstrap \
--args.hdr=path/to/your-header.xml

The plug-in includes a sample [header alternative with a black navbar][3].
The plug-in includes a sample [header alternative with a dark navbar][3].

Edit a copy of this file to adjust the content of the global navigation.

Expand All @@ -58,15 +58,15 @@ For more extensive customizations, you may want to [fork][5] this repository and

- If you find this useful and build something of your own on top of it, [let me know][6].

- If you find a bug or would like to suggest a change, [create an issue][7].
- If you find a bug or would like to suggest a change, [create an issue][7].
_(If it's a bug, provide steps to recreate the issue.)_

- If you know how to fix it yourself, [submit a pull request][8] with the proposed changes.

[1]: http://www.dita-ot.org
[2]: https://getbootstrap.com/docs/3.3
[3]: https://github.com/infotexture/dita-bootstrap/blob/3.1/includes/bs-navbar-inverse.hdr.xml
[4]: https://github.com/infotexture/dita-bootstrap/blob/3.1/css/custom.css
[3]: https://github.com/infotexture/dita-bootstrap/blob/master/includes/bs-navbar-inverse.hdr.xml
[4]: https://github.com/infotexture/dita-bootstrap/blob/master/css/custom.css
[5]: https://help.github.com/articles/fork-a-repo/
[6]: https://twitter.com/infotexture
[7]: https://github.com/infotexture/dita-bootstrap/issues/new
Expand Down
2 changes: 0 additions & 2 deletions build_dita2html5-bootstrap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
location="${dita.plugin.net.infotexture.dita-bootstrap.dir}/includes/bs-navbar-default.hdr.xml"/>
<property name="args.xsl"
location="${dita.plugin.net.infotexture.dita-bootstrap.dir}/xsl/html5-bootstrap.xsl"/>
<property name="args.html5.toc.xsl"
location="${dita.plugin.net.infotexture.dita-bootstrap.dir}/xsl/map2html5-cover.xsl"/>
<property name="args.html5.toc" value="toc"/>
<property name="nav-toc" value="partial"/>
<property name="args.cssroot"
Expand Down
Binary file modified images/dita-bootstrap-default-screenshot.png
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 includes/bootstrap.hdf.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"></link>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"/>
</div>
36 changes: 20 additions & 16 deletions includes/bs-navbar-default.hdr.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<div class="navbar navbar-default navbar-static-top" role="navigation">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-4">

<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">DITA Bootstrap</a>
</div>
<div class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#">Link One</a></li>
<li><a href="#">Link Two</a></li>
<li><a href="#">Link Three</a></li>
<a class="navbar-brand" href="/">DITA Bootstrap</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link" href="#">Link One</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link Two</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link Three</a></li>
</ul>
</div>
</div>
</div>
</nav>
36 changes: 20 additions & 16 deletions includes/bs-navbar-inverse.hdr.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark mb-4">

<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">DITA Bootstrap</a>
</div>
<div class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#">Link One</a></li>
<li><a href="#">Link Two</a></li>
<li><a href="#">Link Three</a></li>
<a class="navbar-brand" href="/">DITA Bootstrap</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link" href="#">Link One</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link Two</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link Three</a></li>
</ul>
</div>
</div>
</div>
</nav>
2 changes: 2 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="dita-ot/plugin.rnc" type="application/relax-ng-compact-syntax"?>

<!-- Copyright © 2017 · infotexture · Roger W. Fienhold Sheen -->
<!-- See the accompanying LICENSE file for applicable license -->

<plugin id="net.infotexture.dita-bootstrap">
<feature extension="package.version" value="3.3"/>
<require plugin="org.dita.html5"/>
<transtype name="html5-bootstrap" extends="html5" desc="HTML5 with Bootstrap style"/>
<feature extension="ant.import" file="build_dita2html5-bootstrap.xml"/>
Expand Down
84 changes: 14 additions & 70 deletions xsl/html5-bootstrap.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,13 @@

<xsl:import href="plugin:org.dita.html5:xsl/dita2html5.xsl"/>

<!-- ========== DEFAULT PAGE LAYOUT ========== -->

<xsl:template name="chapter-setup">
<html>
<xsl:call-template name="setTopicLanguage"/>
<xsl:call-template name="chapterHead"/>
<xsl:call-template name="chapterBody"/>
</html>
</xsl:template>

<!-- Override to add <meta> elements to page heads -->
<xsl:template match="*" mode="chapterHead">
<head>
<!-- initial meta information -->
<xsl:call-template name="generateCharset"/> <!-- Set the character set to UTF-8 -->
<!-- ↓ Add <meta> elements from basic Bootstrap template -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- ↓ Add <meta> element from Bootstrap starter template ↑ -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<!-- ↑ End customization · Continue with DITA-OT defaults ↓ -->
<xsl:call-template name="generateDefaultCopyright"/> <!-- Generate a default copyright, if needed -->
<xsl:call-template name="generateDefaultMeta"/> <!-- Standard meta for security, robots, etc -->
Expand All @@ -51,8 +40,8 @@
<xsl:call-template name="setaname"/> <!-- For HTML4 compatibility, if needed -->
<xsl:apply-templates select="." mode="addHeaderToHtmlBodyElement"/>

<!-- ↓ Add Bootstrap fluid container & row -->
<div class="container-fluid container" id="content">
<!-- ↓ Add Bootstrap container & row -->
<div class="container" id="content">
<div class="row">
<!-- ↑ End customization · Continue with DITA-OT defaults ↓ -->
<!-- Include a user's XSL call here to generate a toc based on what's a child of topic -->
Expand All @@ -67,61 +56,16 @@
</body>
</xsl:template>

<!-- Override to add Bootstrap grid class -->
<!-- https://getbootstrap.com/docs/3.3/css/#grid -->
<xsl:template match="*" mode="addContentToHtmlBodyElement">
<!-- ↓ Add grid class -->
<main class="col-md-9" role="main">
<!-- ↑ End customization -->
<article role="article">
<xsl:attribute name="aria-labelledby">
<xsl:apply-templates select="*[contains(@class,' topic/title ')] |
self::dita/*[1]/*[contains(@class,' topic/title ')]" mode="return-aria-label-id"/>
</xsl:attribute>
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:apply-templates/> <!-- this will include all things within topic; therefore, -->
<!-- title content will appear here by fall-through -->
<!-- followed by prolog (but no fall-through is permitted for it) -->
<!-- followed by body content, again by fall-through in document order -->
<!-- followed by related links -->
<!-- followed by child topics by fall-through -->
<xsl:call-template name="gen-endnotes"/> <!-- include footnote-endnotes -->
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
</article>
</main>
</xsl:template>
<!-- Override to add Bootstrap large grid classes. -->
<!-- https://getbootstrap.com/docs/4.3/layout/grid -->
<xsl:attribute-set name="main">
<xsl:attribute name="class">col-lg-9</xsl:attribute>
<xsl:attribute name="role">main</xsl:attribute>
</xsl:attribute-set>

<!-- Override `nav.xsl` to add Bootstrap classes -->
<xsl:template match="*" mode="gen-user-sidetoc">
<xsl:if test="$nav-toc = ('partial', 'full')">
<!-- ↓ Add grid class to <nav>, wrap <ul> in small well <div> & add .bs-docs-sidenav class -->
<nav class="col-md-3" role="toc">
<div class="well well-sm">
<ul class="bs-docs-sidenav">
<!-- ↑ End customization -->
<xsl:choose>
<xsl:when test="$nav-toc = 'partial'">
<xsl:apply-templates select="$current-topicref" mode="toc-pull">
<xsl:with-param name="pathFromMaplist" select="$PATH2PROJ" as="xs:string"/>
<xsl:with-param name="children" as="element()*">
<xsl:apply-templates select="$current-topicref/*[contains(@class, ' map/topicref ')]" mode="toc">
<xsl:with-param name="pathFromMaplist" select="$PATH2PROJ" as="xs:string"/>
</xsl:apply-templates>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$nav-toc = 'full'">
<xsl:apply-templates select="$input.map" mode="toc">
<xsl:with-param name="pathFromMaplist" select="$PATH2PROJ" as="xs:string"/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</ul>
<!-- ↓ Close Bootstrap divs -->
</div>
<!-- ↑ End customization -->
</nav>
</xsl:if>
</xsl:template>
<xsl:attribute-set name="toc">
<xsl:attribute name="class">col-lg-3</xsl:attribute>
<xsl:attribute name="role">toc</xsl:attribute>
</xsl:attribute-set>

</xsl:stylesheet>
34 changes: 0 additions & 34 deletions xsl/map2html5-cover.xsl

This file was deleted.

0 comments on commit 797c743

Please sign in to comment.