diff --git a/.gitattributes b/.gitattributes index 7453f32e..474ba2b2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -28,3 +28,8 @@ *.otf binary *.ttf binary *.woff binary + +css/** linguist-vendored +sample/** linguist-documentation + +build_dita2html5-bootstrap.xml linguist-language=Ant-Build-System diff --git a/.github/dita-ot/footer.xml b/.github/dita-ot/footer.xml new file mode 100644 index 00000000..0f0c5cd5 --- /dev/null +++ b/.github/dita-ot/footer.xml @@ -0,0 +1,38 @@ + +
+
+
+ +

+ + + + + + +

+

+ + © 2021 + infotexture + +

+
+
+
+ diff --git a/.github/dita-ot/header.xml b/.github/dita-ot/header.xml new file mode 100644 index 00000000..17dcf3db --- /dev/null +++ b/.github/dita-ot/header.xml @@ -0,0 +1,62 @@ + diff --git a/.github/dita-ot/html.ditaval b/.github/dita-ot/html.ditaval new file mode 100644 index 00000000..6db29572 --- /dev/null +++ b/.github/dita-ot/html.ditaval @@ -0,0 +1,5 @@ + + + + + diff --git a/.github/dita-ot/html.xml b/.github/dita-ot/html.xml new file mode 100644 index 00000000..a6bbc456 --- /dev/null +++ b/.github/dita-ot/html.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.github/dita-ot/theme.css b/.github/dita-ot/theme.css new file mode 100644 index 00000000..4bfeed8e --- /dev/null +++ b/.github/dita-ot/theme.css @@ -0,0 +1,27 @@ +/* + This sample applies the default Bootstrap 5 theme and any additional CSS overrides + ↓ For a custom look-and-feel, a generated Bootstrap theme could be added below ↓ +*/ + +/* ↑ End generated Bootstrap theme ↑ */ + +/* ↓ Additional custom overrides ↓ */ + +.list-group-item-dark { + background-color: #e7f1ff; +} + +footer { + background-color: #e7f1ff; + border-top: 1px solid rgba(0, 0, 0, 0.125); + margin-top: 3rem; +} + +/* Add Bootstrap’s own documentation example highlight */ + +.bd-example { + position: relative; + padding: 1rem; + margin: 1rem -0.75rem 0; + border: solid #dee2e6 1px; +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..49af1000 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI +'on': + push: + branches: + - master + - develop + workflow_dispatch: +jobs: + build-dita: + name: Build DITA + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Build Bootstrap + uses: dita-ot/dita-ot-action@master + with: + install: | + apt-get update -q + export DEBIAN_FRONTEND=noninteractive + apt-get install -qy --no-install-recommends nodejs + nodejs -v + plugins: | + https://github.com/jason-fox/fox.jason.extend.css/archive/master.zip + https://github.com/infotexture/dita-bootstrap/archive/develop.zip + https://github.com/jason-fox/fox.jason.prismjs/archive/master.zip + project: .github/dita-ot/html.xml + - name: Deploy HTML 🚀 + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: out/html # The folder the action should deploy. diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..363f23f0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +# This file specifies files that Prettier should not format + +backups +out diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..ab48db68 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,37 @@ +{ + "arrowParens": "avoid", + "bracketSpacing": false, + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "css", + "printWidth": 120, + "proseWrap": "preserve", + "requirePragma": false, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all", + "useTabs": false, + "vueIndentScriptAndStyle": true, + "xmlSelfClosingSpace": false, + "xmlWhitespaceSensitivity": "strict", + "overrides": [ + { + "files": "*.json", + "options": { + "printWidth": 200 + } + }, + { + "files": "*.xml", + "options": { + "printWidth": 80 + } + }, + { + "files": "*.xsl", + "options": { + "parser": "xml" + } + } + ] +} diff --git a/Customization/xsl/accordion.xsl b/Customization/xsl/accordion.xsl new file mode 100644 index 00000000..778a1468 --- /dev/null +++ b/Customization/xsl/accordion.xsl @@ -0,0 +1,87 @@ + + + + + + + +
+ + + +
+
+ + + + + + h6 + h + + + + + + + +
+ + + + + + + +
+ + accordion-collapse collapse + + show + + + + + +
+ + + + + + +
+
+
+
+
diff --git a/Customization/xsl/card.xsl b/Customization/xsl/card.xsl new file mode 100644 index 00000000..155678b3 --- /dev/null +++ b/Customization/xsl/card.xsl @@ -0,0 +1,67 @@ + + + + + + + +
+ + + + +
+ + +
+ + +
+
+ + + + + + + h6 + h + h + + + + + + sectiontitle card-subtitle text-muted + sectiontitle card-title + + + + + + + + + + +
diff --git a/Customization/xsl/carousel.xsl b/Customization/xsl/carousel.xsl new file mode 100644 index 00000000..cbad0f8c --- /dev/null +++ b/Customization/xsl/carousel.xsl @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + +
+ + carousel-item + + active + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Customization/xsl/hi-d.xsl b/Customization/xsl/hi-d.xsl new file mode 100644 index 00000000..a382c980 --- /dev/null +++ b/Customization/xsl/hi-d.xsl @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Customization/xsl/nav.xsl b/Customization/xsl/nav.xsl new file mode 100644 index 00000000..273c1184 --- /dev/null +++ b/Customization/xsl/nav.xsl @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + list-group-item list-group-item-action + + active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + list-group-item list-group-item-action + + list-group-item-secondary + + + active + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Customization/xsl/offcanvas.xsl b/Customization/xsl/offcanvas.xsl new file mode 100644 index 00000000..1d36d3e8 --- /dev/null +++ b/Customization/xsl/offcanvas.xsl @@ -0,0 +1,59 @@ + + + + + + + + + + + h6 + h + + + +
+ + offcanvas + + + + + +
+ + + + + +
+
+ +
+
+
+ + + + + + + + + + + + +
diff --git a/Customization/xsl/tables.xsl b/Customization/xsl/tables.xsl new file mode 100644 index 00000000..d9a26e76 --- /dev/null +++ b/Customization/xsl/tables.xsl @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + diff --git a/Customization/xsl/tabs.xsl b/Customization/xsl/tabs.xsl new file mode 100644 index 00000000..4376c94d --- /dev/null +++ b/Customization/xsl/tabs.xsl @@ -0,0 +1,131 @@ + + + + + + + +
    + + + +
+
+ +
+
+ + + + + + + + + +
+
+ + + +
+
+ +
+
+
+ + +
    + + + +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + tab-pane fade + + show active + + + + + + +
+
+
diff --git a/Customization/xsl/topic.xsl b/Customization/xsl/topic.xsl new file mode 100644 index 00000000..103c396d --- /dev/null +++ b/Customization/xsl/topic.xsl @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/Customization/xsl/utility-classes.xsl b/Customization/xsl/utility-classes.xsl new file mode 100644 index 00000000..40689964 --- /dev/null +++ b/Customization/xsl/utility-classes.xsl @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + slide + + + + + + + + + + + nav + + + + + nav + + + flex-column nav-pills + + + + + + + + + + + + + + + + + + + + + + + + + + + accordion + + + btn + + + badge + + + alert + + + carousel + + + alert-heading + + + alert-link + + + list-group-item + + + + img-fluid + + + + + + alert + + + alert-success + + + alert-success + + + alert-success + + + alert-warning + + + alert-warning + + + alert-warning + + + alert-warning + + + alert-warning + + + alert-warning + + + alert-danger + + + alert-info + + + alert-info + + + alert-dark + + + alert-info + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 5fa78dfe..0c0d7a60 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,21 @@ A plug-in for [DITA Open Toolkit][1] that extends the default HTML5 output with a basic [Bootstrap][2] template. - + - [Installing](#installing) - [Using](#using) - [Customizing](#customizing) + - [Headers and footers](#headers-and-footers) + - [Navigation menu](#navigation-menu) + - [Custom CSS](#custom-css) + - [Common Bootstrap utility classes](#common-bootstrap-utility-classes) - [Feedback](#feedback) +- [License](#license) -![Sample DITA Bootstrap output](images/dita-bootstrap-default-screenshot.png) +![Sample DITA Bootstrap output](images/default-bootstrap.png) ## Installing @@ -19,59 +24,153 @@ Use the `dita` command to add this plug-in to your DITA Open Toolkit installatio DITA-OT 3.5 and newer: - dita install net.infotexture.dita-bootstrap +```console +dita install fox.jason.extend.css +dita install net.infotexture.dita-bootstrap +``` DITA-OT 3.3 and newer: - dita --install net.infotexture.dita-bootstrap +```console +dita --install fox.jason.extend.css +dita --install net.infotexture.dita-bootstrap +``` DITA-OT 3.2 and older: - dita --install https://github.com/infotexture/dita-bootstrap/archive/3.1.zip +```console +dita --install \ + https://github.com/jason-fox/fox.jason.extend.css/archive/master.zip +dita --install \ + https://github.com/infotexture/dita-bootstrap/archive/master.zip +``` ## Using Specify the `html5-bootstrap` format when building output with the `dita` command: - dita --input=path/to/your.ditamap --format=html5-bootstrap +```console +dita --input=path/to/your.ditamap \ + --format=html5-bootstrap +``` ## Customizing -### Header menu +### Headers and footers -The plug-in includes a default static navbar with a project name and global links. To override the global navigation with a header of your own, pass a custom header file to the `dita` command via the `--args.hdr` parameter: +The plug-in includes a default static navigation menu with a project name and global link placeholders. - dita --input=path/to/your.ditamap --format=html5-bootstrap \ - --args.hdr=path/to/your-header.xml +The default header file `includes/bs-navbar-default.hdr.xml` uses the Bootstrap primary (blue) background color for the [navbar component][3]. -The plug-in includes a sample [header alternative with a dark navbar][3]. +To change the color to a dark (black) background, replace the primary background color class `bg-primary` on the first line with the dark variant `bg-dark`: -Edit a copy of this file to adjust the content of the global navigation. +```diff +-