From af492fc217a95485ff73fc834ff2cd4fb7bd7148 Mon Sep 17 00:00:00 2001 From: tajmone Date: Mon, 20 Nov 2017 12:00:21 +0100 Subject: [PATCH] Add .gitattributes and Fix EOLs Add .gitattributes file to manually control Git settings for text and binary files, and set how EOL should be handled on a per-file basis. Also set GitHub Linguist custom declarations for pandoc templates and Highlight extensions. Fix EOLs in all files accordingly. --- .gitattributes | 134 ++++ .gitignore | 152 ++-- README.md | 240 +++--- pp/README.md | 522 ++++++------- pp/macros/CHANGELOG | 248 +++---- pp/macros/GFM-Alerts.pp | 278 +++---- pp/macros/GFM-TaskList.css | 32 +- pp/macros/GFM-TaskList.pp | 278 +++---- pp/macros/Highlight.pp | 450 ++++++------ pp/macros/INIT-ENV.bat | 2 +- pp/macros/InlineFormatting.pp | 116 +-- pp/macros/kbd_GitHub.css | 34 +- pp/macros/macros.pp | 34 +- pp/test/GFM-Alerts.html | 512 ++++++------- pp/test/GFM-TaskList.html | 688 +++++++++--------- pp/test/Highlight.html | 592 +++++++-------- pp/test/InlineFormatting.html | 304 ++++---- pp/test/RUN-TESTS.bat | 72 +- pp/test/RUN-TESTS.pp | 92 +-- skylighting-css/README.md | 148 ++-- skylighting-css/built-in-styles/README.md | 140 ++-- .../built-in-styles/breezedark.css | 128 ++-- skylighting-css/built-in-styles/espresso.css | 126 ++-- skylighting-css/built-in-styles/haddock.css | 116 +-- skylighting-css/built-in-styles/kate.css | 128 ++-- .../built-in-styles/monochrome.css | 88 +-- skylighting-css/built-in-styles/pygments.css | 122 ++-- skylighting-css/built-in-styles/tango.css | 122 ++-- skylighting-css/built-in-styles/zenburn.css | 128 ++-- skylighting-css/sass-templates/README.md | 94 +-- .../sass-templates/build-n-watch.bat | 14 +- .../html5/github/GitHub-Template-Preview.html | 602 +++++++-------- templates/html5/github/GitHub.html5 | 190 ++--- templates/html5/github/INSTALL.bat | 50 +- templates/html5/github/README.md | 202 ++--- templates/html5/github/src/BUILD-PREVIEW.bat | 130 ++-- templates/html5/github/src/BUILD-TEMPLATE.bat | 114 +-- templates/html5/github/src/BUILD.bat | 6 +- .../html5/github/src/GitHub-Template_A.html5 | 84 +-- .../html5/github/src/GitHub-Template_C.html5 | 108 +-- templates/html5/github/src/markdown-body.css | 30 +- 41 files changed, 3892 insertions(+), 3758 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..feff12a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,134 @@ +# ============================================================================== +# Line Endings Conversion +# ============================================================================== +# Set Git's default behaviour to text-files autodetection, in case users don't +# have `core.autocrlf` set: +* text=auto + +# ------------------------------------------------------------------------------ +# Text Files (EOL Normalization Settings) +# ------------------------------------------------------------------------------ + +## ================= +## SOURCE CODE FILES +## ================= + +## PP Macros +## --------- +*.pp text + +## Pandoc Templates +## ---------------- +*.html5 text + +## Shell scripts +## ------------- +*.bat text eol=crlf +*.com text eol=crlf +*.sh text eol=lf + +## Scripts +## ------- +*.lua text +*.php text +*.pl text +*.py text +*.rb text +*.tcl text + +## ================== +## MISC. DATA FORMATS +## ================== +*.json text +*.xml text +*.xhtml text + +## =========================== +## HIGHLIGHT LANGDEFS & THEMES +## =========================== +*.lang text +*.theme text + +# ================= +## WEB-RELATED FILES +## ================= +*.htm text +*.html text +*.css text +*.js text +*.sass text +*.scss text + +## =================== +## DOCUMENTATION FILES +## =================== +*.txt text +*COPYRIGHT* text +*README* text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +copyright text +INSTALL text +license text +LICENSE text +NEWS text +readme text +TODO text + +## =================== +## CONFIGURATION FILES +## =================== + +## Git settings +## ---------- +.gitattributes text +.gitconfig text +.gitignore text + +# ------------------------------------------------------------------------------ +# Binary Files +# ------------------------------------------------------------------------------ +# Explicitly declare all files that are binary and shouldn't be modified by Git: + +## ======== +## GRAPHICS +## ======== +*.bmp binary +*.gif binary +*.icns binary +*.ico binary +*.jpeg binary +*.jpg binary +*.png binary + +## ======== +## ARCHIVES +## ======== +*.7z binary +*.gz binary +*.jar binary +*.rar binary +*.tar binary +*.zip binary + +# ============================================================================== +# GitHub Linguist +# ============================================================================== +# -- https://github.com/github/linguist +# Manually define/override some extension so that GitHub's Linguist library can +# 1) correctly gather statistics on source files, and +# 2) use proper syntax highlighting on GitHub's WebUI. + +## ================ +## PANDOC TEMPLATES +## ================ +*.html5 linguist-language=HTML + +## =========================== +## HIGHLIGHT LANGDEFS & THEMES +## =========================== +*.lang linguist-language=Lua +*.theme linguist-language=Lua diff --git a/.gitignore b/.gitignore index cabd087..6d68bc2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,77 +1,77 @@ -# ============================================================================== -# PANDOC-GOODIES -# ============================================================================== -# .gitignore definitions file for the pandoc-goodies project: -# -- https://github.com/tajmone/pandoc-goodies -# ------------------------------------------------------------------------------ - -# ============================================================================== -# Node.js -# ============================================================================== -# Some build/batch/bash files require Node apps; some users might rather install -# them locally to the project instead of globally. -# ------------------------------------------------------------------------------ -# Created by https://www.gitignore.io/api/node - -### Node ### -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - - +# ============================================================================== +# PANDOC-GOODIES +# ============================================================================== +# .gitignore definitions file for the pandoc-goodies project: +# -- https://github.com/tajmone/pandoc-goodies +# ------------------------------------------------------------------------------ + +# ============================================================================== +# Node.js +# ============================================================================== +# Some build/batch/bash files require Node apps; some users might rather install +# them locally to the project instead of globally. +# ------------------------------------------------------------------------------ +# Created by https://www.gitignore.io/api/node + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + + # End of https://www.gitignore.io/api/node \ No newline at end of file diff --git a/README.md b/README.md index 6bc8e0f..ba78342 100644 --- a/README.md +++ b/README.md @@ -1,120 +1,120 @@ -# Pandoc-Goodies - - pandoc v1.19.2 -> v2.0.2 | PP v2.0 - -A tresure-box of resources for pandoc, pp and the Texts word processor. - - - - -Copyright © Tristano Ajmone 2017, [MIT License](./LICENSE). - -The project is still WIP and in its early stages, but a pandoc html5 template is ready for use, along with a growing pp-macros library. - -> **PANDOC 2 NOTE** — Resources are currently being ported to the new pandoc v2. At the beginning of each section’s `README` you’ll see mentioned the pandoc version number to which the resources are updated to. -> -> The migration of the whole project to pandoc v2 might take a while. Sorry for the unconvenience, and keep visiting to check the project status. -> -> Copies of the resources for pandoc v1 will be kept in subfolders, for projects which still might need them. - ------ - -**Table of Contents** - - - - - [Available Goodies](#available-goodies) - - [Pandoc HTML5 Templates](#pandoc-html5-templates) - - [PP Macros](#pp-macros) - - [Skylighting CSS](#skylighting-css) - - [Third Party Code Credits](#third-party-code-credits) - - [Notes About Pandoc License](#notes-about-pandoc-license) - - [GPLv2 vs BSD-3](#gplv2-vs-bsd-3) - - [GNU General Public License v2.0](#gnu-general-public-license-v20) - - [BSD 3-clause “New” or “Revised” License](#bsd-3-clause-new-or-revised-license) - - - ------ - -# Available Goodies - -## Pandoc HTML5 Templates - -Currently, the only template current available is: - - - [GitHub Pandoc HTML5 Template](./templates/html5/github/) - - HTML Preview: [Local](./templates/html5/github/GitHub-Template-Preview.html) | [via HTMLPreview.GitHub.io](http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/templates/html5/github/GitHub-Template-Preview.html) - -## PP Macros - -The pp-macros section is an ongoing effort to create a collection of pp macros to extend pandoc’s markdown workflow by providing means to use GFM task lists in markdown source file, external syntax highlighters, and many more features. - - - [The PP-Macros Library](./pp/) - -> **About PP**: PP is a text preprocessor designed for Pandoc (and more generally Markdown and reStructuredText). It’s cross-platform and available as a single standalone binary file: -> -> - -> - -> - - -## Skylighting CSS - -The skylighting CSS section contains resources for styling code blocks in HTML format. - - - [Skylighting CSS](./skylighting-css) - -# Third Party Code Credits - -The “Pandoc-Goodies” project reuses third party source code from the following projects: - - - [GitHub Markdown CSS](https://github.com/sindresorhus/github-markdown-css) — © Sindre Sorhus, MIT License. - - [Primer CSS](https://github.com/primer/primer-css) — © 2016 GitHub Inc., MIT License. - -You’ll find more details and license information in the documentation of the subfolders. - -# Notes About Pandoc License - -Some legal stuff you should be aware regarding the license terms governing pandoc and some of its built-in resources. - -Pandoc is (c) 2006-2017 John MacFarlane, released under the **GPL v2** (or greater) license. - -The built-in styles (aka syntax themes) that pandoc injects into the final documents also fall under the same **GPL v2** license as pandoc. - -Pandoc’s built-in default templates are dual-licensed — under both the **GPL** (**v2** or higher, same as pandoc) and the **BSD 3-clause** (“New” or “Revised”) license: - - - - -You should be aware that the built-in syntax highlighting styles are not part of the templates, and therefore are not subject to dual-licensing. Styles are added at conversion time (for those format that support highlighting). Since pandoc’s default templates rely on the built-in styles, syntax highlighting might (depending on output format) automatically include into the final document a built-in style (“pygments”, by default). Since highligthing-styles are governed by the **GPL v2** license (which demands same licensing), opting for the **BSD 3-clause** license might no longer apply to the final document if the template and the styling are woven together into a single file. - -For a more detailed explanation regarding HTML templates and CSS styles, see: - - - [/skylighting-css/built-in-styles/README.md](./skylighting-css/built-in-styles/README.md#license) - -## GPLv2 vs BSD-3 - -A quick reference summary of both **GPL v2** and **BSD 3-clause** licenses — Text excerpts and tables taken from [choosealicense.com](https://choosealicense.com/) (license: [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)): - - - - - - -### GNU General Public License v2.0 - -The GNU GPL is the most widely used free software license and has a strong copyleft requirement. When distributing derived works, the source code of the work must be made available under the same license. There are multiple variants of the GNU GPL, each with different requirements. - -| Permissions | Conditions | Limitations | -| ---------------- | ------------------------------ | ----------- | -| ✔ Commercial use | ✔ Disclose source | ✘ Liability | -| ✔ Distribution | ✔ License and copyright notice | ✘ Warranty | -| ✔ Modification | ✔ Same license | | -| ✔ Private use | ✔ State changes | | - -### BSD 3-clause “New” or “Revised” License - -A permissive license similar to the [BSD 2-Clause License](https://choosealicense.com/licenses/bsd-2-clause/), but with a 3rd clause that prohibits others from using the name of the project or its contributors to promote derived products without written consent. - -| Permissions | Conditions | Limitations | -| ---------------- | ------------------------------ | ----------- | -| ✔ Commercial use | ✔ License and copyright notice | ✘ Liability | -| ✔ Distribution | | ✘ Warranty | -| ✔ Modification | | | -| ✔ Private use | | | +# Pandoc-Goodies + + pandoc v1.19.2 -> v2.0.2 | PP v2.0 + +A tresure-box of resources for pandoc, pp and the Texts word processor. + + - + +Copyright © Tristano Ajmone 2017, [MIT License](./LICENSE). + +The project is still WIP and in its early stages, but a pandoc html5 template is ready for use, along with a growing pp-macros library. + +> **PANDOC 2 NOTE** — Resources are currently being ported to the new pandoc v2. At the beginning of each section’s `README` you’ll see mentioned the pandoc version number to which the resources are updated to. +> +> The migration of the whole project to pandoc v2 might take a while. Sorry for the unconvenience, and keep visiting to check the project status. +> +> Copies of the resources for pandoc v1 will be kept in subfolders, for projects which still might need them. + +----- + +**Table of Contents** + + + + - [Available Goodies](#available-goodies) + - [Pandoc HTML5 Templates](#pandoc-html5-templates) + - [PP Macros](#pp-macros) + - [Skylighting CSS](#skylighting-css) + - [Third Party Code Credits](#third-party-code-credits) + - [Notes About Pandoc License](#notes-about-pandoc-license) + - [GPLv2 vs BSD-3](#gplv2-vs-bsd-3) + - [GNU General Public License v2.0](#gnu-general-public-license-v20) + - [BSD 3-clause “New” or “Revised” License](#bsd-3-clause-new-or-revised-license) + + + +----- + +# Available Goodies + +## Pandoc HTML5 Templates + +Currently, the only template current available is: + + - [GitHub Pandoc HTML5 Template](./templates/html5/github/) + - HTML Preview: [Local](./templates/html5/github/GitHub-Template-Preview.html) | [via HTMLPreview.GitHub.io](http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/templates/html5/github/GitHub-Template-Preview.html) + +## PP Macros + +The pp-macros section is an ongoing effort to create a collection of pp macros to extend pandoc’s markdown workflow by providing means to use GFM task lists in markdown source file, external syntax highlighters, and many more features. + + - [The PP-Macros Library](./pp/) + +> **About PP**: PP is a text preprocessor designed for Pandoc (and more generally Markdown and reStructuredText). It’s cross-platform and available as a single standalone binary file: +> +> - +> - +> - + +## Skylighting CSS + +The skylighting CSS section contains resources for styling code blocks in HTML format. + + - [Skylighting CSS](./skylighting-css) + +# Third Party Code Credits + +The “Pandoc-Goodies” project reuses third party source code from the following projects: + + - [GitHub Markdown CSS](https://github.com/sindresorhus/github-markdown-css) — © Sindre Sorhus, MIT License. + - [Primer CSS](https://github.com/primer/primer-css) — © 2016 GitHub Inc., MIT License. + +You’ll find more details and license information in the documentation of the subfolders. + +# Notes About Pandoc License + +Some legal stuff you should be aware regarding the license terms governing pandoc and some of its built-in resources. + +Pandoc is (c) 2006-2017 John MacFarlane, released under the **GPL v2** (or greater) license. + +The built-in styles (aka syntax themes) that pandoc injects into the final documents also fall under the same **GPL v2** license as pandoc. + +Pandoc’s built-in default templates are dual-licensed — under both the **GPL** (**v2** or higher, same as pandoc) and the **BSD 3-clause** (“New” or “Revised”) license: + + - + +You should be aware that the built-in syntax highlighting styles are not part of the templates, and therefore are not subject to dual-licensing. Styles are added at conversion time (for those format that support highlighting). Since pandoc’s default templates rely on the built-in styles, syntax highlighting might (depending on output format) automatically include into the final document a built-in style (“pygments”, by default). Since highligthing-styles are governed by the **GPL v2** license (which demands same licensing), opting for the **BSD 3-clause** license might no longer apply to the final document if the template and the styling are woven together into a single file. + +For a more detailed explanation regarding HTML templates and CSS styles, see: + + - [/skylighting-css/built-in-styles/README.md](./skylighting-css/built-in-styles/README.md#license) + +## GPLv2 vs BSD-3 + +A quick reference summary of both **GPL v2** and **BSD 3-clause** licenses — Text excerpts and tables taken from [choosealicense.com](https://choosealicense.com/) (license: [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)): + + - + - + +### GNU General Public License v2.0 + +The GNU GPL is the most widely used free software license and has a strong copyleft requirement. When distributing derived works, the source code of the work must be made available under the same license. There are multiple variants of the GNU GPL, each with different requirements. + +| Permissions | Conditions | Limitations | +| ---------------- | ------------------------------ | ----------- | +| ✔ Commercial use | ✔ Disclose source | ✘ Liability | +| ✔ Distribution | ✔ License and copyright notice | ✘ Warranty | +| ✔ Modification | ✔ Same license | | +| ✔ Private use | ✔ State changes | | + +### BSD 3-clause “New” or “Revised” License + +A permissive license similar to the [BSD 2-Clause License](https://choosealicense.com/licenses/bsd-2-clause/), but with a 3rd clause that prohibits others from using the name of the project or its contributors to promote derived products without written consent. + +| Permissions | Conditions | Limitations | +| ---------------- | ------------------------------ | ----------- | +| ✔ Commercial use | ✔ License and copyright notice | ✘ Liability | +| ✔ Distribution | | ✘ Warranty | +| ✔ Modification | | | +| ✔ Private use | | | diff --git a/pp/README.md b/pp/README.md index d33195b..f29d8ec 100644 --- a/pp/README.md +++ b/pp/README.md @@ -1,262 +1,262 @@ -PP-Macros -========= - - PP v2.0 - -“**The Pandoc-Goodies PP-Macros Library**” — An ongoing collaborative effort to build a library of PP macros to extend pandoc’s workflow: use GFM Task Lists in pandoc document, external syntax highlighters, and much more. - -Copyright © Tristano Ajmone 2017, [MIT License](../LICENSE). - ------------------------------------------------------------------------- - -**Table of Contents** - - -- [Introduction](#introduction) - - [About PP](#about-pp) -- [Requirements](#requirements) -- [Available Macros](#available-macros) - - [GFM Task Lists](#gfm-task-lists) - - [GitHub Alerts](#github-alerts) - - [Highlight](#highlight) - - [Inline Formatting](#inline-formatting) -- [Macros Documentation](#macros-documentation) - - - ------------------------------------------------------------------------- - -Introduction -============ - -The [`/macros/`](./macros/) folder is the container of the pp-macros library. The library is a collection of various macros files, all ending with `.pp` extension (an arbitrary choice). Each file is a collection of macros for a specific topic. The separation of macros into different files is intended to facilitate selecting and discarding specific macros, and mixing them with macros from elsewhere. - -The file [`macros.pp`](./macros/macros.pp) is the main macros file, which loads all other macros. - -About PP --------- - -PP is a text preprocessor designed by Christophe Delord ([@CDSoft](https://github.com/CDSoft)) for pandoc (and more generally Markdown and reStructuredText). PP ships with some very powerful built-in macros for literate programming, diagrams (GraphViz, PlantUML and ditaa), and running scripts inside markdown source. - -But the great power of PP is it’s extensibility through user-defined macros, branching and conditional statements. - -PP is cross-platform and available as a single standalone binary file: - -- -- -- — precompiled binaries (all releases) - -For some introductiory tutorials on using PP, see: - -- - -Requirements -============ - -The current macros library requires PP version `>= 2.0`. - -PP is evolving rapidly thanks to Christophe’s kind dedication to users features requests. Future versions of PP might break backward compatibility of some macros, but great effort is taken to ensure that the macros of ths library should always work with the latest release of PP. - -You can download prebuilt binaries of the latest version of PP from the following link: - -- - -Or you can download and compile the sources (Haskell) of specific PP releases from GitHub: - -- - -If you are looking for binaries of a specific release of PP, you can visit PP’s *Download Archive* page: - -- - -Available Macros -================ - -Currently, our PP macros library offers only macros targetting HTML output. - -“**The Pandoc-Goodies PP-Macros Library**” is organized into separate module files (“pp-macros sets”), stored in the [`/macros/`](./macros/) folder: - -- `macros.pp` — the main module that loads all other modules: - - [`GFM-Alerts.pp`](#github-alerts) — [Live Demo Preview][Live GFM-Alerts] - - [`GFM-TaskList.pp`](#gfm-task-lists) — [Live Demo Preview][Live GFM-TaskList] - - [`Highlight.pp`](#highlight) — [Live Demo Preview][Live Highlight] - - [`InlineFormatting.pp`](#inline-formatting) — [Live Demo Preview][Live InlineFormatting] - -> **NOTE**: Since the release of PP `v1.7-2` macros that were Windows-only are now cross-platform. - -GFM Task Lists --------------- - - GFM-TaskList.pp - -A set of macros to enable GitHub [Task Lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists) in pandoc documents. - -macros: - -- `!TaskList( LIST ELEMENTS )` — Genreate Task List enclosing-tags. -- `!Task(x| )( TASK TEXT )[( SUB-TASKLIST )]` — Generate a Task element and (optionally) initiate a sub-list. -- `!TaskListInlineCSS` — Inject required CSS. - -> **NOTE**: Using square brackets for `!Task` parameters is adviced since it resembles the GFM syntax. - -Example usage: - - !TaskList - ~~~~~~~~~~~~~~~~~~~~~~~ - !Task[x][I'm a _checked_ task] - !Task[ ][I'm an _unchecked_ task] - ~~~~~~~~~~~~~~~~~~~~~~~ - -Example of a nested Task List: - - !TaskList - ~~~~~~~~~~~~~~~~~~~~~~~ - !Task[ ][Task 1][ - !Task[x][SubTask 1] - !Task[ ][SubTask 2][ - !Task[x][Sub-SubTask 1]]] - !Task[x][Task 2] - ~~~~~~~~~~~~~~~~~~~~~~~ - -… or, using fences to wrap last parameters, instead of brackets: - - !TaskList - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - !Task[ ][Task 1] - ~~~~~~~~~~~~~~~~~~~~~~~~ - !Task[x][SubTask 1] - !Task[ ][SubTask 2] - ~~~~~~~~~~~~~~~~~~~ - !Task[x][Sub-SubTask 1] - ~~~~~~~~~~~~~~~~~~~ - ~~~~~~~~~~~~~~~~~~~~~~~~ - !Task[ ][Task 2] - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In order to hyde the list items’ bullet (so that only the checkbox is shown) you’ll need the CSS definitions found in the `GFM-TaskList.css` file. You have different options: - -1. Add its contents to your custom stylesheet. -2. Tell pandoc to import it via the `--css` option — you can exploit the `%PP_MACROS_PATH%` env var: `--css %PP_MACROS_PATH%GFM-TaskList.css` -3. Inject it as an inline stylesheet via the `!raw(!TaskListInlineCSS)` macro (a quick and universal solution, if you don’t mind CSS definitions within the document body). - -Without these CSS definitions the task list will still look acceptable, but having both a bullet and a checkbox for each entry is redundant. - -> **NOTES**: Markdown syntax within Task’s `TASK TEXT` will be rendered correctly, provided pandoc’s `markdown_in_html_blocks` extension is enabled (default in pandoc markdown). -> -> Since “`GFM-TaskList.pp`” v2.0, nested Task Lists are rendered in the final HTML the proper way — ie: `
    ` and `
  • ` tags are nested in a syntactically correct manner. - -Examples: - -- [`/test/GFM-TaskList.md`](./test/GFM-TaskList.md) -- [`/test/GFM-TaskList.html`](./test/GFM-TaskList.html) — [Live Demo Preview][Live GFM-TaskList] -- [GitHub Pandoc HTML5 Template Preview](../templates/html5/github/GitHub-Template-Preview.html) - -GitHub Alerts -------------- - - GFM-Alerts.pp - GFM-Alerts.css - -A set of macros to create GitHub alerts (aka flash messages) within pandoc documents: - -- - -macros: - -- `!GFMAlertsInlineCSS` — Inject required CSS -- `!GFMAlert( CONTENTS )` — Default alert (blue) -- `!GFMError( CONTENTS )` — Error alert (red) -- `!GFMWarn( CONTENTS )` — Warning alert (yellow) -- `!GFMSuccess( CONTENTS )` — Success alert (green) -- `!GFMAlertPlain( CONTENTS )` — Plain alert (grey) - -> **NOTE**: The “Plain” alert (`!GFMAlertPlain`) isn’t part of the original Primer-CSS alerts set. It was added to provide a more neutral, less appariscent alert box. - -To render the alerts properly you’ll need the definitions found in “[`GFM-Alerts.css`](./macros/GFM-Alerts.css)”. You can either: - -1. Include “`GFM-Alerts.css`” in the final document via pandoc’s `--css` option — you can exploit the `%PP_MACROS_PATH%` env var: `--css %PP_MACROS_PATH%GFM-Alerts.css` -2. Add the contents of “`GFM-Alerts.css`” to your pandoc template stylesheet. -3. Use the `!GFMAlertsInlineCSS` macro to inject “`GFM-Alerts.css`” as an inline CSS definition in the final document. - -Examples: - -- [`/test/GFM-Alerts.md`](./test/GFM-Alerts.md) -- [`/test/GFM-Alerts.html`](./test/GFM-Alerts.html) — [Live Demo Preview][Live GFM-Alerts] -- [GitHub Pandoc HTML5 Template Preview](../templates/html5/github/GitHub-Template-Preview.html) - -Highlight ---------- - - Highlight.pp - -A set of macros for using André Simon’s Highlight tool: - -- -- - -macros: - -- `!HighlightFile(FILE)(LANG)[(OPTIONS)]` — imports and syntax-highlights and external file. Output is a raw html `
    ` block.
    --   `!Highlight(LANG)([OPTIONS])(CODE)` — syntax-higlights the block of source code passed as `CODE` parameter (using lines of tildas instread of brackets; see Note below).
    --   `!HighlightInlineTheme(THEME)` — retrives a Highlight theme and injects its CSS version into the documents. A quick solution for theming Highlight code withouth having to import an external CSS file via pandoc.
    -
    -> **NOTE 1**: The `CODE` parameter is passed between lines of tildas instead of brackets:
    ->
    ->       !Highlight( LANG )( OPTIONS )
    ->       ~~~~~
    ->       CODE
    ->       ~~~~~
    ->       }
    ->
    -> From PP’s documentation:
    ->
    -> > The last argument can be enclosed between lines of tildas or backquotes (of the same length) instead of parenthesis, brackets or braces and. This is useful for literate programming, diagrams or scripts (see examples). Code block arguments are not stripped: spaces and blank lines are preserved.
    -
    -
    -> **NOTE 2**: This macro, when run inside Windows CMD, creates a temporary file (named “`_pp-tempfileX.tmp`”, where `X` is a numeric counter) in the macros folder (`/pp/macros/`) for each macro call in the document, to temporarily store the code to highlight. At each PP invocation the `X` counter is reset, and the previous temp files are written over. These temporary files are set to be ignored by Git, so you shouldn’t worry about them.
    ->
    -> When run inside Shell/Bash (including Git Bash for Windows) it doesn’t write any temporary files to disk.
    -
    -
    -> **NOTE 3**: You can use Highlight along with pandoc’s built in syntax highlighter — pandoc only highlights markdown code blocks (fenced, or backticked) and will ignore the `
    ` raw html blocks produced by Highlight.
    ->
    -> Pandoc automatically adds its own stylesheet for its highlighted code, the Highlight macro doesn’t.
    ->
    -> Pandoc highlighted source code uses different tags from Highlight, so their stylesheets won’t clash nor overlap.
    -
    -Examples:
    -
    --   [`/test/Highlight.md`](./test/Highlight.md)
    --   [`/test/Highlight.html`](./test/Highlight.html) — [Live Demo Preview][Live Highlight]
    -
    -Inline Formatting
    ------------------
    -
    -    InlineFormatting.pp
    -    kbd_GitHub.css
    -
    -A convenience set of shortcut-macros for various standard html inline elements:
    -
    --   `!kbd( KEY1 )[( KEY2 )( KEY3 )( KEY4 )]` — keystrokes in `` tags.
    --   `!kbdInlineCSS` — Inject required CSS (“`kbd_GitHub.css`”)
    -
    -The `!kbd` macro can take from 1 to 4 parameters, each representing the text to show in the Keystroke.
    -
    -Examples:
    -
    --   [`/test/InlineFormatting.md`](./test/InlineFormatting.md)
    --   [`/test/InlineFormatting.html`](./test/InlineFormatting.html) — [Live Demo Preview][Live InlineFormatting]
    -
    -Macros Documentation
    -====================
    -
    -*WIP! Coming soon…*
    -
    -Documentation and usage examples for the macros library is still work in progress. Right now, to gain insight into the macros you should refer to the [`/test/`](./test/) folder, an peek at the markdown source of the template preview and the batch files used to convert it:
    -
    --   [`../templates/html5/github/src/`](../templates/html5/github/src/)
    -
    -[Live Highlight]: http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/pp/test/Highlight.html "HTML Live Preview of Highlight PP-Macros Test"
    -[Live InlineFormatting]: http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/pp/test/InlineFormatting.html "HTML Live Preview of Inline Formatting PP-Macros Test"
    -[Live GFM-TaskList]: http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/pp/test/GFM-TaskList.html "HTML Live Preview of GFM-TaskList PP-Macros Test"
    +PP-Macros
    +=========
    +
    +    PP v2.0
    +
    +“**The Pandoc-Goodies PP-Macros Library**” — An ongoing collaborative effort to build a library of PP macros to extend pandoc’s workflow: use GFM Task Lists in pandoc document, external syntax highlighters, and much more.
    +
    +Copyright © Tristano Ajmone 2017, [MIT License](../LICENSE).
    +
    +------------------------------------------------------------------------
    +
    +**Table of Contents**
    +
    +
    +-   [Introduction](#introduction)
    +    -   [About PP](#about-pp)
    +-   [Requirements](#requirements)
    +-   [Available Macros](#available-macros)
    +    -   [GFM Task Lists](#gfm-task-lists)
    +    -   [GitHub Alerts](#github-alerts)
    +    -   [Highlight](#highlight)
    +    -   [Inline Formatting](#inline-formatting)
    +-   [Macros Documentation](#macros-documentation)
    +
    +
    +
    +------------------------------------------------------------------------
    +
    +Introduction
    +============
    +
    +The [`/macros/`](./macros/) folder is the container of the pp-macros library. The library is a collection of various macros files, all ending with `.pp` extension (an arbitrary choice). Each file is a collection of macros for a specific topic. The separation of macros into different files is intended to facilitate selecting and discarding specific macros, and mixing them with macros from elsewhere.
    +
    +The file [`macros.pp`](./macros/macros.pp) is the main macros file, which loads all other macros.
    +
    +About PP
    +--------
    +
    +PP is a text preprocessor designed by Christophe Delord ([@CDSoft](https://github.com/CDSoft)) for pandoc (and more generally Markdown and reStructuredText). PP ships with some very powerful built-in macros for literate programming, diagrams (GraphViz, PlantUML and ditaa), and running scripts inside markdown source.
    +
    +But the great power of PP is it’s extensibility through user-defined macros, branching and conditional statements.
    +
    +PP is cross-platform and available as a single standalone binary file:
    +
    +-   
    +-   
    +-    — precompiled binaries (all releases)
    +
    +For some introductiory tutorials on using PP, see:
    +
    +-   
    +
    +Requirements
    +============
    +
    +The current macros library requires PP version `>= 2.0`.
    +
    +PP is evolving rapidly thanks to Christophe’s kind dedication to users features requests. Future versions of PP might break backward compatibility of some macros, but great effort is taken to ensure that the macros of ths library should always work with the latest release of PP.
    +
    +You can download prebuilt binaries of the latest version of PP from the following link:
    +
    +-   
    +
    +Or you can download and compile the sources (Haskell) of specific PP releases from GitHub:
    +
    +-   
    +
    +If you are looking for binaries of a specific release of PP, you can visit PP’s *Download Archive* page:
    +
    +-   
    +
    +Available Macros
    +================
    +
    +Currently, our PP macros library offers only macros targetting HTML output.
    +
    +“**The Pandoc-Goodies PP-Macros Library**” is organized into separate module files (“pp-macros sets”), stored in the [`/macros/`](./macros/) folder:
    +
    +-   `macros.pp` — the main module that loads all other modules:
    +    -   [`GFM-Alerts.pp`](#github-alerts) — [Live Demo Preview][Live GFM-Alerts]
    +    -   [`GFM-TaskList.pp`](#gfm-task-lists) — [Live Demo Preview][Live GFM-TaskList]
    +    -   [`Highlight.pp`](#highlight) — [Live Demo Preview][Live Highlight]
    +    -   [`InlineFormatting.pp`](#inline-formatting) — [Live Demo Preview][Live InlineFormatting]
    +
    +> **NOTE**: Since the release of PP `v1.7-2` macros that were Windows-only are now cross-platform.
    +
    +GFM Task Lists
    +--------------
    +
    +    GFM-TaskList.pp
    +
    +A set of macros to enable GitHub [Task Lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists) in pandoc documents.
    +
    +macros:
    +
    +-   `!TaskList( LIST ELEMENTS )` — Genreate Task List enclosing-tags.
    +-   `!Task(x| )( TASK TEXT )[( SUB-TASKLIST )]` — Generate a Task element and (optionally) initiate a sub-list.
    +-   `!TaskListInlineCSS` — Inject required CSS.
    +
    +> **NOTE**: Using square brackets for `!Task` parameters is adviced since it resembles the GFM syntax.
    +
    +Example usage:
    +
    +    !TaskList
    +    ~~~~~~~~~~~~~~~~~~~~~~~
    +    !Task[x][I'm a _checked_ task]
    +    !Task[ ][I'm an _unchecked_ task]
    +    ~~~~~~~~~~~~~~~~~~~~~~~
    +
    +Example of a nested Task List:
    +
    +    !TaskList
    +    ~~~~~~~~~~~~~~~~~~~~~~~
    +    !Task[ ][Task 1][
    +      !Task[x][SubTask 1]
    +      !Task[ ][SubTask 2][
    +        !Task[x][Sub-SubTask 1]]]
    +    !Task[x][Task 2]
    +    ~~~~~~~~~~~~~~~~~~~~~~~
    +
    +… or, using fences to wrap last parameters, instead of brackets:
    +
    +    !TaskList
    +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    +    !Task[ ][Task 1]
    +    ~~~~~~~~~~~~~~~~~~~~~~~~
    +    !Task[x][SubTask 1]
    +    !Task[ ][SubTask 2]
    +    ~~~~~~~~~~~~~~~~~~~
    +    !Task[x][Sub-SubTask 1]
    +    ~~~~~~~~~~~~~~~~~~~
    +    ~~~~~~~~~~~~~~~~~~~~~~~~
    +    !Task[ ][Task 2]
    +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    +
    +In order to hyde the list items’ bullet (so that only the checkbox is shown) you’ll need the CSS definitions found in the `GFM-TaskList.css` file. You have different options:
    +
    +1.  Add its contents to your custom stylesheet.
    +2.  Tell pandoc to import it via the `--css` option — you can exploit the `%PP_MACROS_PATH%` env var: `--css %PP_MACROS_PATH%GFM-TaskList.css`
    +3.  Inject it as an inline stylesheet via the `!raw(!TaskListInlineCSS)` macro (a quick and universal solution, if you don’t mind CSS definitions within the document body).
    +
    +Without these CSS definitions the task list will still look acceptable, but having both a bullet and a checkbox for each entry is redundant.
    +
    +> **NOTES**: Markdown syntax within Task’s `TASK TEXT` will be rendered correctly, provided pandoc’s `markdown_in_html_blocks` extension is enabled (default in pandoc markdown).
    +>
    +> Since “`GFM-TaskList.pp`” v2.0, nested Task Lists are rendered in the final HTML the proper way — ie: `
      ` and `
    • ` tags are nested in a syntactically correct manner. + +Examples: + +- [`/test/GFM-TaskList.md`](./test/GFM-TaskList.md) +- [`/test/GFM-TaskList.html`](./test/GFM-TaskList.html) — [Live Demo Preview][Live GFM-TaskList] +- [GitHub Pandoc HTML5 Template Preview](../templates/html5/github/GitHub-Template-Preview.html) + +GitHub Alerts +------------- + + GFM-Alerts.pp + GFM-Alerts.css + +A set of macros to create GitHub alerts (aka flash messages) within pandoc documents: + +- + +macros: + +- `!GFMAlertsInlineCSS` — Inject required CSS +- `!GFMAlert( CONTENTS )` — Default alert (blue) +- `!GFMError( CONTENTS )` — Error alert (red) +- `!GFMWarn( CONTENTS )` — Warning alert (yellow) +- `!GFMSuccess( CONTENTS )` — Success alert (green) +- `!GFMAlertPlain( CONTENTS )` — Plain alert (grey) + +> **NOTE**: The “Plain” alert (`!GFMAlertPlain`) isn’t part of the original Primer-CSS alerts set. It was added to provide a more neutral, less appariscent alert box. + +To render the alerts properly you’ll need the definitions found in “[`GFM-Alerts.css`](./macros/GFM-Alerts.css)”. You can either: + +1. Include “`GFM-Alerts.css`” in the final document via pandoc’s `--css` option — you can exploit the `%PP_MACROS_PATH%` env var: `--css %PP_MACROS_PATH%GFM-Alerts.css` +2. Add the contents of “`GFM-Alerts.css`” to your pandoc template stylesheet. +3. Use the `!GFMAlertsInlineCSS` macro to inject “`GFM-Alerts.css`” as an inline CSS definition in the final document. + +Examples: + +- [`/test/GFM-Alerts.md`](./test/GFM-Alerts.md) +- [`/test/GFM-Alerts.html`](./test/GFM-Alerts.html) — [Live Demo Preview][Live GFM-Alerts] +- [GitHub Pandoc HTML5 Template Preview](../templates/html5/github/GitHub-Template-Preview.html) + +Highlight +--------- + + Highlight.pp + +A set of macros for using André Simon’s Highlight tool: + +- +- + +macros: + +- `!HighlightFile(FILE)(LANG)[(OPTIONS)]` — imports and syntax-highlights and external file. Output is a raw html `
      ` block.
      +-   `!Highlight(LANG)([OPTIONS])(CODE)` — syntax-higlights the block of source code passed as `CODE` parameter (using lines of tildas instread of brackets; see Note below).
      +-   `!HighlightInlineTheme(THEME)` — retrives a Highlight theme and injects its CSS version into the documents. A quick solution for theming Highlight code withouth having to import an external CSS file via pandoc.
      +
      +> **NOTE 1**: The `CODE` parameter is passed between lines of tildas instead of brackets:
      +>
      +>       !Highlight( LANG )( OPTIONS )
      +>       ~~~~~
      +>       CODE
      +>       ~~~~~
      +>       }
      +>
      +> From PP’s documentation:
      +>
      +> > The last argument can be enclosed between lines of tildas or backquotes (of the same length) instead of parenthesis, brackets or braces and. This is useful for literate programming, diagrams or scripts (see examples). Code block arguments are not stripped: spaces and blank lines are preserved.
      +
      +
      +> **NOTE 2**: This macro, when run inside Windows CMD, creates a temporary file (named “`_pp-tempfileX.tmp`”, where `X` is a numeric counter) in the macros folder (`/pp/macros/`) for each macro call in the document, to temporarily store the code to highlight. At each PP invocation the `X` counter is reset, and the previous temp files are written over. These temporary files are set to be ignored by Git, so you shouldn’t worry about them.
      +>
      +> When run inside Shell/Bash (including Git Bash for Windows) it doesn’t write any temporary files to disk.
      +
      +
      +> **NOTE 3**: You can use Highlight along with pandoc’s built in syntax highlighter — pandoc only highlights markdown code blocks (fenced, or backticked) and will ignore the `
      ` raw html blocks produced by Highlight.
      +>
      +> Pandoc automatically adds its own stylesheet for its highlighted code, the Highlight macro doesn’t.
      +>
      +> Pandoc highlighted source code uses different tags from Highlight, so their stylesheets won’t clash nor overlap.
      +
      +Examples:
      +
      +-   [`/test/Highlight.md`](./test/Highlight.md)
      +-   [`/test/Highlight.html`](./test/Highlight.html) — [Live Demo Preview][Live Highlight]
      +
      +Inline Formatting
      +-----------------
      +
      +    InlineFormatting.pp
      +    kbd_GitHub.css
      +
      +A convenience set of shortcut-macros for various standard html inline elements:
      +
      +-   `!kbd( KEY1 )[( KEY2 )( KEY3 )( KEY4 )]` — keystrokes in `` tags.
      +-   `!kbdInlineCSS` — Inject required CSS (“`kbd_GitHub.css`”)
      +
      +The `!kbd` macro can take from 1 to 4 parameters, each representing the text to show in the Keystroke.
      +
      +Examples:
      +
      +-   [`/test/InlineFormatting.md`](./test/InlineFormatting.md)
      +-   [`/test/InlineFormatting.html`](./test/InlineFormatting.html) — [Live Demo Preview][Live InlineFormatting]
      +
      +Macros Documentation
      +====================
      +
      +*WIP! Coming soon…*
      +
      +Documentation and usage examples for the macros library is still work in progress. Right now, to gain insight into the macros you should refer to the [`/test/`](./test/) folder, an peek at the markdown source of the template preview and the batch files used to convert it:
      +
      +-   [`../templates/html5/github/src/`](../templates/html5/github/src/)
      +
      +[Live Highlight]: http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/pp/test/Highlight.html "HTML Live Preview of Highlight PP-Macros Test"
      +[Live InlineFormatting]: http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/pp/test/InlineFormatting.html "HTML Live Preview of Inline Formatting PP-Macros Test"
      +[Live GFM-TaskList]: http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/pp/test/GFM-TaskList.html "HTML Live Preview of GFM-TaskList PP-Macros Test"
       [Live GFM-Alerts]: http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/pp/test/GFM-Alerts.html "HTML Live Preview of GFM-Alerts PP-Macros Test"
      \ No newline at end of file
      diff --git a/pp/macros/CHANGELOG b/pp/macros/CHANGELOG
      index 120e752..3056788 100644
      --- a/pp/macros/CHANGELOG
      +++ b/pp/macros/CHANGELOG
      @@ -1,124 +1,124 @@
      -==============================================================================
      -                         PP-Macros Library CHANGELOG                          
      -==============================================================================
      -NOTE: Obvious changes won't be logged -- eg: addition of "!import" statements
      -      of newly created macros modules to "macros.pp" is given for granted.
      -      Minor changes will not be logged either, because life is too short...
      -
      -------------------------------------------------------------------------------
      -                                  2017-10-25                                  
      -------------------------------------------------------------------------------
      -PP VERSION v2.0
      -
      -This is a major update. PP v1.11 already introduced some macros behaviour
      -changes (bug fixes in nested parameters); PP v2.0 drops support for the "\"
      -macro character: only the "!" syntax is supported by default, even though the
      -new built-in "!macrochars" allows defining multiple custom macro chars
      -(so "!macrochars(!\)" allows backward compatible behaviour).
      -
      -- All macros updated to use only the "!" syntax.
      -- All macros version bumped up to 2.0 to align with PP version.
      -- Macros end-user usage syntax remain unchanged (apart from PP not longer
      -  supporting the "\" macro char syntax).
      -
      -CHANGES:
      -- "Highlight.pp" v2.1:
      -  - The "!Highlight" macro now detects the current context running PP:
      -    - if Shell/Bash: it invokes !HighlightSh    (even under Git Bash for Win)
      -    - if Win CMD:    it invokes !HighlightCMD
      -- "Highlight.pp" v2.0:
      -  - THe passed LANG is now added also to 
       tag, to allow finer styling
      -    control with custom CSS: 
      
      -    (before it was added only to the 
       tag).
      -- "GFM-TaskList.pp" v2.0:
      -  - Added support for nested Task Lists via optional third parameter
      -    (doesn't break backward compatibility with older version).
      -------------------------------------------------------------------------------
      -                                  2017-07-05                                  
      -------------------------------------------------------------------------------
      -FIXED:
      -- "Highlight.pp" v1.4 (2017-07-05): The macros were invoking "highlight.exe",
      -  now changed to "highlight" for cross platformness (thanks to @bpj for
      -  pointing it out).
      -------------------------------------------------------------------------------
      -                                  2017-07-04                                  
      -------------------------------------------------------------------------------
      -PP VERSION v1.9.3
      -
      -ADDED:
      -- "Highlight.pp" v1.3:
      -  - Added "!Highlight" macro to syntax-highlight a block of code passed as
      -    macro parameter within lines of tildas. NOTE: Currently this macro needs
      -    to write a temporary file in the macros folder for each macro invocation,
      -    then deletes the temporary files. Couldn't find a better solution. Tested
      -    on Windows but should also work on Linux.
      -- "Highlight.pp" test files.
      -------------------------------------------------------------------------------
      -                                  2017-04-18                                  
      -------------------------------------------------------------------------------
      -ADDED:
      -- "GFM-TaskList.pp" v1.1.0:
      -  - Added "GFM-TaskList.css" stylesheet.
      -  - Added "!TaskListInlineCSS" macro to import "GFM-TaskList.css" as inline CSS.
      -------------------------------------------------------------------------------
      -                                  2017-04-16                                  
      -------------------------------------------------------------------------------
      -PP VERSION v1.7-2
      -
      -CHANGED:
      -- "Highlight.pp" v1.2: Now cross-platform thanks to "!exec" built-in macro
      -  in PP v1.7-2 (used instead of "!cmd")
      -------------------------------------------------------------------------------
      -                                  2017-04-14                                  
      -------------------------------------------------------------------------------
      -CHANGED:
      -- "Highlight.pp" v1.1: Added "--validate-input" option to Highlight invocation
      -  (ie: test if input is text, and remove Unicode BOM). This prevents BOM chars
      -  from showing up in the highlighted code when importing a file that has BOM. 
      -------------------------------------------------------------------------------
      -                                  2017-04-11                                  
      -------------------------------------------------------------------------------
      -ADDED:
      -- "InlineFormatting.pp": A set of shortcut-macros for various standard html 
      -   inline elements:
      -   - "!kbd(KEY1)[(KEY2)(KEY3)(KEY4)]"
      -   - "!kbdInlineCSS": imports "kbd_GitHub.css" as inline CSS.
      -- "kbd_GitHub.css": GitHub's  styling.
      -------------------------------------------------------------------------------
      -                                  2017-04-10                                  
      -------------------------------------------------------------------------------
      -Now a "test" folder has been created for testing the various macros modules.
      -
      -CHANGED:
      -- "GFM-Alert.pp" -> "GFM-Alerts.pp"
      -- "GFM-Alerts.pp" v1.0.2:
      -  - Now description instructs using the included CSS file "GFM-Alerts.css".
      -  - Added "!GFMAlertsInlineCSS" macro to import "GFM-Alerts.css" as inline CSS.
      -  - Added "!GFMAlertPlain()" macro, with grey colors.
      -- "macros.pp" v1.0.2:
      -  - "!import(GFM-Alert.pp)" -> "!import(GFM-Alerts.pp)"
      -ADDED:
      -- "GFM-Alerts.css":
      -  - reduced version of Primer CSS's module "flash.scss":
      -    https://github.com/primer/primer-alerts/blob/master/lib/flash.scss
      -    Copyright (c) 2016 GitHub Inc. Released under The MIT License (MIT).
      -------------------------------------------------------------------------------
      -                                2017-04-09 (B)                                
      -------------------------------------------------------------------------------
      -Updated all macros files to PP v1.4 (new features).
      -All macros now have comments with version info and description.
      -The "macros.pp" module now loads the other macros via the new !import() macro,
      -instead of the old !include().
      -
      -- "macros.pp" v1.0.1
      -- "GFM-Alert.pp" v1.0.1
      -- "GFM-TaskList.pp" v1.0.1
      -- "Highlight.pp" v1.0.1
      -------------------------------------------------------------------------------
      -                                2017-04-09 (A)                                
      -------------------------------------------------------------------------------
      -First release, PP v1.3.
      -- "macros.pp" v1.0
      -- "GFM-Alert.pp" v1.0
      -- "GFM-TaskList.pp" v1.0
      -- "Highlight.pp" v1.0
      +==============================================================================
      +                         PP-Macros Library CHANGELOG                          
      +==============================================================================
      +NOTE: Obvious changes won't be logged -- eg: addition of "!import" statements
      +      of newly created macros modules to "macros.pp" is given for granted.
      +      Minor changes will not be logged either, because life is too short...
      +
      +------------------------------------------------------------------------------
      +                                  2017-10-25                                  
      +------------------------------------------------------------------------------
      +PP VERSION v2.0
      +
      +This is a major update. PP v1.11 already introduced some macros behaviour
      +changes (bug fixes in nested parameters); PP v2.0 drops support for the "\"
      +macro character: only the "!" syntax is supported by default, even though the
      +new built-in "!macrochars" allows defining multiple custom macro chars
      +(so "!macrochars(!\)" allows backward compatible behaviour).
      +
      +- All macros updated to use only the "!" syntax.
      +- All macros version bumped up to 2.0 to align with PP version.
      +- Macros end-user usage syntax remain unchanged (apart from PP not longer
      +  supporting the "\" macro char syntax).
      +
      +CHANGES:
      +- "Highlight.pp" v2.1:
      +  - The "!Highlight" macro now detects the current context running PP:
      +    - if Shell/Bash: it invokes !HighlightSh    (even under Git Bash for Win)
      +    - if Win CMD:    it invokes !HighlightCMD
      +- "Highlight.pp" v2.0:
      +  - THe passed LANG is now added also to 
       tag, to allow finer styling
      +    control with custom CSS: 
      
      +    (before it was added only to the 
       tag).
      +- "GFM-TaskList.pp" v2.0:
      +  - Added support for nested Task Lists via optional third parameter
      +    (doesn't break backward compatibility with older version).
      +------------------------------------------------------------------------------
      +                                  2017-07-05                                  
      +------------------------------------------------------------------------------
      +FIXED:
      +- "Highlight.pp" v1.4 (2017-07-05): The macros were invoking "highlight.exe",
      +  now changed to "highlight" for cross platformness (thanks to @bpj for
      +  pointing it out).
      +------------------------------------------------------------------------------
      +                                  2017-07-04                                  
      +------------------------------------------------------------------------------
      +PP VERSION v1.9.3
      +
      +ADDED:
      +- "Highlight.pp" v1.3:
      +  - Added "!Highlight" macro to syntax-highlight a block of code passed as
      +    macro parameter within lines of tildas. NOTE: Currently this macro needs
      +    to write a temporary file in the macros folder for each macro invocation,
      +    then deletes the temporary files. Couldn't find a better solution. Tested
      +    on Windows but should also work on Linux.
      +- "Highlight.pp" test files.
      +------------------------------------------------------------------------------
      +                                  2017-04-18                                  
      +------------------------------------------------------------------------------
      +ADDED:
      +- "GFM-TaskList.pp" v1.1.0:
      +  - Added "GFM-TaskList.css" stylesheet.
      +  - Added "!TaskListInlineCSS" macro to import "GFM-TaskList.css" as inline CSS.
      +------------------------------------------------------------------------------
      +                                  2017-04-16                                  
      +------------------------------------------------------------------------------
      +PP VERSION v1.7-2
      +
      +CHANGED:
      +- "Highlight.pp" v1.2: Now cross-platform thanks to "!exec" built-in macro
      +  in PP v1.7-2 (used instead of "!cmd")
      +------------------------------------------------------------------------------
      +                                  2017-04-14                                  
      +------------------------------------------------------------------------------
      +CHANGED:
      +- "Highlight.pp" v1.1: Added "--validate-input" option to Highlight invocation
      +  (ie: test if input is text, and remove Unicode BOM). This prevents BOM chars
      +  from showing up in the highlighted code when importing a file that has BOM. 
      +------------------------------------------------------------------------------
      +                                  2017-04-11                                  
      +------------------------------------------------------------------------------
      +ADDED:
      +- "InlineFormatting.pp": A set of shortcut-macros for various standard html 
      +   inline elements:
      +   - "!kbd(KEY1)[(KEY2)(KEY3)(KEY4)]"
      +   - "!kbdInlineCSS": imports "kbd_GitHub.css" as inline CSS.
      +- "kbd_GitHub.css": GitHub's  styling.
      +------------------------------------------------------------------------------
      +                                  2017-04-10                                  
      +------------------------------------------------------------------------------
      +Now a "test" folder has been created for testing the various macros modules.
      +
      +CHANGED:
      +- "GFM-Alert.pp" -> "GFM-Alerts.pp"
      +- "GFM-Alerts.pp" v1.0.2:
      +  - Now description instructs using the included CSS file "GFM-Alerts.css".
      +  - Added "!GFMAlertsInlineCSS" macro to import "GFM-Alerts.css" as inline CSS.
      +  - Added "!GFMAlertPlain()" macro, with grey colors.
      +- "macros.pp" v1.0.2:
      +  - "!import(GFM-Alert.pp)" -> "!import(GFM-Alerts.pp)"
      +ADDED:
      +- "GFM-Alerts.css":
      +  - reduced version of Primer CSS's module "flash.scss":
      +    https://github.com/primer/primer-alerts/blob/master/lib/flash.scss
      +    Copyright (c) 2016 GitHub Inc. Released under The MIT License (MIT).
      +------------------------------------------------------------------------------
      +                                2017-04-09 (B)                                
      +------------------------------------------------------------------------------
      +Updated all macros files to PP v1.4 (new features).
      +All macros now have comments with version info and description.
      +The "macros.pp" module now loads the other macros via the new !import() macro,
      +instead of the old !include().
      +
      +- "macros.pp" v1.0.1
      +- "GFM-Alert.pp" v1.0.1
      +- "GFM-TaskList.pp" v1.0.1
      +- "Highlight.pp" v1.0.1
      +------------------------------------------------------------------------------
      +                                2017-04-09 (A)                                
      +------------------------------------------------------------------------------
      +First release, PP v1.3.
      +- "macros.pp" v1.0
      +- "GFM-Alert.pp" v1.0
      +- "GFM-TaskList.pp" v1.0
      +- "Highlight.pp" v1.0
      diff --git a/pp/macros/GFM-Alerts.pp b/pp/macros/GFM-Alerts.pp
      index 298556b..d88fd32 100644
      --- a/pp/macros/GFM-Alerts.pp
      +++ b/pp/macros/GFM-Alerts.pp
      @@ -1,139 +1,139 @@
      -!comment(   "GitHub Alerts" pp-macros set   )
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -"GFM-Alerts.pp" v2.0 (2017-10-25) | PP v2.0
      -
      -A set of macros for mimicking GitHub's Alerts (aka flash messages) within pandoc
      -documents:
      -
      --- http://primercss.io/alerts/
      -------------------------------------------------------------------------------
      -MACROS LIST:
      -
      --- !GFMAlert
      --- !GFMAlertWarn
      --- !GFMAlertError
      --- !GFMAlertSuccess
      --- !GFMAlertPlain
      --- !GFMAlertsInlineCSS
      -
      -INTERNAL-USE MACROS:
      -
      --- !_buildGFMAlerts
      ---------------------------------------------------------------------------------
      -  OUT FORMAT: html
      -  OS SUPPORT: all
      -REQUIREMENTS:
      -  -- "GFM-Alerts.css" must be included in final document's stylesheet.
      -     (Adapted from GitHub's Prime-CSS "flash.scss" module:)
      -     https://github.com/primer/primer-alerts/blob/master/lib/flash.scss
      -  -- Env var PP_MACROS_PATH must be set to the path of this folder in order for
      -     !GFMAlertsInlineCSS to be able to include "GFM-Alerts.css".
      ---------------------------------------------------------------------------------
      -This file is part of "The Pandoc-Goodies PP-Macros Library":
      - -- https://github.com/tajmone/pandoc-goodies/tree/master/pp
      -
      -(c) Tristano Ajmone 2017, MIT License.
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -
      -
      -
      -
      -!comment{   !_buildGFMAlerts                                 v2.0 | 2017-10-25 }
      -````````````````````````````````````````````````````````````````````````````````
      -** FOR INTERNAL USE ONLY! **
      -````````````````````````````````````````````````````````````````````````````````
      -!define(   _buildGFMAlerts   )
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -
      -
      -!1 -
      -
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - -!comment{ !GFMAlert v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Wraps the contents of the macro's parameter in GitHub style Alert -
      s (aka "Flash messages"). - Contents will be processed as markdown. -USAGE: - - !Alert - ~~~~~~~~~~~~~~ - MARKDOWN BLOCK - ~~~~~~~~~~~~~~ - -```````````````````````````````````````````````````````````````````````````````` -!define( GFMAlert ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!undefine(AlertType) -!_buildGFMAlerts(!1) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - -!comment -```````````````````````````````````````````````````````````````````````````````` -The following macros are just variations of the previous one. -Same usage, different output colors. -```````````````````````````````````````````````````````````````````````````````` - - -!define( GFMWarn ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!define( AlertType )(warn) -!_buildGFMAlerts(!1) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -!define( GFMError ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!define( AlertType )(error) -!_buildGFMAlerts(!1) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -!define( GFMSuccess ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!define( AlertType )(success) -!_buildGFMAlerts(!1) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -!define( GFMAlertPlain ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!define( AlertType )(plain) -!_buildGFMAlerts(!1) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - - -!comment{ !GFMAlertsInlineCSS v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Provide GitHub-like CSS styling for Alerts by importing the file - "GFM-Alerts.css" as an inline stylesheet. - -USAGE: Include (once) in your markdown document: - - !GFMAlertsInlineCSS - -REQUIREMENTS: - -- Env var PP_MACROS_PATH must be set to the path of this folder in order for - !kbdInlineCSS to be able to include "GFM-Alerts.css". -```````````````````````````````````````````````````````````````````````````````` -!define(GFMAlertsInlineCSS) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - +!comment( "GitHub Alerts" pp-macros set ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"GFM-Alerts.pp" v2.0 (2017-10-25) | PP v2.0 + +A set of macros for mimicking GitHub's Alerts (aka flash messages) within pandoc +documents: + +-- http://primercss.io/alerts/ +------------------------------------------------------------------------------ +MACROS LIST: + +-- !GFMAlert +-- !GFMAlertWarn +-- !GFMAlertError +-- !GFMAlertSuccess +-- !GFMAlertPlain +-- !GFMAlertsInlineCSS + +INTERNAL-USE MACROS: + +-- !_buildGFMAlerts +-------------------------------------------------------------------------------- + OUT FORMAT: html + OS SUPPORT: all +REQUIREMENTS: + -- "GFM-Alerts.css" must be included in final document's stylesheet. + (Adapted from GitHub's Prime-CSS "flash.scss" module:) + https://github.com/primer/primer-alerts/blob/master/lib/flash.scss + -- Env var PP_MACROS_PATH must be set to the path of this folder in order for + !GFMAlertsInlineCSS to be able to include "GFM-Alerts.css". +-------------------------------------------------------------------------------- +This file is part of "The Pandoc-Goodies PP-Macros Library": + -- https://github.com/tajmone/pandoc-goodies/tree/master/pp + +(c) Tristano Ajmone 2017, MIT License. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + +!comment{ !_buildGFMAlerts v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +** FOR INTERNAL USE ONLY! ** +```````````````````````````````````````````````````````````````````````````````` +!define( _buildGFMAlerts ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +
      +
      +!1 +
      +
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + +!comment{ !GFMAlert v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Wraps the contents of the macro's parameter in GitHub style Alert +
      s (aka "Flash messages"). + Contents will be processed as markdown. +USAGE: + + !Alert + ~~~~~~~~~~~~~~ + MARKDOWN BLOCK + ~~~~~~~~~~~~~~ + +```````````````````````````````````````````````````````````````````````````````` +!define( GFMAlert ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!undefine(AlertType) +!_buildGFMAlerts(!1) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + +!comment +```````````````````````````````````````````````````````````````````````````````` +The following macros are just variations of the previous one. +Same usage, different output colors. +```````````````````````````````````````````````````````````````````````````````` + + +!define( GFMWarn ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!define( AlertType )(warn) +!_buildGFMAlerts(!1) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +!define( GFMError ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!define( AlertType )(error) +!_buildGFMAlerts(!1) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +!define( GFMSuccess ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!define( AlertType )(success) +!_buildGFMAlerts(!1) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +!define( GFMAlertPlain ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!define( AlertType )(plain) +!_buildGFMAlerts(!1) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + + +!comment{ !GFMAlertsInlineCSS v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Provide GitHub-like CSS styling for Alerts by importing the file + "GFM-Alerts.css" as an inline stylesheet. + +USAGE: Include (once) in your markdown document: + + !GFMAlertsInlineCSS + +REQUIREMENTS: + -- Env var PP_MACROS_PATH must be set to the path of this folder in order for + !kbdInlineCSS to be able to include "GFM-Alerts.css". +```````````````````````````````````````````````````````````````````````````````` +!define(GFMAlertsInlineCSS) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + diff --git a/pp/macros/GFM-TaskList.css b/pp/macros/GFM-TaskList.css index 848811d..23a20dc 100644 --- a/pp/macros/GFM-TaskList.css +++ b/pp/macros/GFM-TaskList.css @@ -1,17 +1,17 @@ -.task-list-item input { - margin: 0 0.2em 0.25em -1.6em; - vertical-align: middle; -} -:checked+.radio-label { - position: relative; - z-index: 1; - border-color: #0366d6; -} - -.task-list-item { - list-style-type: none; -} - -.task-list-item+.task-list-item { - margin-top: 3px; +.task-list-item input { + margin: 0 0.2em 0.25em -1.6em; + vertical-align: middle; +} +:checked+.radio-label { + position: relative; + z-index: 1; + border-color: #0366d6; +} + +.task-list-item { + list-style-type: none; +} + +.task-list-item+.task-list-item { + margin-top: 3px; } \ No newline at end of file diff --git a/pp/macros/GFM-TaskList.pp b/pp/macros/GFM-TaskList.pp index 9da1e34..0d0870d 100644 --- a/pp/macros/GFM-TaskList.pp +++ b/pp/macros/GFM-TaskList.pp @@ -1,139 +1,139 @@ -!comment( "GFM-TaskList" pp-macros set ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"GFM-TaskList.pp" v2.0 (2017-10-25) | PP v2.0 - -A set of macros for enabling GFM task lists within pandoc documents: - --- https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists - ------------------------------------------------------------------------------- -MACROS LIST: - --- !TaskList --- !Task --- !TaskListInlineCSS --------------------------------------------------------------------------------- - OUT FORMAT: html - OS SUPPORT: all -REQUIREMENTS: CSS defs of "task-list" and "task-list-item" classes (recommended): - - Copy/include "GFM-TaskList.css" manually, or - - Use "!TaskListInlineCSS" macro to inject CSS - These classes only hide the items' original bullets, therefore - task lists will work even without them: checkboxes will be shown - next to the bullet, and look a bit hugly. --------------------------------------------------------------------------------- -This file is part of "The Pandoc-Goodies PP-Macros Library": - -- https://github.com/tajmone/pandoc-goodies/tree/master/pp - -(c) Tristano Ajmone 2017, MIT License. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -!comment( Usage Examples ) -```````````````````````````````````````````````````````````````````````````````` -The usage of the TaskList macros is best illustrated by examples. - -SIMPLE TASK LIST EXAMPLE: - - !TaskList - ~~~~~~~~~~~~~~~~ - !Task[ ][Task 1] - !Task[x][Task 2] - !Task[ ][ ... ] - !Task[ ][Task n] - ~~~~~~~~~~~~~~~~ - -NESTED TASK LIST EXAMPLE: - -Using brackets and indentation to wrap sublists. - - !TaskList - ~~~~~~~~~~~~~~~~~~~~~~~ - !Task[ ][Task 1][ - !Task[x][SubTask 1] - !Task[ ][SubTask 2][ - !Task[x][Sub-SubTask 1]]] - !Task[x][Task 2] - ~~~~~~~~~~~~~~~~~~~~~~~ - -NESTED TASK LIST ALTERNATIVE SYNTAX EXAMPLE: - - -Using tildas to wrap sublists. - - - !TaskList - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - !Task[ ][Task 1] - ~~~~~~~~~~~~~~~~~~~~~~~~ - !Task[x][SubTask 1] - !Task[ ][SubTask 2] - ~~~~~~~~~~~~~~~~~~~ - !Task[x][Sub-SubTask 1] - ~~~~~~~~~~~~~~~~~~~ - ~~~~~~~~~~~~~~~~~~~~~~~~ - !Task[ ][Task 2] - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -```````````````````````````````````````````````````````````````````````````````` - - - -!comment{ !TaskList v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Macro to enclose all Tasks of a Task-List. - -```````````````````````````````````````````````````````````````````````````````` -!define( TaskList ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -
        -!1 -
      - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -!comment{ !Task v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Macro to define single task-list items. - The third parameter (optional) can be used to enclose a sublist - of tasks. - -USAGE: !Task( TASK STATE )( TASK TEXT )[( A SUB-TASKS LIST )] - - -```````````````````````````````````````````````````````````````````````````````` -!define( Task ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
    •  !2!ifndef(3)(
    • ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!TaskList(!3) -
    • -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -!comment{ !TaskListInlineCSS v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Provide GitHub-like CSS styling for GFM Task Lists by importing the - file "GFM-TaskList.css" as an inline stylesheet. - -USAGE: Include (once) in your markdown document: - - !TaskListInlineCSS - -REQUIREMENTS: - -- Env var PP_MACROS_PATH must be set to the path of this folder in order for - !kbdInlineCSS to be able to include "GFM-TaskList.css". -```````````````````````````````````````````````````````````````````````````````` -!define(TaskListInlineCSS) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!comment( "GFM-TaskList" pp-macros set ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"GFM-TaskList.pp" v2.0 (2017-10-25) | PP v2.0 + +A set of macros for enabling GFM task lists within pandoc documents: + +-- https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists + +------------------------------------------------------------------------------ +MACROS LIST: + +-- !TaskList +-- !Task +-- !TaskListInlineCSS +-------------------------------------------------------------------------------- + OUT FORMAT: html + OS SUPPORT: all +REQUIREMENTS: CSS defs of "task-list" and "task-list-item" classes (recommended): + - Copy/include "GFM-TaskList.css" manually, or + - Use "!TaskListInlineCSS" macro to inject CSS + These classes only hide the items' original bullets, therefore + task lists will work even without them: checkboxes will be shown + next to the bullet, and look a bit hugly. +-------------------------------------------------------------------------------- +This file is part of "The Pandoc-Goodies PP-Macros Library": + -- https://github.com/tajmone/pandoc-goodies/tree/master/pp + +(c) Tristano Ajmone 2017, MIT License. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +!comment( Usage Examples ) +```````````````````````````````````````````````````````````````````````````````` +The usage of the TaskList macros is best illustrated by examples. + +SIMPLE TASK LIST EXAMPLE: + + !TaskList + ~~~~~~~~~~~~~~~~ + !Task[ ][Task 1] + !Task[x][Task 2] + !Task[ ][ ... ] + !Task[ ][Task n] + ~~~~~~~~~~~~~~~~ + +NESTED TASK LIST EXAMPLE: + +Using brackets and indentation to wrap sublists. + + !TaskList + ~~~~~~~~~~~~~~~~~~~~~~~ + !Task[ ][Task 1][ + !Task[x][SubTask 1] + !Task[ ][SubTask 2][ + !Task[x][Sub-SubTask 1]]] + !Task[x][Task 2] + ~~~~~~~~~~~~~~~~~~~~~~~ + +NESTED TASK LIST ALTERNATIVE SYNTAX EXAMPLE: + + +Using tildas to wrap sublists. + + + !TaskList + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + !Task[ ][Task 1] + ~~~~~~~~~~~~~~~~~~~~~~~~ + !Task[x][SubTask 1] + !Task[ ][SubTask 2] + ~~~~~~~~~~~~~~~~~~~ + !Task[x][Sub-SubTask 1] + ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~ + !Task[ ][Task 2] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +```````````````````````````````````````````````````````````````````````````````` + + + +!comment{ !TaskList v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Macro to enclose all Tasks of a Task-List. + +```````````````````````````````````````````````````````````````````````````````` +!define( TaskList ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +
        +!1 +
      + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +!comment{ !Task v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Macro to define single task-list items. + The third parameter (optional) can be used to enclose a sublist + of tasks. + +USAGE: !Task( TASK STATE )( TASK TEXT )[( A SUB-TASKS LIST )] + + +```````````````````````````````````````````````````````````````````````````````` +!define( Task ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +
    •  !2!ifndef(3)(
    • ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!TaskList(!3) + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +!comment{ !TaskListInlineCSS v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Provide GitHub-like CSS styling for GFM Task Lists by importing the + file "GFM-TaskList.css" as an inline stylesheet. + +USAGE: Include (once) in your markdown document: + + !TaskListInlineCSS + +REQUIREMENTS: + -- Env var PP_MACROS_PATH must be set to the path of this folder in order for + !kbdInlineCSS to be able to include "GFM-TaskList.css". +```````````````````````````````````````````````````````````````````````````````` +!define(TaskListInlineCSS) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/pp/macros/Highlight.pp b/pp/macros/Highlight.pp index 33afd12..c1a6032 100644 --- a/pp/macros/Highlight.pp +++ b/pp/macros/Highlight.pp @@ -1,225 +1,225 @@ -!comment( "Highlight" pp-macros set ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"Highlight.pp" v2.1.1 (2017-10-26) | PP v2.0 - -A set of macros for integrating André Simon's Highlight syntax highlighter with -pandoc documents: - --- http://www.andre-simon.de/ - ------------------------------------------------------------------------------- -MACROS LIST: - --- !HighlightFile --- !Highlight --- !HighlightInlineTheme - -INTERNAL-USE MACROS: - --- !_HLCounter --- !HighlightSh --- !HighlightCMD --------------------------------------------------------------------------------- - OUT FORMAT: html - OS SUPPORT: Win + Linux + macOS -REQUIREMENTS: Highlight cli tool must be available on system %PATH%. --------------------------------------------------------------------------------- -This file is part of "The Pandoc-Goodies PP-Macros Library": - -- https://github.com/tajmone/pandoc-goodies/tree/master/pp - -(c) Tristano Ajmone 2017, MIT License. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - -!comment{ !HighlightFile v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Syntax highlight the source code file passed in 1st parameter using - Highlight external tool. The code language must be defined in the 2nd param, - it will be passed as Highlight's syntax parameter option, and will also be - added as a class to the &
       tags to allow finer styling control
      -    with custom CSS.
      -    Optionally:
      -    -- 3rd parameter can contain extra Highlight invocation options.
      -
      -USAGE:
      -
      -        !HighlightFile(FILE)(LANG)[(OPTIONS)]
      -
      -OUTPUT:
      -
      -        
      
      -        ... HIGHLIGHTED CODE ...
      -        
      - -```````````````````````````````````````````````````````````````````````````````` -!define( HighlightFile ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
      !exec
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -highlight -f -S !2 --no-trailing-nl --validate-input !3 -i !1
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - - -!comment{ !HighlightInlineTheme v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Retrives a Highlight Theme and injects its CSS into the document. - A quick solution for theming Highlight code withouth having to import - an external CSS file via pandoc. - -NOTE: The Theme name must be passed without the ".theme" extension! - -USAGE: - - !HighlightInlineTheme(THEME NAME) - -```````````````````````````````````````````````````````````````````````````````` -!define( HighlightInlineTheme ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -!comment{ !_HLCounter } -```````````````````````````````````````````````````````````````````````````````` -** FOR INTERNAL USE ONLY! ** -Defines a temporary files counter at module load-time, and sets it to zero. -```````````````````````````````````````````````````````````````````````````````` -!define( _HLCounter )(0) - - - -!comment{ !Highlight v2.1 | 2017-10-25 } -`````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Syntax highlight the source code within the 3rd parameter using - Highlight external tool. The code language must be defined in 1st param. - Optionally: - -- 2nd parameter can contain extra Highlight invocation options. -USAGE: - - !Highlight(LANG)([EXTRA HIGHLIGHT OPTIONS]) - ~~~~~~~~~~~~~~~~ - BLOCK OF SOURCECODE - ~~~~~~~~~~~~~~~~ - -NOTES: This macro will first try to establish under which context PP is being - invoked (ie: Win CMD or Shell/Bash), then calls the appropriate variant - of the !Highlight macro: - -- If OS is Windows: - -- if context is Git Bash: invoke !HighlightSh - -- otherwise (context is CMD): invoke !HighlightCMD - -- If OS is other than Windows: invoke !HighlightSh - -Under Windows, establishing if the context is Git Bash or Win CMD is done by -checking if the "SHELL" env var exists (ie: it's not empty). -Inside Git Bash for Windows, the "SHELL" env var is available systemwide, its -value being a string pointing to the location of the Bash executable. Eg: - - "C:\Program Files\Git\usr\bin\bash.exe" - -If the "!env(SHELL)" macro emits an empty string, we assume that PP is being -invoked from CMD -- it could also be in PowerShell, but we have no means to -check that. -`````````````````````````````````````````````````````````````````````````````` -!define( Highlight ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!ifeq[!os][windows] -[ !comment{ ======== OS Is Windows: ======== } - - !ifne(!env{SHELL})() - ( - !comment{ ------ Bash/Shell for Windows found: ------ } - !HighlightSh{!1}{!2}{!3} - ) - ( - !comment{ ------ We're in Windows CMD: -------------- } - !HighlightCMD{!1}{!2}{!3} - ) -] -[ !comment{ ======== OS Not Windows: ======== } - - !HighlightSh{!1}{!2}{!3} -] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - -!comment{ !HighlightCMD v2.1 | 2017-10-25 } -`````````````````````````````````````````````````````````````````````````````` -DECRIPTION: The Win CMD version of !Highlight macro, automatically invoked by - !Highlight after establishing that the current context is Win CMD. - Used for Windows CMD (not Git Bash for Windows). -USAGE: - - !HighlightCMD(LANG)([EXTRA HIGHLIGHT OPTIONS]) - ~~~~~~~~~~~~~~~~ - BLOCK OF SOURCECODE - ~~~~~~~~~~~~~~~~ - -NOTES: This macro creates a temporary file (named “`_pp-tempfileX.tmp`”, where - `X` is a numeric counter) in the macros folder (`/pp/macros/`) for each - macro call in the document, to temporarily store the code to highlight. - At each PP invocation the `X` counter is reset, and the previous temp - files are written over. These temporary files are set to be ignored by - Git, so you shouldn't worry about them. -`````````````````````````````````````````````````````````````````````````````` -!define(HighlightCMD) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!add(_HLCounter) -!def(TEMPFILE)(!env(PP_MACROS_PATH)_pp-tempfile!_HLCounter.tmp) -!quiet[!lit(!TEMPFILE)()(!3)] -!quiet[!flushlit] - -
      !exec
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -highlight -f -S !1 --no-trailing-nl --validate-input !2 -i !TEMPFILE
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - -!comment{ !HighlightSh v2.1 | 2017-10-25 } -`````````````````````````````````````````````````````````````````````````````` -DECRIPTION: The Shell version of !Highlight macro, automatically invoked by - !Highlight after establishing the current context is Shell/Bash. - Used for Linux, Mac and Git Bash for Windows. -USAGE: - - !HighlightSh(LANG)([EXTRA HIGHLIGHT OPTIONS]) - ~~~~~~~~~~~~~~~~ - BLOCK OF SOURCECODE - ~~~~~~~~~~~~~~~~ - -NOTES: To disable Shell expansion of the sourcecode block (and errors when - it contains backtick characters), the "EOF" delimiter string in the - redirection operator is placed within single quotes: - - cat <<'EOF' | - - (see "Here Documents" for more info) -`````````````````````````````````````````````````````````````````````````````` -!define( HighlightSh ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -
      !sh
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -cat <<'EOF' | highlight -f -S !1 --no-trailing-nl --validate-input !2
      -!3
      -EOF
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!comment( "Highlight" pp-macros set ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"Highlight.pp" v2.1.1 (2017-10-26) | PP v2.0 + +A set of macros for integrating André Simon's Highlight syntax highlighter with +pandoc documents: + +-- http://www.andre-simon.de/ + +------------------------------------------------------------------------------ +MACROS LIST: + +-- !HighlightFile +-- !Highlight +-- !HighlightInlineTheme + +INTERNAL-USE MACROS: + +-- !_HLCounter +-- !HighlightSh +-- !HighlightCMD +-------------------------------------------------------------------------------- + OUT FORMAT: html + OS SUPPORT: Win + Linux + macOS +REQUIREMENTS: Highlight cli tool must be available on system %PATH%. +-------------------------------------------------------------------------------- +This file is part of "The Pandoc-Goodies PP-Macros Library": + -- https://github.com/tajmone/pandoc-goodies/tree/master/pp + +(c) Tristano Ajmone 2017, MIT License. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + +!comment{ !HighlightFile v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Syntax highlight the source code file passed in 1st parameter using + Highlight external tool. The code language must be defined in the 2nd param, + it will be passed as Highlight's syntax parameter option, and will also be + added as a class to the &
       tags to allow finer styling control
      +    with custom CSS.
      +    Optionally:
      +    -- 3rd parameter can contain extra Highlight invocation options.
      +
      +USAGE:
      +
      +        !HighlightFile(FILE)(LANG)[(OPTIONS)]
      +
      +OUTPUT:
      +
      +        
      
      +        ... HIGHLIGHTED CODE ...
      +        
      + +```````````````````````````````````````````````````````````````````````````````` +!define( HighlightFile ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +
      !exec
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +highlight -f -S !2 --no-trailing-nl --validate-input !3 -i !1
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + + +!comment{ !HighlightInlineTheme v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Retrives a Highlight Theme and injects its CSS into the document. + A quick solution for theming Highlight code withouth having to import + an external CSS file via pandoc. + +NOTE: The Theme name must be passed without the ".theme" extension! + +USAGE: + + !HighlightInlineTheme(THEME NAME) + +```````````````````````````````````````````````````````````````````````````````` +!define( HighlightInlineTheme ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +!comment{ !_HLCounter } +```````````````````````````````````````````````````````````````````````````````` +** FOR INTERNAL USE ONLY! ** +Defines a temporary files counter at module load-time, and sets it to zero. +```````````````````````````````````````````````````````````````````````````````` +!define( _HLCounter )(0) + + + +!comment{ !Highlight v2.1 | 2017-10-25 } +`````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Syntax highlight the source code within the 3rd parameter using + Highlight external tool. The code language must be defined in 1st param. + Optionally: + -- 2nd parameter can contain extra Highlight invocation options. +USAGE: + + !Highlight(LANG)([EXTRA HIGHLIGHT OPTIONS]) + ~~~~~~~~~~~~~~~~ + BLOCK OF SOURCECODE + ~~~~~~~~~~~~~~~~ + +NOTES: This macro will first try to establish under which context PP is being + invoked (ie: Win CMD or Shell/Bash), then calls the appropriate variant + of the !Highlight macro: + -- If OS is Windows: + -- if context is Git Bash: invoke !HighlightSh + -- otherwise (context is CMD): invoke !HighlightCMD + -- If OS is other than Windows: invoke !HighlightSh + +Under Windows, establishing if the context is Git Bash or Win CMD is done by +checking if the "SHELL" env var exists (ie: it's not empty). +Inside Git Bash for Windows, the "SHELL" env var is available systemwide, its +value being a string pointing to the location of the Bash executable. Eg: + + "C:\Program Files\Git\usr\bin\bash.exe" + +If the "!env(SHELL)" macro emits an empty string, we assume that PP is being +invoked from CMD -- it could also be in PowerShell, but we have no means to +check that. +`````````````````````````````````````````````````````````````````````````````` +!define( Highlight ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!ifeq[!os][windows] +[ !comment{ ======== OS Is Windows: ======== } + + !ifne(!env{SHELL})() + ( + !comment{ ------ Bash/Shell for Windows found: ------ } + !HighlightSh{!1}{!2}{!3} + ) + ( + !comment{ ------ We're in Windows CMD: -------------- } + !HighlightCMD{!1}{!2}{!3} + ) +] +[ !comment{ ======== OS Not Windows: ======== } + + !HighlightSh{!1}{!2}{!3} +] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + +!comment{ !HighlightCMD v2.1 | 2017-10-25 } +`````````````````````````````````````````````````````````````````````````````` +DECRIPTION: The Win CMD version of !Highlight macro, automatically invoked by + !Highlight after establishing that the current context is Win CMD. + Used for Windows CMD (not Git Bash for Windows). +USAGE: + + !HighlightCMD(LANG)([EXTRA HIGHLIGHT OPTIONS]) + ~~~~~~~~~~~~~~~~ + BLOCK OF SOURCECODE + ~~~~~~~~~~~~~~~~ + +NOTES: This macro creates a temporary file (named “`_pp-tempfileX.tmp`”, where + `X` is a numeric counter) in the macros folder (`/pp/macros/`) for each + macro call in the document, to temporarily store the code to highlight. + At each PP invocation the `X` counter is reset, and the previous temp + files are written over. These temporary files are set to be ignored by + Git, so you shouldn't worry about them. +`````````````````````````````````````````````````````````````````````````````` +!define(HighlightCMD) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!add(_HLCounter) +!def(TEMPFILE)(!env(PP_MACROS_PATH)_pp-tempfile!_HLCounter.tmp) +!quiet[!lit(!TEMPFILE)()(!3)] +!quiet[!flushlit] + +
      !exec
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +highlight -f -S !1 --no-trailing-nl --validate-input !2 -i !TEMPFILE
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + +!comment{ !HighlightSh v2.1 | 2017-10-25 } +`````````````````````````````````````````````````````````````````````````````` +DECRIPTION: The Shell version of !Highlight macro, automatically invoked by + !Highlight after establishing the current context is Shell/Bash. + Used for Linux, Mac and Git Bash for Windows. +USAGE: + + !HighlightSh(LANG)([EXTRA HIGHLIGHT OPTIONS]) + ~~~~~~~~~~~~~~~~ + BLOCK OF SOURCECODE + ~~~~~~~~~~~~~~~~ + +NOTES: To disable Shell expansion of the sourcecode block (and errors when + it contains backtick characters), the "EOF" delimiter string in the + redirection operator is placed within single quotes: + + cat <<'EOF' | + + (see "Here Documents" for more info) +`````````````````````````````````````````````````````````````````````````````` +!define( HighlightSh ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +
      !sh
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +cat <<'EOF' | highlight -f -S !1 --no-trailing-nl --validate-input !2
      +!3
      +EOF
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/pp/macros/INIT-ENV.bat b/pp/macros/INIT-ENV.bat index ea2d65e..f2f5fe1 100644 --- a/pp/macros/INIT-ENV.bat +++ b/pp/macros/INIT-ENV.bat @@ -1,2 +1,2 @@ -SET "PP_MACROS_PATH=%~dp0" +SET "PP_MACROS_PATH=%~dp0" EXIT /B \ No newline at end of file diff --git a/pp/macros/InlineFormatting.pp b/pp/macros/InlineFormatting.pp index 2a69e3a..21261a2 100644 --- a/pp/macros/InlineFormatting.pp +++ b/pp/macros/InlineFormatting.pp @@ -1,58 +1,58 @@ -!comment( "Inline Formatting" pp-macros set ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"InlineFormatting.pp" v2.0 (2017-10-25) | PP v2.0 - -A set of shortcut-macros for various standard html inline elements. --------------------------------------------------------------------------------- -MACROS LIST: - -- !kbd -- !kbdInlineCSS - --------------------------------------------------------------------------------- - OUT FORMAT: html - OS SUPPORT: all --------------------------------------------------------------------------------- -This file is part of "The Pandoc-Goodies PP-Macros Library": - -- https://github.com/tajmone/pandoc-goodies/tree/master/pp - -(c) Tristano Ajmone 2017, MIT License. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - -!comment{ !kbd v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Wraps the passed keys in tags, separating each key from its - predecessor with a "+" char. Accepts up to 4 keys. -USAGE: - - !kbd(KEY1)[(KEY2)(KEY3)(KEY4)] - -```````````````````````````````````````````````````````````````````````````````` -!define( kbd )( -!1!ifdef(2)(+!2)!ifdef(3)(+!3)!ifdef(4)(+!4) -)!comment `````````````````````````````````` `````````````````````````````````` - - - -!comment{ !kbdInlineCSS v2.0 | 2017-10-25 } -```````````````````````````````````````````````````````````````````````````````` -DECRIPTION: Provide GitHub-like CSS styling for tags by importing the file - "kbd_GitHub.css" as an inline stylesheet. - -USAGE: Include (once) in your markdown document: - - !kbdInlineCSS - -REQUIREMENTS: - -- Env var PP_MACROS_PATH must be set to the path of this folder in order for - !kbdInlineCSS to be able to include "kbd_GitHub.css". -```````````````````````````````````````````````````````````````````````````````` -!define( kbdInlineCSS ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!comment( "Inline Formatting" pp-macros set ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"InlineFormatting.pp" v2.0 (2017-10-25) | PP v2.0 + +A set of shortcut-macros for various standard html inline elements. +-------------------------------------------------------------------------------- +MACROS LIST: + +- !kbd +- !kbdInlineCSS + +-------------------------------------------------------------------------------- + OUT FORMAT: html + OS SUPPORT: all +-------------------------------------------------------------------------------- +This file is part of "The Pandoc-Goodies PP-Macros Library": + -- https://github.com/tajmone/pandoc-goodies/tree/master/pp + +(c) Tristano Ajmone 2017, MIT License. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + +!comment{ !kbd v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Wraps the passed keys in tags, separating each key from its + predecessor with a "+" char. Accepts up to 4 keys. +USAGE: + + !kbd(KEY1)[(KEY2)(KEY3)(KEY4)] + +```````````````````````````````````````````````````````````````````````````````` +!define( kbd )( +!1!ifdef(2)(+!2)!ifdef(3)(+!3)!ifdef(4)(+!4) +)!comment `````````````````````````````````` `````````````````````````````````` + + + +!comment{ !kbdInlineCSS v2.0 | 2017-10-25 } +```````````````````````````````````````````````````````````````````````````````` +DECRIPTION: Provide GitHub-like CSS styling for tags by importing the file + "kbd_GitHub.css" as an inline stylesheet. + +USAGE: Include (once) in your markdown document: + + !kbdInlineCSS + +REQUIREMENTS: + -- Env var PP_MACROS_PATH must be set to the path of this folder in order for + !kbdInlineCSS to be able to include "kbd_GitHub.css". +```````````````````````````````````````````````````````````````````````````````` +!define( kbdInlineCSS ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/pp/macros/kbd_GitHub.css b/pp/macros/kbd_GitHub.css index ece8342..4dc7146 100644 --- a/pp/macros/kbd_GitHub.css +++ b/pp/macros/kbd_GitHub.css @@ -1,18 +1,18 @@ -/* ============================================================================== - Adapted from "GitHub Markdown CSS" (c) Sindre Sorhus, MIT License (MIT): - -- https://github.com/sindresorhus/github-markdown-css - ============================================================================== */ -kbd { - display: inline-block; - padding: 3px 5px; - font-family: monospace, monospace; - font-size: 11px; - line-height: 10px; - color: #444d56; - vertical-align: middle; - background-color: #fafbfc; - border: solid 1px #c6cbd1; - border-bottom-color: #959da5; - border-radius: 3px; - box-shadow: inset 0 -1px 0 #959da5; +/* ============================================================================== + Adapted from "GitHub Markdown CSS" (c) Sindre Sorhus, MIT License (MIT): + -- https://github.com/sindresorhus/github-markdown-css + ============================================================================== */ +kbd { + display: inline-block; + padding: 3px 5px; + font-family: monospace, monospace; + font-size: 11px; + line-height: 10px; + color: #444d56; + vertical-align: middle; + background-color: #fafbfc; + border: solid 1px #c6cbd1; + border-bottom-color: #959da5; + border-radius: 3px; + box-shadow: inset 0 -1px 0 #959da5; } \ No newline at end of file diff --git a/pp/macros/macros.pp b/pp/macros/macros.pp index e14ee53..32db11d 100644 --- a/pp/macros/macros.pp +++ b/pp/macros/macros.pp @@ -1,17 +1,17 @@ -!comment( pp-macros loader module ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"macros.pp v2.0 (2017-10-25) | PP v2.0 - -The main macro that imports all other macro definition files. - --------------------------------------------------------------------------------- -This file is part of "The Pandoc-Goodies PP-Macros Library": - -- https://github.com/tajmone/pandoc-goodies/tree/master/pp - -(c) Tristano Ajmone 2017, MIT License. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -!import(GFM-Alerts.pp) -!import(GFM-TaskList.pp) -!import(Highlight.pp) -!import(InlineFormatting.pp) +!comment( pp-macros loader module ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"macros.pp v2.0 (2017-10-25) | PP v2.0 + +The main macro that imports all other macro definition files. + +-------------------------------------------------------------------------------- +This file is part of "The Pandoc-Goodies PP-Macros Library": + -- https://github.com/tajmone/pandoc-goodies/tree/master/pp + +(c) Tristano Ajmone 2017, MIT License. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +!import(GFM-Alerts.pp) +!import(GFM-TaskList.pp) +!import(Highlight.pp) +!import(InlineFormatting.pp) diff --git a/pp/test/GFM-Alerts.html b/pp/test/GFM-Alerts.html index 43c34c5..7ad5430 100644 --- a/pp/test/GFM-Alerts.html +++ b/pp/test/GFM-Alerts.html @@ -1,256 +1,256 @@ - - - - - - - - - - - - - -

      GFM-Alerts PP-Macros Test

      -

      This is a run test of the GFM-Alerts pp-macros set.

      -

      Files List

      - -

      Macros list

      -
        -
      • !GFMAlertsInlineCSS — Inject required CSS
      • -
      • !GFMAlert( CONTENTS ) — Default alert (blue)
      • -
      • !GFMError( CONTENTS ) — Error alert (red)
      • -
      • !GFMWarn( CONTENTS ) — Warning alert (yellow)
      • -
      • !GFMSuccess( CONTENTS ) — Success alert (green)
      • -
      • !GFMAlertPlain( CONTENTS ) — Plain alert (grey)
      • -
      -

      Add Alerts CSS

      -

      We need the CSS definition for viewing alerts. We’ll use the !GFMAlertsInlineCSS macro to inject the contents of GFM-Alerts.css as an inline stylesheet:

      -
      !GFMAlertsInlineCSS
      -

      this macro emits the following raw html:

      -
      <style type="text/css">
      -/*  ==============================================================================
      -                                 Primer CSS by GitHub                             
      -    ==============================================================================
      -    This file was adapted from the Primer CSS project:
      -
      -    -- https://github.com/primer/primer-alerts/blob/master/lib/flash.scss
      -
      -    Copyright (c) 2016 GitHub Inc. Released under The MIT License (MIT).
      -    ============================================================================== */
      -
      -.flash {
      -    position: relative;
      -    padding: 16px;
      -    color: #246;
      -    background-color: #e2eef9;
      -    border: 1px solid #bac6d3;
      -    border-radius: 3px;
      -}
      -.flash p:last-child {
      -    margin-bottom: 0;
      -}
      -.flash-messages {
      -    margin-bottom: 24px;
      -}
      -.flash-warn {
      -    color: #4c4a42;
      -    background-color: #fff9ea;
      -    border-color: #dfd8c2;
      -}
      -.flash-error {
      -    color: #911;
      -    background-color: #fcdede;
      -    border-color: #d2b2b2;
      -}
      -.flash-success {
      -    color: #22662c;
      -    background-color: #e2f9e5;
      -    border-color: #bad3be;
      -}
      -/* Custom additions not present in "flash.scss" ... */
      -.flash-plain {
      -    color: #4c4a42;
      -    background-color: #f5f5f5;
      -    border-color: #c1c1c1;
      -}
      -.flash p {
      -    margin-top: 0;
      -}
      -</style>
      - -

      Default Alert

      -

      macro used:

      -
      !GFMAlert(__Default__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      -

      raw html output:

      -
      <div class="flash-messages">
      -<div class="flash ">
      -__Default__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      -</div>
      -</div>
      -

      result preview:

      -
      -
      -

      Default — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      -
      -
      -

      Warning Alert

      -

      macro used:

      -
      !GFMWarn(__Warning__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      -

      raw html output:

      -
      <div class="flash-messages">
      -<div class="flash flash-warn">
      -__Warning__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      -</div>
      -</div>
      -

      result preview:

      -
      -
      -

      Warning — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      -
      -
      -

      Error Alert

      -

      macro used:

      -
      !GFMError(__Error__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      -

      raw html output:

      -
      <div class="flash-messages">
      -<div class="flash flash-error">
      -__Error__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      -</div>
      -</div>
      -

      result preview:

      -
      -
      -

      Error — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      -
      -
      -

      Success Alert

      -

      macro used:

      -
      !GFMSuccess(__Success__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      -

      raw html output:

      -
      <div class="flash-messages">
      -<div class="flash flash-success">
      -__Success__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      -</div>
      -</div>
      -

      result preview:

      -
      -
      -

      Success — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      -
      -
      -

      Plain Alert

      -

      NOTE: This Alert is not part of GitHub’s original set of Alerts; I’ve added it.

      -

      macro used:

      -
      !GFMAlertPlain(__Plain__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      -

      raw html output:

      -
      <div class="flash-messages">
      -<div class="flash flash-plain">
      -__Plain__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      -</div>
      -</div>
      -

      result preview:

      -
      -
      -

      Plain — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      -
      -
      - - + + + + + + + + + + + + + +

      GFM-Alerts PP-Macros Test

      +

      This is a run test of the GFM-Alerts pp-macros set.

      +

      Files List

      + +

      Macros list

      +
        +
      • !GFMAlertsInlineCSS — Inject required CSS
      • +
      • !GFMAlert( CONTENTS ) — Default alert (blue)
      • +
      • !GFMError( CONTENTS ) — Error alert (red)
      • +
      • !GFMWarn( CONTENTS ) — Warning alert (yellow)
      • +
      • !GFMSuccess( CONTENTS ) — Success alert (green)
      • +
      • !GFMAlertPlain( CONTENTS ) — Plain alert (grey)
      • +
      +

      Add Alerts CSS

      +

      We need the CSS definition for viewing alerts. We’ll use the !GFMAlertsInlineCSS macro to inject the contents of GFM-Alerts.css as an inline stylesheet:

      +
      !GFMAlertsInlineCSS
      +

      this macro emits the following raw html:

      +
      <style type="text/css">
      +/*  ==============================================================================
      +                                 Primer CSS by GitHub                             
      +    ==============================================================================
      +    This file was adapted from the Primer CSS project:
      +
      +    -- https://github.com/primer/primer-alerts/blob/master/lib/flash.scss
      +
      +    Copyright (c) 2016 GitHub Inc. Released under The MIT License (MIT).
      +    ============================================================================== */
      +
      +.flash {
      +    position: relative;
      +    padding: 16px;
      +    color: #246;
      +    background-color: #e2eef9;
      +    border: 1px solid #bac6d3;
      +    border-radius: 3px;
      +}
      +.flash p:last-child {
      +    margin-bottom: 0;
      +}
      +.flash-messages {
      +    margin-bottom: 24px;
      +}
      +.flash-warn {
      +    color: #4c4a42;
      +    background-color: #fff9ea;
      +    border-color: #dfd8c2;
      +}
      +.flash-error {
      +    color: #911;
      +    background-color: #fcdede;
      +    border-color: #d2b2b2;
      +}
      +.flash-success {
      +    color: #22662c;
      +    background-color: #e2f9e5;
      +    border-color: #bad3be;
      +}
      +/* Custom additions not present in "flash.scss" ... */
      +.flash-plain {
      +    color: #4c4a42;
      +    background-color: #f5f5f5;
      +    border-color: #c1c1c1;
      +}
      +.flash p {
      +    margin-top: 0;
      +}
      +</style>
      + +

      Default Alert

      +

      macro used:

      +
      !GFMAlert(__Default__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      +

      raw html output:

      +
      <div class="flash-messages">
      +<div class="flash ">
      +__Default__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      +</div>
      +</div>
      +

      result preview:

      +
      +
      +

      Default — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      +
      +
      +

      Warning Alert

      +

      macro used:

      +
      !GFMWarn(__Warning__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      +

      raw html output:

      +
      <div class="flash-messages">
      +<div class="flash flash-warn">
      +__Warning__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      +</div>
      +</div>
      +

      result preview:

      +
      +
      +

      Warning — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      +
      +
      +

      Error Alert

      +

      macro used:

      +
      !GFMError(__Error__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      +

      raw html output:

      +
      <div class="flash-messages">
      +<div class="flash flash-error">
      +__Error__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      +</div>
      +</div>
      +

      result preview:

      +
      +
      +

      Error — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      +
      +
      +

      Success Alert

      +

      macro used:

      +
      !GFMSuccess(__Success__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      +

      raw html output:

      +
      <div class="flash-messages">
      +<div class="flash flash-success">
      +__Success__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      +</div>
      +</div>
      +

      result preview:

      +
      +
      +

      Success — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      +
      +
      +

      Plain Alert

      +

      NOTE: This Alert is not part of GitHub’s original set of Alerts; I’ve added it.

      +

      macro used:

      +
      !GFMAlertPlain(__Plain__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.)
      +

      raw html output:

      +
      <div class="flash-messages">
      +<div class="flash flash-plain">
      +__Plain__ — Lorem ipsum dolor sit amet, pri cu libris dicunt.
      +</div>
      +</div>
      +

      result preview:

      +
      +
      +

      Plain — Lorem ipsum dolor sit amet, pri cu libris dicunt.

      +
      +
      + + diff --git a/pp/test/GFM-TaskList.html b/pp/test/GFM-TaskList.html index 049182c..abe9f32 100644 --- a/pp/test/GFM-TaskList.html +++ b/pp/test/GFM-TaskList.html @@ -1,344 +1,344 @@ - - - - - - - - - - - - - - -

      GFM-TaskList PP-Macros Test

      -

      This is a run test of the GFM-TaskList pp-macros set.

      -

      Files List

      - -

      Macros list

      -
        -
      • !TaskList( LIST ELEMENTS ) — Genreate Task List enclosing-tags.
      • -
      • !Task(x| )( TASK TEXT )[( SUB-TASKLIST )] — Generate a Task element and (optionally) initiate a sub-list.
      • -
      • !TaskListInlineCSS — Inject required CSS.
      • -
      -

      Example

      -

      Inject Required CSS

      -

      We need some CSS definitions for viewing Task Lists correctly. We’ll use the !TaskListInlineCSS macro to inject the contents of GFM-TaskList.css as an inline stylesheet:

      -
      !TaskListInlineCSS
      -

      this macro emits the following raw html:

      -
      <style type="text/css">
      -.task-list-item input {
      -  margin: 0 0.2em 0.25em -1.6em;
      -  vertical-align: middle;
      -}
      -:checked+.radio-label {
      -  position: relative;
      -  z-index: 1;
      -  border-color: #0366d6;
      -}
      -
      -.task-list-item {
      -  list-style-type: none;
      -}
      -
      -.task-list-item+.task-list-item {
      -  margin-top: 3px;
      -}
      -</style>
      - -

      Create Task Lists

      -

      You have different stylistic choices on how to format your Task List macros, especially when dealing with nested lists.

      -

      As a general rule, you should use square brackets for !Task parameters (ie: !Task[x][text]) as this resembles the GFM syntax and is more user friendly.

      -

      Simple Task List

      -

      A simple Task List example:

      -
      !TaskList
      -~~~~~~~~~~~~~~~~~~~~~~~
      -!Task[x][I'm a _checked_ task]
      -!Task[ ][I'm an _unchecked_ task]
      -~~~~~~~~~~~~~~~~~~~~~~~
      -
      -
        -
      • - I’m a checked task -
      • -
      • - I’m an unchecked task -
      • -
      -

      Nesting Task Lists via Indentation

      -

      A nested Task List example using brackets and indentation (2 spaces) to visually track sublists:

      -
      !TaskList
      -~~~~~~~~~~~~~~~~~~~~~~~
      -!Task[ ][Task 1][
      -  !Task[x][SubTask 1]
      -  !Task[ ][SubTask 2][
      -    !Task[x][Sub-SubTask 1]]]
      -!Task[x][Task 2]
      -~~~~~~~~~~~~~~~~~~~~~~~
      -
      -
        -
      • - Task 1 -
          -
        • - SubTask 1 -
        • -
        • - SubTask 2 -
            -
          • - Sub-SubTask 1 -
          • -
          -
        • -
        -
      • -
      • - Task 2 -
      • -
      -

      The indentation-based approach simplifies keeping visual track of levels nesting, but it’s easy to loose count of opening and closing brackets.

      -
      -
      -

      NOTE: Since sublists are passed via bracketed parameters, they’re stripped of leading and trailing whitespace, so indentantion will never break the markdown syntax (ie: four spaces indentation will not be mistaken for an indented code block).

      -
      -
      -

      Nesting Task Lists via Fencing

      -

      A nested Task List example using tildas to wrap sublists:

      -
      !TaskList
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -!Task[ ][Task 1]
      -~~~~~~~~~~~~~~~~~~~~~~~~
      -!Task[x][SubTask 1]
      -!Task[ ][SubTask 2]
      -~~~~~~~~~~~~~~~~~~~
      -!Task[x][Sub-SubTask 1]
      -~~~~~~~~~~~~~~~~~~~
      -~~~~~~~~~~~~~~~~~~~~~~~~
      -!Task[ ][Task 2]
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -
      -
        -
      • - Task 1 -
          -
        • - SubTask 1 -
        • -
        • - SubTask 2 -
            -
          • - Sub-SubTask 1 -
          • -
          -
        • -
        -
      • -
      • - Task 2 -
      • -
      -

      This fenced approach can be more difficult to track visually, but there are less risks of ending up with orphan brackets.

      -

      Nesting Task Lists via Indentation and Fencing

      -

      An example combining use of both indentantion and tildas fencing to wrap sublists:

      -
      !TaskList
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -!Task[ ][Task 1]
      - ~~~~~~~~~~~~~~~~~~~~~~~~
      - !Task[x][SubTask 1]
      - !Task[ ][SubTask 2]
      -  ~~~~~~~~~~~~~~~~~~~
      -  !Task[x][Sub-SubTask 1]
      -  ~~~~~~~~~~~~~~~~~~~
      - ~~~~~~~~~~~~~~~~~~~~~~~~
      -!Task[ ][Task 2]
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -
      -
        -
      • - Task 1 -
          -
        • - SubTask 1 -
        • -
        • - SubTask 2 -
            -
          • - Sub-SubTask 1 -
          • -
          -
        • -
        -
      • -
      • - Task 2 -
      • -
      -
      -
      -

      WARNING: Unlike the indentantion-only approach, this way of styling Task Lists will break formatting if indentation exceeds four spaces:

      -
      !TaskList
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -!Task[ ][Task]
      - ~~~~~~~~~~~~~~~~~~~~~~~~
      - !Task[x][SubTask]
      -  ~~~~~~~~~~~~~~~~~~~
      -  !Task[x][Sub-SubTask]
      -    ~~~~~~~~~~~~~~~~
      -    !Task[x][Sub-Sub-SubTask]
      -    ~~~~~~~~~~~~~~~~
      -     ~~~~~~~~~~~~~
      -     !Task[x][Sub-Sub-Sub-SubTask]
      -     ~~~~~~~~~~~~~
      -  ~~~~~~~~~~~~~~~~~~~
      - ~~~~~~~~~~~~~~~~~~~~~~~~
      -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      -
      -
        -
      • - Task -
          -
        • - SubTask -
            -
          • - Sub-SubTask -
              -
            • - Sub-Sub-SubTask -
            • -
            -
          • -
             ~~~~~~~~~~~~~
            - <li class="task-list-item"><input type="checkbox" disabled=""checked="">&thinsp;Sub-Sub-Sub-SubTask</li>
            -
            -
            - ~~~~~~~~~~~~~
            -
          -
        • -
        -
      • -
      -

      … because whitespace in fenced parameters is preserved, and pandoc will interpret four leading spaces as an indented code block. Therefore use it only for Task Lists with limited nesting levels.

      -
      -
      - - + + + + + + + + + + + + + + +

      GFM-TaskList PP-Macros Test

      +

      This is a run test of the GFM-TaskList pp-macros set.

      +

      Files List

      + +

      Macros list

      +
        +
      • !TaskList( LIST ELEMENTS ) — Genreate Task List enclosing-tags.
      • +
      • !Task(x| )( TASK TEXT )[( SUB-TASKLIST )] — Generate a Task element and (optionally) initiate a sub-list.
      • +
      • !TaskListInlineCSS — Inject required CSS.
      • +
      +

      Example

      +

      Inject Required CSS

      +

      We need some CSS definitions for viewing Task Lists correctly. We’ll use the !TaskListInlineCSS macro to inject the contents of GFM-TaskList.css as an inline stylesheet:

      +
      !TaskListInlineCSS
      +

      this macro emits the following raw html:

      +
      <style type="text/css">
      +.task-list-item input {
      +  margin: 0 0.2em 0.25em -1.6em;
      +  vertical-align: middle;
      +}
      +:checked+.radio-label {
      +  position: relative;
      +  z-index: 1;
      +  border-color: #0366d6;
      +}
      +
      +.task-list-item {
      +  list-style-type: none;
      +}
      +
      +.task-list-item+.task-list-item {
      +  margin-top: 3px;
      +}
      +</style>
      + +

      Create Task Lists

      +

      You have different stylistic choices on how to format your Task List macros, especially when dealing with nested lists.

      +

      As a general rule, you should use square brackets for !Task parameters (ie: !Task[x][text]) as this resembles the GFM syntax and is more user friendly.

      +

      Simple Task List

      +

      A simple Task List example:

      +
      !TaskList
      +~~~~~~~~~~~~~~~~~~~~~~~
      +!Task[x][I'm a _checked_ task]
      +!Task[ ][I'm an _unchecked_ task]
      +~~~~~~~~~~~~~~~~~~~~~~~
      +
      +
        +
      • + I’m a checked task +
      • +
      • + I’m an unchecked task +
      • +
      +

      Nesting Task Lists via Indentation

      +

      A nested Task List example using brackets and indentation (2 spaces) to visually track sublists:

      +
      !TaskList
      +~~~~~~~~~~~~~~~~~~~~~~~
      +!Task[ ][Task 1][
      +  !Task[x][SubTask 1]
      +  !Task[ ][SubTask 2][
      +    !Task[x][Sub-SubTask 1]]]
      +!Task[x][Task 2]
      +~~~~~~~~~~~~~~~~~~~~~~~
      +
      +
        +
      • + Task 1 +
          +
        • + SubTask 1 +
        • +
        • + SubTask 2 +
            +
          • + Sub-SubTask 1 +
          • +
          +
        • +
        +
      • +
      • + Task 2 +
      • +
      +

      The indentation-based approach simplifies keeping visual track of levels nesting, but it’s easy to loose count of opening and closing brackets.

      +
      +
      +

      NOTE: Since sublists are passed via bracketed parameters, they’re stripped of leading and trailing whitespace, so indentantion will never break the markdown syntax (ie: four spaces indentation will not be mistaken for an indented code block).

      +
      +
      +

      Nesting Task Lists via Fencing

      +

      A nested Task List example using tildas to wrap sublists:

      +
      !TaskList
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +!Task[ ][Task 1]
      +~~~~~~~~~~~~~~~~~~~~~~~~
      +!Task[x][SubTask 1]
      +!Task[ ][SubTask 2]
      +~~~~~~~~~~~~~~~~~~~
      +!Task[x][Sub-SubTask 1]
      +~~~~~~~~~~~~~~~~~~~
      +~~~~~~~~~~~~~~~~~~~~~~~~
      +!Task[ ][Task 2]
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +
      +
        +
      • + Task 1 +
          +
        • + SubTask 1 +
        • +
        • + SubTask 2 +
            +
          • + Sub-SubTask 1 +
          • +
          +
        • +
        +
      • +
      • + Task 2 +
      • +
      +

      This fenced approach can be more difficult to track visually, but there are less risks of ending up with orphan brackets.

      +

      Nesting Task Lists via Indentation and Fencing

      +

      An example combining use of both indentantion and tildas fencing to wrap sublists:

      +
      !TaskList
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +!Task[ ][Task 1]
      + ~~~~~~~~~~~~~~~~~~~~~~~~
      + !Task[x][SubTask 1]
      + !Task[ ][SubTask 2]
      +  ~~~~~~~~~~~~~~~~~~~
      +  !Task[x][Sub-SubTask 1]
      +  ~~~~~~~~~~~~~~~~~~~
      + ~~~~~~~~~~~~~~~~~~~~~~~~
      +!Task[ ][Task 2]
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +
      +
        +
      • + Task 1 +
          +
        • + SubTask 1 +
        • +
        • + SubTask 2 +
            +
          • + Sub-SubTask 1 +
          • +
          +
        • +
        +
      • +
      • + Task 2 +
      • +
      +
      +
      +

      WARNING: Unlike the indentantion-only approach, this way of styling Task Lists will break formatting if indentation exceeds four spaces:

      +
      !TaskList
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +!Task[ ][Task]
      + ~~~~~~~~~~~~~~~~~~~~~~~~
      + !Task[x][SubTask]
      +  ~~~~~~~~~~~~~~~~~~~
      +  !Task[x][Sub-SubTask]
      +    ~~~~~~~~~~~~~~~~
      +    !Task[x][Sub-Sub-SubTask]
      +    ~~~~~~~~~~~~~~~~
      +     ~~~~~~~~~~~~~
      +     !Task[x][Sub-Sub-Sub-SubTask]
      +     ~~~~~~~~~~~~~
      +  ~~~~~~~~~~~~~~~~~~~
      + ~~~~~~~~~~~~~~~~~~~~~~~~
      +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      +
      +
        +
      • + Task +
          +
        • + SubTask +
            +
          • + Sub-SubTask +
              +
            • + Sub-Sub-SubTask +
            • +
            +
          • +
             ~~~~~~~~~~~~~
            + <li class="task-list-item"><input type="checkbox" disabled=""checked="">&thinsp;Sub-Sub-Sub-SubTask</li>
            +
            +
            + ~~~~~~~~~~~~~
            +
          +
        • +
        +
      • +
      +

      … because whitespace in fenced parameters is preserved, and pandoc will interpret four leading spaces as an indented code block. Therefore use it only for Task Lists with limited nesting levels.

      +
      +
      + + diff --git a/pp/test/Highlight.html b/pp/test/Highlight.html index 61b643a..e42ce74 100644 --- a/pp/test/Highlight.html +++ b/pp/test/Highlight.html @@ -1,296 +1,296 @@ - - - - - - - - - - - - - - -

      Highlight PP-Macros Test

      -

      This is a run test of the GFM-TaskList pp-macros set.

      -

      Files List

      - -

      Macros list

      -
        -
      • !HighlightFile( FILE )( LANG )[( OPTIONS )] — imports and syntax-highlights and external file.
      • -
      • !Highlight( LANG )([ OPTIONS] )( CODE ) — syntax-highlights the code block defined in CODE.
      • -
      • !HighlightInlineTheme( THEME NAME ) — retrives a Highlight theme and injects its CSS into the documents.
      • -
      -

      Add Highlight Color Theme

      -

      For these examples we’ll import Highlight’s edit-purebasic theme into the document via the !HighlightInlineTheme macro:

      -
      !HighlightInlineTheme(edit-purebasic)
      -

      this macro emits the following raw html:

      -
      <style type="text/css">
      -/* Style definition file generated by highlight 3.39, http://www.andre-simon.de/ */
      -/* highlight theme: PureBASIC */
      -body.hl { background-color:#ffffdf; }
      -pre.hl  { color:#000000; background-color:#ffffdf; font-size:10pt; font-family:'Courier New',monospace;}
      -.hl.num { color:#000000; }
      -.hl.esc { color:#0080ff; }
      -.hl.str { color:#0080ff; }
      -.hl.pps { color:#0080ff; }
      -.hl.slc { color:#00aaaa; }
      -.hl.com { color:#00aaaa; }
      -.hl.ppc { color:#924b72; }
      -.hl.opt { color:#000000; }
      -.hl.ipl { color:#0080ff; }
      -.hl.lin { color:#808080; }
      -.hl.kwa { color:#006666; font-weight:bold; }
      -.hl.kwb { color:#924b72; }
      -.hl.kwc { color:#006666; }
      -.hl.kwd { color:#0080ff; }
      -
      -
      -</style>
      - -

      Now the CSS definition for PureBASIC code blocks (via Highlight) is available document-wide and you’ll see it aplied to the examples in this document.

      -

      Highlighting an External File

      -

      The !HighlightFile macro takes an external source code file, passes it to Highlight tool for syntax coloring, and injects into the document the raw HTML results as a <pre><code> block.

      -

      The syntax is:

      -
      !HighlightFile( FILE )( LANG )[( OPTIONS )]
      -

      … taking the following parameters:

      -
        -
      • FILE (mandatory) — The source file to syntax-color.
      • -
      • LANG (mandatory) — The language of the source (eg: HTML, Python, etc.).
      • -
      • OPTIONS (facultative) — Further options to pass to Highlight during invocation.
      • -
      -
      -
      -

      NOTE: The Highlight macros will also add the string passed as the LANG param to the class of both the <pre> and <code> tags in the final HTML result:

      -
      <pre class="hl LANG"><code class="LANG">
      -

      This allows finer control of how the code should look like, via custom CSS.

      -
      -
      -

      Basic Example

      -

      We import the PureBASIC example file “code-example.pb” without passing any extra options to Highlight:

      -

      macro used:

      -
      !HighlightFile(code-example.pb)(purebasic)
      -

      raw html output:

      -
      <pre class="hl purebasic"><code class="purebasic"><span class="hl slc">; PureBASIC 5.60 Example</span>
      -
      -<span class="hl kwa">For</span> i<span class="hl opt">=</span><span class="hl num">5</span> <span class="hl kwa">To</span> <span class="hl num">1</span> <span class="hl kwa">Step</span> <span class="hl opt">-</span><span class="hl num">1</span>
      -  TEXT$ <span class="hl opt">=</span> <span class="hl str">&quot;Iteration number: &quot;</span> <span class="hl opt">+</span> <span class="hl kwc">Str</span>(i) <span class="hl opt">+</span> <span class="hl str">~&quot;</span><span class="hl esc">\n\n</span><span class="hl str">Do you wish to continue?&quot;</span>
      -  UserChoice <span class="hl opt">=</span> <span class="hl kwc">MessageRequester</span>(<span class="hl str">&quot;Countdown Dialog&quot;</span>, TEXT$, <span class="hl kwb">#PB_MessageRequester_YesNo</span> <span class="hl opt">|</span> <span class="hl kwb">#PB_MessageRequester_Info</span>)
      -  <span class="hl kwa">If</span> UserChoice <span class="hl opt">=</span> <span class="hl kwb">#PB_MessageRequester_No</span>
      -    <span class="hl kwa">Break</span>
      -  <span class="hl kwa">EndIf</span>
      -<span class="hl kwa">Next</span></code></pre>
      -

      result preview:

      -
      ; PureBASIC 5.60 Example
      -
      -For i=5 To 1 Step -1
      -  TEXT$ = "Iteration number: " + Str(i) + ~"\n\nDo you wish to continue?"
      -  UserChoice = MessageRequester("Countdown Dialog", TEXT$, #PB_MessageRequester_YesNo | #PB_MessageRequester_Info)
      -  If UserChoice = #PB_MessageRequester_No
      -    Break
      -  EndIf
      -Next
      -

      Example Using Options

      -

      Now we import the same file, this time passing some extra options to Highlight in order to show line numbers:

      -

      macro used:

      -
      !HighlightFile(code-example.pb)(purebasic)(--line-numbers --line-number-length=1)
      -
      -

      raw html output:

      -
      <pre class="hl purebasic"><code class="purebasic"><span class="hl lin">1 </span><span class="hl slc">; PureBASIC 5.60 Example</span>
      -<span class="hl lin">2 </span>
      -<span class="hl lin">3 </span><span class="hl kwa">For</span> i<span class="hl opt">=</span><span class="hl num">5</span> <span class="hl kwa">To</span> <span class="hl num">1</span> <span class="hl kwa">Step</span> <span class="hl opt">-</span><span class="hl num">1</span>
      -<span class="hl lin">4 </span>  TEXT$ <span class="hl opt">=</span> <span class="hl str">&quot;Iteration number: &quot;</span> <span class="hl opt">+</span> <span class="hl kwc">Str</span>(i) <span class="hl opt">+</span> <span class="hl str">~&quot;</span><span class="hl esc">\n\n</span><span class="hl str">Do you wish to continue?&quot;</span>
      -<span class="hl lin">5 </span>  UserChoice <span class="hl opt">=</span> <span class="hl kwc">MessageRequester</span>(<span class="hl str">&quot;Countdown Dialog&quot;</span>, TEXT$, <span class="hl kwb">#PB_MessageRequester_YesNo</span> <span class="hl opt">|</span> <span class="hl kwb">#PB_MessageRequester_Info</span>)
      -<span class="hl lin">6 </span>  <span class="hl kwa">If</span> UserChoice <span class="hl opt">=</span> <span class="hl kwb">#PB_MessageRequester_No</span>
      -<span class="hl lin">7 </span>    <span class="hl kwa">Break</span>
      -<span class="hl lin">8 </span>  <span class="hl kwa">EndIf</span>
      -<span class="hl lin">9 </span><span class="hl kwa">Next</span></code></pre>
      -
      -

      result preview:

      -
      1 ; PureBASIC 5.60 Example
      -2 
      -3 For i=5 To 1 Step -1
      -4   TEXT$ = "Iteration number: " + Str(i) + ~"\n\nDo you wish to continue?"
      -5   UserChoice = MessageRequester("Countdown Dialog", TEXT$, #PB_MessageRequester_YesNo | #PB_MessageRequester_Info)
      -6   If UserChoice = #PB_MessageRequester_No
      -7     Break
      -8   EndIf
      -9 Next
      -

      Highlighting a Code Block

      -

      The !Highlight macro takes an block of source code and passes it to Highlight tool for syntax coloring, and injects into the document the raw HTML results as a <pre><code> block.

      -

      It’s similar to the !HighlightFile macro, except it relies on source code defined inside the current document instead of an external file. So we won’t show the raw html emitted in the following examples, just the macro used and the final result.

      -

      The syntax is:

      -
      !Highlight( LANG )( OPTIONS )
      -~~~~~
      -CODE
      -~~~~~
      -

      … taking the following parameters:

      -
        -
      • LANG (mandatory) — The language of the source (eg: HTML, Python, etc.).
      • -
      • OPTIONS (can be empty) — Further options to pass to Highlight during invocation. If none desired, just pass empty value.
      • -
      • CODE (mandatory) — The block of source code to syntax-color.
      • -
      -
      -

      NOTE 1: The CODE parameter is passed between lines of tildas instead of brackets. From PP’s documentation:

      -
      -

      The last argument can be enclosed between lines of tildas or backquotes (of the same length) instead of parenthesis, brackets or braces and. This is useful for literate programming, diagrams or scripts (see examples). Code block arguments are not stripped: spaces and blank lines are preserved.

      -
      -
      - -
      -

      NOTE 2: This macro, when run inside Windows CMD, creates a temporary file (named “_pp-tempfileX.tmp”, where X is a numeric counter) in the macros folder (/pp/macros/) for each macro call in the document, to temporarily store the code to highlight. At each PP invocation the X counter is reset, and the previous temp files are written over. These temporary files are set to be ignored by Git, so you shouldn’t worry about them.

      -

      When run inside Shell/Bash (including Git Bash for Windows) it doesn’t write any temporary files to disk.

      -
      -

      Basic Example

      -

      We now define a block of PureBASIC code and pass it to Highlight without any extra options:

      -

      macro used:

      -
      !Highlight(purebasic)()
      -~~~~~~~~~~
      -; PureBASIC 5.60
      -For i=1 To 10
      -  Debug("Counting " + Str(i))
      -Next
      -~~~~~~~~~~
      -
      -

      result preview:

      -
      ; PureBASIC 5.60
      -For i=1 To 10
      -  Debug("Counting " + Str(i))
      -Next
      -

      Example Using Options

      -

      We now define a block of PureBASIC code and pass it to Highlight, this time providing some extra options to Highlight in order to show line numbers:

      -

      macro used:

      -
      !Highlight(purebasic)(--line-numbers --line-number-length=1)
      -~~~~~~~~~~
      -; PureBASIC 5.60
      -For i=1 To 10
      -  Debug("Counting " + Str(i))
      -Next
      -~~~~~~~~~~
      -
      -

      result preview:

      -
      1 ; PureBASIC 5.60
      -2 For i=1 To 10
      -3   Debug("Counting " + Str(i))
      -4 Next
      - - + + + + + + + + + + + + + + +

      Highlight PP-Macros Test

      +

      This is a run test of the GFM-TaskList pp-macros set.

      +

      Files List

      + +

      Macros list

      +
        +
      • !HighlightFile( FILE )( LANG )[( OPTIONS )] — imports and syntax-highlights and external file.
      • +
      • !Highlight( LANG )([ OPTIONS] )( CODE ) — syntax-highlights the code block defined in CODE.
      • +
      • !HighlightInlineTheme( THEME NAME ) — retrives a Highlight theme and injects its CSS into the documents.
      • +
      +

      Add Highlight Color Theme

      +

      For these examples we’ll import Highlight’s edit-purebasic theme into the document via the !HighlightInlineTheme macro:

      +
      !HighlightInlineTheme(edit-purebasic)
      +

      this macro emits the following raw html:

      +
      <style type="text/css">
      +/* Style definition file generated by highlight 3.39, http://www.andre-simon.de/ */
      +/* highlight theme: PureBASIC */
      +body.hl { background-color:#ffffdf; }
      +pre.hl  { color:#000000; background-color:#ffffdf; font-size:10pt; font-family:'Courier New',monospace;}
      +.hl.num { color:#000000; }
      +.hl.esc { color:#0080ff; }
      +.hl.str { color:#0080ff; }
      +.hl.pps { color:#0080ff; }
      +.hl.slc { color:#00aaaa; }
      +.hl.com { color:#00aaaa; }
      +.hl.ppc { color:#924b72; }
      +.hl.opt { color:#000000; }
      +.hl.ipl { color:#0080ff; }
      +.hl.lin { color:#808080; }
      +.hl.kwa { color:#006666; font-weight:bold; }
      +.hl.kwb { color:#924b72; }
      +.hl.kwc { color:#006666; }
      +.hl.kwd { color:#0080ff; }
      +
      +
      +</style>
      + +

      Now the CSS definition for PureBASIC code blocks (via Highlight) is available document-wide and you’ll see it aplied to the examples in this document.

      +

      Highlighting an External File

      +

      The !HighlightFile macro takes an external source code file, passes it to Highlight tool for syntax coloring, and injects into the document the raw HTML results as a <pre><code> block.

      +

      The syntax is:

      +
      !HighlightFile( FILE )( LANG )[( OPTIONS )]
      +

      … taking the following parameters:

      +
        +
      • FILE (mandatory) — The source file to syntax-color.
      • +
      • LANG (mandatory) — The language of the source (eg: HTML, Python, etc.).
      • +
      • OPTIONS (facultative) — Further options to pass to Highlight during invocation.
      • +
      +
      +
      +

      NOTE: The Highlight macros will also add the string passed as the LANG param to the class of both the <pre> and <code> tags in the final HTML result:

      +
      <pre class="hl LANG"><code class="LANG">
      +

      This allows finer control of how the code should look like, via custom CSS.

      +
      +
      +

      Basic Example

      +

      We import the PureBASIC example file “code-example.pb” without passing any extra options to Highlight:

      +

      macro used:

      +
      !HighlightFile(code-example.pb)(purebasic)
      +

      raw html output:

      +
      <pre class="hl purebasic"><code class="purebasic"><span class="hl slc">; PureBASIC 5.60 Example</span>
      +
      +<span class="hl kwa">For</span> i<span class="hl opt">=</span><span class="hl num">5</span> <span class="hl kwa">To</span> <span class="hl num">1</span> <span class="hl kwa">Step</span> <span class="hl opt">-</span><span class="hl num">1</span>
      +  TEXT$ <span class="hl opt">=</span> <span class="hl str">&quot;Iteration number: &quot;</span> <span class="hl opt">+</span> <span class="hl kwc">Str</span>(i) <span class="hl opt">+</span> <span class="hl str">~&quot;</span><span class="hl esc">\n\n</span><span class="hl str">Do you wish to continue?&quot;</span>
      +  UserChoice <span class="hl opt">=</span> <span class="hl kwc">MessageRequester</span>(<span class="hl str">&quot;Countdown Dialog&quot;</span>, TEXT$, <span class="hl kwb">#PB_MessageRequester_YesNo</span> <span class="hl opt">|</span> <span class="hl kwb">#PB_MessageRequester_Info</span>)
      +  <span class="hl kwa">If</span> UserChoice <span class="hl opt">=</span> <span class="hl kwb">#PB_MessageRequester_No</span>
      +    <span class="hl kwa">Break</span>
      +  <span class="hl kwa">EndIf</span>
      +<span class="hl kwa">Next</span></code></pre>
      +

      result preview:

      +
      ; PureBASIC 5.60 Example
      +
      +For i=5 To 1 Step -1
      +  TEXT$ = "Iteration number: " + Str(i) + ~"\n\nDo you wish to continue?"
      +  UserChoice = MessageRequester("Countdown Dialog", TEXT$, #PB_MessageRequester_YesNo | #PB_MessageRequester_Info)
      +  If UserChoice = #PB_MessageRequester_No
      +    Break
      +  EndIf
      +Next
      +

      Example Using Options

      +

      Now we import the same file, this time passing some extra options to Highlight in order to show line numbers:

      +

      macro used:

      +
      !HighlightFile(code-example.pb)(purebasic)(--line-numbers --line-number-length=1)
      +
      +

      raw html output:

      +
      <pre class="hl purebasic"><code class="purebasic"><span class="hl lin">1 </span><span class="hl slc">; PureBASIC 5.60 Example</span>
      +<span class="hl lin">2 </span>
      +<span class="hl lin">3 </span><span class="hl kwa">For</span> i<span class="hl opt">=</span><span class="hl num">5</span> <span class="hl kwa">To</span> <span class="hl num">1</span> <span class="hl kwa">Step</span> <span class="hl opt">-</span><span class="hl num">1</span>
      +<span class="hl lin">4 </span>  TEXT$ <span class="hl opt">=</span> <span class="hl str">&quot;Iteration number: &quot;</span> <span class="hl opt">+</span> <span class="hl kwc">Str</span>(i) <span class="hl opt">+</span> <span class="hl str">~&quot;</span><span class="hl esc">\n\n</span><span class="hl str">Do you wish to continue?&quot;</span>
      +<span class="hl lin">5 </span>  UserChoice <span class="hl opt">=</span> <span class="hl kwc">MessageRequester</span>(<span class="hl str">&quot;Countdown Dialog&quot;</span>, TEXT$, <span class="hl kwb">#PB_MessageRequester_YesNo</span> <span class="hl opt">|</span> <span class="hl kwb">#PB_MessageRequester_Info</span>)
      +<span class="hl lin">6 </span>  <span class="hl kwa">If</span> UserChoice <span class="hl opt">=</span> <span class="hl kwb">#PB_MessageRequester_No</span>
      +<span class="hl lin">7 </span>    <span class="hl kwa">Break</span>
      +<span class="hl lin">8 </span>  <span class="hl kwa">EndIf</span>
      +<span class="hl lin">9 </span><span class="hl kwa">Next</span></code></pre>
      +
      +

      result preview:

      +
      1 ; PureBASIC 5.60 Example
      +2 
      +3 For i=5 To 1 Step -1
      +4   TEXT$ = "Iteration number: " + Str(i) + ~"\n\nDo you wish to continue?"
      +5   UserChoice = MessageRequester("Countdown Dialog", TEXT$, #PB_MessageRequester_YesNo | #PB_MessageRequester_Info)
      +6   If UserChoice = #PB_MessageRequester_No
      +7     Break
      +8   EndIf
      +9 Next
      +

      Highlighting a Code Block

      +

      The !Highlight macro takes an block of source code and passes it to Highlight tool for syntax coloring, and injects into the document the raw HTML results as a <pre><code> block.

      +

      It’s similar to the !HighlightFile macro, except it relies on source code defined inside the current document instead of an external file. So we won’t show the raw html emitted in the following examples, just the macro used and the final result.

      +

      The syntax is:

      +
      !Highlight( LANG )( OPTIONS )
      +~~~~~
      +CODE
      +~~~~~
      +

      … taking the following parameters:

      +
        +
      • LANG (mandatory) — The language of the source (eg: HTML, Python, etc.).
      • +
      • OPTIONS (can be empty) — Further options to pass to Highlight during invocation. If none desired, just pass empty value.
      • +
      • CODE (mandatory) — The block of source code to syntax-color.
      • +
      +
      +

      NOTE 1: The CODE parameter is passed between lines of tildas instead of brackets. From PP’s documentation:

      +
      +

      The last argument can be enclosed between lines of tildas or backquotes (of the same length) instead of parenthesis, brackets or braces and. This is useful for literate programming, diagrams or scripts (see examples). Code block arguments are not stripped: spaces and blank lines are preserved.

      +
      +
      + +
      +

      NOTE 2: This macro, when run inside Windows CMD, creates a temporary file (named “_pp-tempfileX.tmp”, where X is a numeric counter) in the macros folder (/pp/macros/) for each macro call in the document, to temporarily store the code to highlight. At each PP invocation the X counter is reset, and the previous temp files are written over. These temporary files are set to be ignored by Git, so you shouldn’t worry about them.

      +

      When run inside Shell/Bash (including Git Bash for Windows) it doesn’t write any temporary files to disk.

      +
      +

      Basic Example

      +

      We now define a block of PureBASIC code and pass it to Highlight without any extra options:

      +

      macro used:

      +
      !Highlight(purebasic)()
      +~~~~~~~~~~
      +; PureBASIC 5.60
      +For i=1 To 10
      +  Debug("Counting " + Str(i))
      +Next
      +~~~~~~~~~~
      +
      +

      result preview:

      +
      ; PureBASIC 5.60
      +For i=1 To 10
      +  Debug("Counting " + Str(i))
      +Next
      +

      Example Using Options

      +

      We now define a block of PureBASIC code and pass it to Highlight, this time providing some extra options to Highlight in order to show line numbers:

      +

      macro used:

      +
      !Highlight(purebasic)(--line-numbers --line-number-length=1)
      +~~~~~~~~~~
      +; PureBASIC 5.60
      +For i=1 To 10
      +  Debug("Counting " + Str(i))
      +Next
      +~~~~~~~~~~
      +
      +

      result preview:

      +
      1 ; PureBASIC 5.60
      +2 For i=1 To 10
      +3   Debug("Counting " + Str(i))
      +4 Next
      + + diff --git a/pp/test/InlineFormatting.html b/pp/test/InlineFormatting.html index 051e270..de89855 100644 --- a/pp/test/InlineFormatting.html +++ b/pp/test/InlineFormatting.html @@ -1,152 +1,152 @@ - - - - - - - - - - - - - -

      InlineFormatting PP-Macros Test

      -

      This is a run test of the Inline Formatting pp-macros set.

      -

      Files List

      - -

      Macros list

      -
        -
      • !kbd( KEY1 )[( KEY2 )( KEY3 )( KEY4 )] — keystrokes in <kbd> tags.
      • -
      • !kbdInlineCSS — Inject required CSS (“kbd_GitHub.css”)
      • -
      -

      Keystrokes (<kbd>)

      -

      The !kbd macro is a fast way to represent up to four Keystrokes. It has the following syntax:

      -
      !kbd( KEY1 )[( KEY2 )( KEY3 )( KEY4 )]
      -

      … where only the first parameter is mandatory.

      -

      Example:

      -

      KEY1+KEY2+KEY3+KEY4

      -

      Keystrokes CSS

      -

      We need a custom CSS definition for viewing Keystrokes properly. We’ll use the !kbdInlineCSS macro to inject the contents of kbd_GitHub.css as inline stylesheet:

      -
      !kbdInlineCSS
      -

      this macro emits the following raw html:

      -
      <style type="text/css">
      -/*  ==============================================================================
      -    Adapted from "GitHub Markdown CSS" (c) Sindre Sorhus, MIT License (MIT):
      -    -- https://github.com/sindresorhus/github-markdown-css
      -    ============================================================================== */
      -kbd {
      -  display: inline-block;
      -  padding: 3px 5px;
      -  font-family: monospace, monospace;
      -  font-size: 11px; 
      -  line-height: 10px;
      -  color: #444d56;
      -  vertical-align: middle;
      -  background-color: #fafbfc;
      -  border: solid 1px #c6cbd1;
      -  border-bottom-color: #959da5;
      -  border-radius: 3px;
      -  box-shadow: inset 0 -1px 0 #959da5;
      -}
      -</style>
      - -

      Now the CSS definition is available document-wide and you’ll see it aplied to the Keystroke examples herein.

      -

      Of course, you can use your own CSS definitions instead of the one produced by the !kbdInlineCSS macro. This macro is just a convenient quick solution.

      -

      Single Key

      -

      macro used:

      -
      !kbd(CANC)
      -

      raw html output:

      -
      <kbd>CANC</kbd>
      -

      result preview:

      -

      CANC

      -

      Two Keys

      -

      macro used:

      -
      !kbd(Ctr)(Z)
      -

      raw html output:

      -
      <kbd>Ctr</kbd>+<kbd>Z</kbd>
      -

      result preview:

      -

      Ctr+Z

      -

      Three Keys

      -

      macro used:

      -
      !kbd(Ctr)(SHIFT)(S)
      -

      raw html output:

      -
      <kbd>Ctr</kbd>+<kbd>SHIFT</kbd>+<kbd>S</kbd>
      -

      result preview:

      -

      Ctr+SHIFT+S

      -

      Four Keys

      -

      macro used:

      -
      !kbd(Ctrl)(SHIFT)(Alt-GR)(j)
      -

      raw html output:

      -
      <kbd>Ctrl</kbd>+<kbd>SHIFT</kbd>+<kbd>Alt-GR</kbd>+<kbd>j</kbd>
      -

      result preview:

      -

      Ctrl+SHIFT+Alt-GR+j

      - - + + + + + + + + + + + + + +

      InlineFormatting PP-Macros Test

      +

      This is a run test of the Inline Formatting pp-macros set.

      +

      Files List

      + +

      Macros list

      +
        +
      • !kbd( KEY1 )[( KEY2 )( KEY3 )( KEY4 )] — keystrokes in <kbd> tags.
      • +
      • !kbdInlineCSS — Inject required CSS (“kbd_GitHub.css”)
      • +
      +

      Keystrokes (<kbd>)

      +

      The !kbd macro is a fast way to represent up to four Keystrokes. It has the following syntax:

      +
      !kbd( KEY1 )[( KEY2 )( KEY3 )( KEY4 )]
      +

      … where only the first parameter is mandatory.

      +

      Example:

      +

      KEY1+KEY2+KEY3+KEY4

      +

      Keystrokes CSS

      +

      We need a custom CSS definition for viewing Keystrokes properly. We’ll use the !kbdInlineCSS macro to inject the contents of kbd_GitHub.css as inline stylesheet:

      +
      !kbdInlineCSS
      +

      this macro emits the following raw html:

      +
      <style type="text/css">
      +/*  ==============================================================================
      +    Adapted from "GitHub Markdown CSS" (c) Sindre Sorhus, MIT License (MIT):
      +    -- https://github.com/sindresorhus/github-markdown-css
      +    ============================================================================== */
      +kbd {
      +  display: inline-block;
      +  padding: 3px 5px;
      +  font-family: monospace, monospace;
      +  font-size: 11px; 
      +  line-height: 10px;
      +  color: #444d56;
      +  vertical-align: middle;
      +  background-color: #fafbfc;
      +  border: solid 1px #c6cbd1;
      +  border-bottom-color: #959da5;
      +  border-radius: 3px;
      +  box-shadow: inset 0 -1px 0 #959da5;
      +}
      +</style>
      + +

      Now the CSS definition is available document-wide and you’ll see it aplied to the Keystroke examples herein.

      +

      Of course, you can use your own CSS definitions instead of the one produced by the !kbdInlineCSS macro. This macro is just a convenient quick solution.

      +

      Single Key

      +

      macro used:

      +
      !kbd(CANC)
      +

      raw html output:

      +
      <kbd>CANC</kbd>
      +

      result preview:

      +

      CANC

      +

      Two Keys

      +

      macro used:

      +
      !kbd(Ctr)(Z)
      +

      raw html output:

      +
      <kbd>Ctr</kbd>+<kbd>Z</kbd>
      +

      result preview:

      +

      Ctr+Z

      +

      Three Keys

      +

      macro used:

      +
      !kbd(Ctr)(SHIFT)(S)
      +

      raw html output:

      +
      <kbd>Ctr</kbd>+<kbd>SHIFT</kbd>+<kbd>S</kbd>
      +

      result preview:

      +

      Ctr+SHIFT+S

      +

      Four Keys

      +

      macro used:

      +
      !kbd(Ctrl)(SHIFT)(Alt-GR)(j)
      +

      raw html output:

      +
      <kbd>Ctrl</kbd>+<kbd>SHIFT</kbd>+<kbd>Alt-GR</kbd>+<kbd>j</kbd>
      +

      result preview:

      +

      Ctrl+SHIFT+Alt-GR+j

      + + diff --git a/pp/test/RUN-TESTS.bat b/pp/test/RUN-TESTS.bat index b697d83..db5eacf 100644 --- a/pp/test/RUN-TESTS.bat +++ b/pp/test/RUN-TESTS.bat @@ -1,37 +1,37 @@ -@ECHO OFF -CLS -ECHO ============================================================================== -ECHO RUNNING PP-MACROS TESTS -ECHO ============================================================================== - -:: Load the required env-var... -CALL ..\macros\INIT-ENV.bat - -:: Run test on every *.md file in this folder... -FOR %%i IN (*.md) DO ( - ECHO -- NOW PROCESSING: - ECHO %%i - CALL :PPCONVERT "%%i" - IF ERRORLEVEL 1 ( - ECHO ERROR -- Something went wrong! 1>&2 - ) ELSE ( - ECHO DONE! - ) -) - -EXIT /B - -:: ============================================================================== -:: PPCONVERT FUNCTION -:: ============================================================================== -:PPCONVERT - -pp %PP_MACROS_PATH%macros.pp ^ - %1 ^ - | pandoc -f markdown ^ - -t html5 ^ - --css=github.css ^ - --standalone ^ - --smart ^ - --normalize ^ +@ECHO OFF +CLS +ECHO ============================================================================== +ECHO RUNNING PP-MACROS TESTS +ECHO ============================================================================== + +:: Load the required env-var... +CALL ..\macros\INIT-ENV.bat + +:: Run test on every *.md file in this folder... +FOR %%i IN (*.md) DO ( + ECHO -- NOW PROCESSING: + ECHO %%i + CALL :PPCONVERT "%%i" + IF ERRORLEVEL 1 ( + ECHO ERROR -- Something went wrong! 1>&2 + ) ELSE ( + ECHO DONE! + ) +) + +EXIT /B + +:: ============================================================================== +:: PPCONVERT FUNCTION +:: ============================================================================== +:PPCONVERT + +pp %PP_MACROS_PATH%macros.pp ^ + %1 ^ + | pandoc -f markdown ^ + -t html5 ^ + --css=github.css ^ + --standalone ^ + --smart ^ + --normalize ^ -o %~n1.html \ No newline at end of file diff --git a/pp/test/RUN-TESTS.pp b/pp/test/RUN-TESTS.pp index 5f05231..97533ec 100644 --- a/pp/test/RUN-TESTS.pp +++ b/pp/test/RUN-TESTS.pp @@ -1,47 +1,47 @@ -!comment( RUNTEST ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The RUNTEST macro is a shortcut for display the text emitted by each tested -macro in three ways: - -1. Display the macro definition -2. Dispaly the raw emitted text -3. Display the actual macro result -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -!def(RUNTEST)( -macro used: - -``` -!rawdef(TEST) -``` - -raw html output: - -``` html -!TEST -``` - -result preview: - -!TEST -) - -!comment( RUNSIMPLETEST ) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The RUNSIMPLETEST macro is a shortcut for display the text emitted by each -tested macro in three ways: - -1. Display the macro definition -2. Display the actual macro result -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!def(RUNSIMPLETEST)( -macro used: - -``` -!rawdef(TEST) -``` - -result preview: - -!TEST +!comment( RUNTEST ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The RUNTEST macro is a shortcut for display the text emitted by each tested +macro in three ways: + +1. Display the macro definition +2. Dispaly the raw emitted text +3. Display the actual macro result +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +!def(RUNTEST)( +macro used: + +``` +!rawdef(TEST) +``` + +raw html output: + +``` html +!TEST +``` + +result preview: + +!TEST +) + +!comment( RUNSIMPLETEST ) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The RUNSIMPLETEST macro is a shortcut for display the text emitted by each +tested macro in three ways: + +1. Display the macro definition +2. Display the actual macro result +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!def(RUNSIMPLETEST)( +macro used: + +``` +!rawdef(TEST) +``` + +result preview: + +!TEST ) \ No newline at end of file diff --git a/skylighting-css/README.md b/skylighting-css/README.md index f2d08a9..a3e7ed1 100644 --- a/skylighting-css/README.md +++ b/skylighting-css/README.md @@ -1,74 +1,74 @@ -# Skylighting CSS - - pandoc v2.0.2 | v1.19.2 - -A collection of CSS/SCSS resources for styling code blocks syntax-highlighted by pandoc (HTML documents). - ------ - -**Table of Contents** - - - - - [Resources List](#resources-list) - - [Introduction](#introduction) - - [Appendixes](#appendixes) - - [Pandoc’s Syntax-Highlighting Engine](#pandocs-syntax-highlighting-engine) - - [Pandoc’s Supported Languages](#pandocs-supported-languages) - - - ------ - -# Resources List - - - [`/built-in-styles/`](./built-in-styles/) — Standalone CSS files of pandoc’s eight built-in highlighting styles. - - [`/sass-templates/`](./sass-templates/) — Sass templates for creating custom highlighting themes. - -# Introduction - -Pandoc features a [built-in syntax highlighter](#pandocs-syntax-highlighting-engine) with over 120 languages definitions ([full list](#pandocs-supported-languages)), and eight ready-to-use highlighting styles to choose from. - -Highlighted code blocks can optionally have line numbers, and it’s also possible to specify the starting line number. - -As of pandoc v2, it’s now possible to load dynamically custom syntax definitions and styles for highlighting, via the new `--syntax-definition=FILE` and `--highlight-style=STYLE|FILE` options. - -# Appendixes - -## Pandoc’s Syntax-Highlighting Engine - - - - -Since [version 1.19.2](https://github.com/jgm/pandoc/releases/tag/1.19.2) (Jan 2017) pandoc switched its internal highlighting engine from [highlighting-kate](https://github.com/jgm/highlighting-kate) to [skylighting](https://github.com/jgm/skylighting). - -## Pandoc’s Supported Languages - -As of Pandoc 2.0.2, the number of supported languages/syntaxes is 123. - -| | | | | | -| ------------ | ---------- | -------------- | --------------- | ---------------- | -| ABC | ASN.1 | ASP | ATS | AWK | -| ActionScript | Ada | Agda | alertindent | Apache | -| Bash | BibTeX | Boo | C | cs | -| C++ | CMake | CSS | changelog | Clojure | -| Coffee | ColdFusion | Common Lisp | Curry | D | -| dtd | diff | DjangoTemplate | dockerfile | Doxygen | -| doxygenlua | eiffel | elixir | email | Erlang | -| fsharp | Fortran | GCC | GLSL | GNU Assembler | -| m4 | Go | HTML | Hamlet | haskell | -| Haxe | ini | isoCpp | Idris | FASM | -| Nasm | JSON | JSP | Java | JavaScript | -| Javadoc | Julia | kotlin | LLVM | LaTeX | -| Lex | LilyPond | literateCurry | literateHaskell | Lua | -| mips | makefile | markdown | mathematica | MATLAB | -| Maxima | MediaWiki | metafont | modelines | Modula-2 | -| Modula-3 | Mono-Basic | OCaml | Objective-C | Objective C++ | -| Octave | OpenCL | PHP | Pascal | Perl | -| Pike | postscript | PowerShell | prolog | Pure | -| PureBASIC | Python | R | RELAX NG | RELAX NG Compact | -| roff | Ruby | RHTML | Rust | SGML | -| SQL | sqlmysql | sqlpostgresql | Scala | Scheme | -| tcl | tcsh | texinfo | mandoc | vhdl | -| verilog | XML | xul | YAML | Yacc | -| zsh | dot | noweb | rest | sci | -| sed | xorg | xslt | | | +# Skylighting CSS + + pandoc v2.0.2 | v1.19.2 + +A collection of CSS/SCSS resources for styling code blocks syntax-highlighted by pandoc (HTML documents). + +----- + +**Table of Contents** + + + + - [Resources List](#resources-list) + - [Introduction](#introduction) + - [Appendixes](#appendixes) + - [Pandoc’s Syntax-Highlighting Engine](#pandocs-syntax-highlighting-engine) + - [Pandoc’s Supported Languages](#pandocs-supported-languages) + + + +----- + +# Resources List + + - [`/built-in-styles/`](./built-in-styles/) — Standalone CSS files of pandoc’s eight built-in highlighting styles. + - [`/sass-templates/`](./sass-templates/) — Sass templates for creating custom highlighting themes. + +# Introduction + +Pandoc features a [built-in syntax highlighter](#pandocs-syntax-highlighting-engine) with over 120 languages definitions ([full list](#pandocs-supported-languages)), and eight ready-to-use highlighting styles to choose from. + +Highlighted code blocks can optionally have line numbers, and it’s also possible to specify the starting line number. + +As of pandoc v2, it’s now possible to load dynamically custom syntax definitions and styles for highlighting, via the new `--syntax-definition=FILE` and `--highlight-style=STYLE|FILE` options. + +# Appendixes + +## Pandoc’s Syntax-Highlighting Engine + + - + +Since [version 1.19.2](https://github.com/jgm/pandoc/releases/tag/1.19.2) (Jan 2017) pandoc switched its internal highlighting engine from [highlighting-kate](https://github.com/jgm/highlighting-kate) to [skylighting](https://github.com/jgm/skylighting). + +## Pandoc’s Supported Languages + +As of Pandoc 2.0.2, the number of supported languages/syntaxes is 123. + +| | | | | | +| ------------ | ---------- | -------------- | --------------- | ---------------- | +| ABC | ASN.1 | ASP | ATS | AWK | +| ActionScript | Ada | Agda | alertindent | Apache | +| Bash | BibTeX | Boo | C | cs | +| C++ | CMake | CSS | changelog | Clojure | +| Coffee | ColdFusion | Common Lisp | Curry | D | +| dtd | diff | DjangoTemplate | dockerfile | Doxygen | +| doxygenlua | eiffel | elixir | email | Erlang | +| fsharp | Fortran | GCC | GLSL | GNU Assembler | +| m4 | Go | HTML | Hamlet | haskell | +| Haxe | ini | isoCpp | Idris | FASM | +| Nasm | JSON | JSP | Java | JavaScript | +| Javadoc | Julia | kotlin | LLVM | LaTeX | +| Lex | LilyPond | literateCurry | literateHaskell | Lua | +| mips | makefile | markdown | mathematica | MATLAB | +| Maxima | MediaWiki | metafont | modelines | Modula-2 | +| Modula-3 | Mono-Basic | OCaml | Objective-C | Objective C++ | +| Octave | OpenCL | PHP | Pascal | Perl | +| Pike | postscript | PowerShell | prolog | Pure | +| PureBASIC | Python | R | RELAX NG | RELAX NG Compact | +| roff | Ruby | RHTML | Rust | SGML | +| SQL | sqlmysql | sqlpostgresql | Scala | Scheme | +| tcl | tcsh | texinfo | mandoc | vhdl | +| verilog | XML | xul | YAML | Yacc | +| zsh | dot | noweb | rest | sci | +| sed | xorg | xslt | | | diff --git a/skylighting-css/built-in-styles/README.md b/skylighting-css/built-in-styles/README.md index fb4fe32..d52ed99 100644 --- a/skylighting-css/built-in-styles/README.md +++ b/skylighting-css/built-in-styles/README.md @@ -1,70 +1,70 @@ -# Pandoc’s Built-in Styles - - pandoc v2.0.2 | v1.19.2 - -In this folder you’ll find the standalone CSS stylesheets of pandoc’s eight built-in styles (syntax highlighting themes): - -1. [`breezedark.css`](./breezedark.css) -2. [`espresso.css`](./espresso.css) -3. [`haddock.css`](./haddock.css) -4. [`kate.css`](./kate.css) -5. [`monochrome.css`](./monochrome.css) -6. [`pygments.css`](./pygments.css) (default style) -7. [`tango.css`](./tango.css) -8. [`zenburn.css`](./zenburn.css) - -The stylesheets were extracted from standalone HTML5 documents created with pandoc `v2.0.2`, using the `--highlight-style` option. A comment block with extra info was added at the beginning of each stylesheet. - -They are intended as a examples and quick reference when developing custom styles (see [License](#license) section below). - -## Pandoc v1 Styles - - - [`/pandoc_v1/`](./pandoc_v1/) - -In the “[`/pandoc_v1/`](./pandoc_v1/)” you’ll’ find the equivalent files for pandoc v1 — version 2 introduced some changes in syntax highlighting HTML tags and built-in styles’ CSS, so the old files are kept for projects that still require pandoc `v1.x`. - -From [pandoc v2.0 release notes](https://github.com/jgm/pandoc/releases/tag/2.0): - -> The way highlighted code blocks are formatted in HTML has been changed (David Baynard), in ways that may require changes in hard-coded CSS affecting highlighting. (If you haven’t included hard-coded highlighting CSS in your template, you needn’t change anything.) - -Most notably, line-numbered code dosen’t use HTML tables anymore. - -# About The Styles - -## Color Themes Inspiration - -Some info about the original themes these pandoc styles are based on (info taken from [skylighting source](https://github.com/jgm/skylighting/blob/master/src/Skylighting/Styles.hs) and further research). - - - **breezedark** — Style from the “Breeze Dark” KDE syntax highlighting theme. - - **espresso** — Style based on [ultraviolet](https://rubygems.org/gems/ultraviolet/versions/0.10.0)’s “[`espresso_libre.css`](https://github.com/spox/ultraviolet/blob/master/render/xhtml/files/css/espresso_libre.css)” (dark background) - - **haddock** — Style based on [Haddock](https://www.haskell.org/haddock/)’s source highlighting. - - **kate** — Style based on Kate’s default colors. - - **monochrome** — Style with no colors. - - **pygments** — Style based on [Pygments](http://pygments.org/)’ [default colors](https://bitbucket.org/birkenfeld/pygments-main/src/default/pygments/styles/default.py). - - **tango** — Style based on [Pygments](http://pygments.org/)’ “[tango](https://bitbucket.org/birkenfeld/pygments-main/src/default/pygments/styles/tango.py)” colors. - - **zenburn** — Style based on the popular “[Zenburn](http://kippura.org/zenburnpage/)” Vim color scheme. - -## License - - - [LICENSE](./LICENSE) — Pandoc license file. - - [GPL-2.0](./GPL-2.0) — GNU-GPL v2 license file. - -Pandoc’s built-in styles are dynamically generated by the skylighting library — ie: the actual CSS stylesheets are not present in pandoc’s nor skylighting’s source code, but are generated programmatically from a set a hardcoded values. The code that generates them can be seen here: - - - - -The CSS stylesheets of the syntax styles (aka “themes”) fall under the same license governing pandoc: **GPL v2** (or greater). - -Pandoc’s built-in default templates are maintained on a repository of their own, and they are dual-licensed — under both the **GPL** (**v2** or higher, same as pandoc) and the **BSD 3-clause** (“New” or “Revised”) license: - - - - -Even though pandoc templates are dual licensed, the actual CSS styles are not part of the HTML4/HTML5 templates, they are dynamically generated by pandoc and injected into the template when the following is encounterd: - - $if(highlighting-css)$ - - $endif$ - -It’s therefore safer to assume that the introduction of the built-in CSS stylesheets in a template or a final document excludes the **BSD 3-clause** license option, leaving as the only viable choice the **GPL v2** (or greater) license which is common to both templates and stylesheets. +# Pandoc’s Built-in Styles + + pandoc v2.0.2 | v1.19.2 + +In this folder you’ll find the standalone CSS stylesheets of pandoc’s eight built-in styles (syntax highlighting themes): + +1. [`breezedark.css`](./breezedark.css) +2. [`espresso.css`](./espresso.css) +3. [`haddock.css`](./haddock.css) +4. [`kate.css`](./kate.css) +5. [`monochrome.css`](./monochrome.css) +6. [`pygments.css`](./pygments.css) (default style) +7. [`tango.css`](./tango.css) +8. [`zenburn.css`](./zenburn.css) + +The stylesheets were extracted from standalone HTML5 documents created with pandoc `v2.0.2`, using the `--highlight-style` option. A comment block with extra info was added at the beginning of each stylesheet. + +They are intended as a examples and quick reference when developing custom styles (see [License](#license) section below). + +## Pandoc v1 Styles + + - [`/pandoc_v1/`](./pandoc_v1/) + +In the “[`/pandoc_v1/`](./pandoc_v1/)” you’ll’ find the equivalent files for pandoc v1 — version 2 introduced some changes in syntax highlighting HTML tags and built-in styles’ CSS, so the old files are kept for projects that still require pandoc `v1.x`. + +From [pandoc v2.0 release notes](https://github.com/jgm/pandoc/releases/tag/2.0): + +> The way highlighted code blocks are formatted in HTML has been changed (David Baynard), in ways that may require changes in hard-coded CSS affecting highlighting. (If you haven’t included hard-coded highlighting CSS in your template, you needn’t change anything.) + +Most notably, line-numbered code dosen’t use HTML tables anymore. + +# About The Styles + +## Color Themes Inspiration + +Some info about the original themes these pandoc styles are based on (info taken from [skylighting source](https://github.com/jgm/skylighting/blob/master/src/Skylighting/Styles.hs) and further research). + + - **breezedark** — Style from the “Breeze Dark” KDE syntax highlighting theme. + - **espresso** — Style based on [ultraviolet](https://rubygems.org/gems/ultraviolet/versions/0.10.0)’s “[`espresso_libre.css`](https://github.com/spox/ultraviolet/blob/master/render/xhtml/files/css/espresso_libre.css)” (dark background) + - **haddock** — Style based on [Haddock](https://www.haskell.org/haddock/)’s source highlighting. + - **kate** — Style based on Kate’s default colors. + - **monochrome** — Style with no colors. + - **pygments** — Style based on [Pygments](http://pygments.org/)’ [default colors](https://bitbucket.org/birkenfeld/pygments-main/src/default/pygments/styles/default.py). + - **tango** — Style based on [Pygments](http://pygments.org/)’ “[tango](https://bitbucket.org/birkenfeld/pygments-main/src/default/pygments/styles/tango.py)” colors. + - **zenburn** — Style based on the popular “[Zenburn](http://kippura.org/zenburnpage/)” Vim color scheme. + +## License + + - [LICENSE](./LICENSE) — Pandoc license file. + - [GPL-2.0](./GPL-2.0) — GNU-GPL v2 license file. + +Pandoc’s built-in styles are dynamically generated by the skylighting library — ie: the actual CSS stylesheets are not present in pandoc’s nor skylighting’s source code, but are generated programmatically from a set a hardcoded values. The code that generates them can be seen here: + + - + +The CSS stylesheets of the syntax styles (aka “themes”) fall under the same license governing pandoc: **GPL v2** (or greater). + +Pandoc’s built-in default templates are maintained on a repository of their own, and they are dual-licensed — under both the **GPL** (**v2** or higher, same as pandoc) and the **BSD 3-clause** (“New” or “Revised”) license: + + - + +Even though pandoc templates are dual licensed, the actual CSS styles are not part of the HTML4/HTML5 templates, they are dynamically generated by pandoc and injected into the template when the following is encounterd: + + $if(highlighting-css)$ + + $endif$ + +It’s therefore safer to assume that the introduction of the built-in CSS stylesheets in a template or a final document excludes the **BSD 3-clause** license option, leaving as the only viable choice the **GPL v2** (or greater) license which is common to both templates and stylesheets. diff --git a/skylighting-css/built-in-styles/breezedark.css b/skylighting-css/built-in-styles/breezedark.css index 639b5c4..3fd2c2e 100644 --- a/skylighting-css/built-in-styles/breezedark.css +++ b/skylighting-css/built-in-styles/breezedark.css @@ -1,65 +1,65 @@ -/* ============================================================================== - Breezedark (pandoc built-in style) - ============================================================================== - Style from the "Breeze Dark" KDE syntax highlighting theme. - - This stylesheet was produced using Pandoc v2.0.2. - - Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). - Released under the GPL, version 2 or greater. - ------------------------------------------------------------------------------ -*/ -div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } -a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } -.sourceCode { overflow: visible; } -code.sourceCode { white-space: pre; } -@media print { -code.sourceCode { white-space: pre-wrap; } -div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } -} -pre.numberSource div.sourceLine, .numberSource a.sourceLine - { position: relative; } -pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before - { content: attr(data-line-number); - position: absolute; left: -5em; text-align: right; vertical-align: baseline; - border: none; pointer-events: all; - -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; - -ms-user-select: none; user-select: none; - padding: 0 4px; width: 4em; } -pre.numberSource { margin-left: 3em; border-left: 1px solid #7a7c7d; background-color: #232629; color: #7a7c7d; padding-left: 4px; } -pre, code { color: #cfcfc2; background-color: #232629; } -@media screen { -a.sourceLine::before { text-decoration: underline; color: initial; } -} -code span.kw { color: #cfcfc2; } /* Keyword */ -code span.dt { color: #2980b9; } /* DataType */ -code span.dv { color: #f67400; } /* DecVal */ -code span.bn { color: #f67400; } /* BaseN */ -code span.fl { color: #f67400; } /* Float */ -code span.cn { color: #27aeae; } /* Constant */ -code span.ch { color: #3daee9; } /* Char */ -code span.sc { color: #3daee9; } /* SpecialChar */ -code span.st { color: #f44f4f; } /* String */ -code span.vs { color: #da4453; } /* VerbatimString */ -code span.ss { color: #da4453; } /* SpecialString */ -code span.im { color: #27ae60; } /* Import */ -code span.co { color: #7a7c7d; } /* Comment */ -code span.do { color: #a43340; } /* Documentation */ -code span.an { color: #3f8058; } /* Annotation */ -code span.cv { color: #7f8c8d; } /* CommentVar */ -code span.ot { color: #27ae60; } /* Other */ -code span.fu { color: #8e44ad; } /* Function */ -code span.va { color: #27aeae; } /* Variable */ -code span.cf { color: #fdbc4b; } /* ControlFlow */ -code span.op { color: #cfcfc2; } /* Operator */ -code span.bu { color: #7f8c8d; } /* BuiltIn */ -code span.ex { color: #0099ff; } /* Extension */ -code span.pp { color: #27ae60; } /* Preprocessor */ -code span.at { color: #2980b9; } /* Attribute */ -code span.re { color: #2980b9; } /* RegionMarker */ -code span.in { color: #c45b00; } /* Information */ -code span.wa { color: #da4453; } /* Warning */ -code span.al { color: #95da4c; } /* Alert */ -code span.er { color: #da4453; } /* Error */ +/* ============================================================================== + Breezedark (pandoc built-in style) + ============================================================================== + Style from the "Breeze Dark" KDE syntax highlighting theme. + + This stylesheet was produced using Pandoc v2.0.2. + + Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). + Released under the GPL, version 2 or greater. + ------------------------------------------------------------------------------ +*/ +div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } +a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } +.sourceCode { overflow: visible; } +code.sourceCode { white-space: pre; } +@media print { +code.sourceCode { white-space: pre-wrap; } +div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } +} +pre.numberSource div.sourceLine, .numberSource a.sourceLine + { position: relative; } +pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before + { content: attr(data-line-number); + position: absolute; left: -5em; text-align: right; vertical-align: baseline; + border: none; pointer-events: all; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; } +pre.numberSource { margin-left: 3em; border-left: 1px solid #7a7c7d; background-color: #232629; color: #7a7c7d; padding-left: 4px; } +pre, code { color: #cfcfc2; background-color: #232629; } +@media screen { +a.sourceLine::before { text-decoration: underline; color: initial; } +} +code span.kw { color: #cfcfc2; } /* Keyword */ +code span.dt { color: #2980b9; } /* DataType */ +code span.dv { color: #f67400; } /* DecVal */ +code span.bn { color: #f67400; } /* BaseN */ +code span.fl { color: #f67400; } /* Float */ +code span.cn { color: #27aeae; } /* Constant */ +code span.ch { color: #3daee9; } /* Char */ +code span.sc { color: #3daee9; } /* SpecialChar */ +code span.st { color: #f44f4f; } /* String */ +code span.vs { color: #da4453; } /* VerbatimString */ +code span.ss { color: #da4453; } /* SpecialString */ +code span.im { color: #27ae60; } /* Import */ +code span.co { color: #7a7c7d; } /* Comment */ +code span.do { color: #a43340; } /* Documentation */ +code span.an { color: #3f8058; } /* Annotation */ +code span.cv { color: #7f8c8d; } /* CommentVar */ +code span.ot { color: #27ae60; } /* Other */ +code span.fu { color: #8e44ad; } /* Function */ +code span.va { color: #27aeae; } /* Variable */ +code span.cf { color: #fdbc4b; } /* ControlFlow */ +code span.op { color: #cfcfc2; } /* Operator */ +code span.bu { color: #7f8c8d; } /* BuiltIn */ +code span.ex { color: #0099ff; } /* Extension */ +code span.pp { color: #27ae60; } /* Preprocessor */ +code span.at { color: #2980b9; } /* Attribute */ +code span.re { color: #2980b9; } /* RegionMarker */ +code span.in { color: #c45b00; } /* Information */ +code span.wa { color: #da4453; } /* Warning */ +code span.al { color: #95da4c; } /* Alert */ +code span.er { color: #da4453; } /* Error */ code span. { color: #cfcfc2; } /* Normal */ \ No newline at end of file diff --git a/skylighting-css/built-in-styles/espresso.css b/skylighting-css/built-in-styles/espresso.css index e6eb27a..67ac3a5 100644 --- a/skylighting-css/built-in-styles/espresso.css +++ b/skylighting-css/built-in-styles/espresso.css @@ -1,64 +1,64 @@ -/* ============================================================================== - Espresso (pandoc built-in style) - ============================================================================== - Style based on ultraviolet's "espresso_libre.css" (dark background): - - https://github.com/spox/ultraviolet/ - - This stylesheet was produced using Pandoc v2.0.2. - - Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). - Released under the GPL, version 2 or greater. - ------------------------------------------------------------------------------ -*/ -div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } -a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } -.sourceCode { overflow: visible; } -code.sourceCode { white-space: pre; } -@media print { -code.sourceCode { white-space: pre-wrap; } -div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } -} -pre.numberSource div.sourceLine, .numberSource a.sourceLine - { position: relative; } -pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before - { content: attr(data-line-number); - position: absolute; left: -5em; text-align: right; vertical-align: baseline; - border: none; pointer-events: all; - -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; - -ms-user-select: none; user-select: none; - padding: 0 4px; width: 4em; } -pre.numberSource { margin-left: 3em; border-left: 1px solid #bdae9d; background-color: #2a211c; color: #bdae9d; padding-left: 4px; } -pre, code { color: #bdae9d; background-color: #2a211c; } -@media screen { -a.sourceLine::before { text-decoration: underline; color: initial; } -} -code span.kw { color: #43a8ed; font-weight: bold; } /* Keyword */ -code span.dt { text-decoration: underline; } /* DataType */ -code span.dv { color: #44aa43; } /* DecVal */ -code span.bn { color: #44aa43; } /* BaseN */ -code span.fl { color: #44aa43; } /* Float */ -code span.ch { color: #049b0a; } /* Char */ -code span.st { color: #049b0a; } /* String */ -code span.co { color: #0066ff; font-style: italic; } /* Comment */ -code span.al { color: #ffff00; } /* Alert */ -code span.fu { color: #ff9358; font-weight: bold; } /* Function */ -code span.er { color: #ffff00; font-weight: bold; } /* Error */ -code span.wa { color: #ffff00; font-weight: bold; } /* Warning */ -code span.cn { } /* Constant */ -code span.sc { color: #049b0a; } /* SpecialChar */ -code span.vs { color: #049b0a; } /* VerbatimString */ -code span.ss { color: #049b0a; } /* SpecialString */ -code span.im { } /* Import */ -code span.va { } /* Variable */ -code span.cf { color: #43a8ed; font-weight: bold; } /* ControlFlow */ -code span.op { } /* Operator */ -code span.bu { } /* BuiltIn */ -code span.ex { } /* Extension */ -code span.pp { font-weight: bold; } /* Preprocessor */ -code span.at { } /* Attribute */ -code span.do { color: #0066ff; font-style: italic; } /* Documentation */ -code span.an { color: #0066ff; font-weight: bold; font-style: italic; } /* Annotation */ -code span.co { color: #0066ff; font-weight: bold; font-style: italic; } /* Comment */ +/* ============================================================================== + Espresso (pandoc built-in style) + ============================================================================== + Style based on ultraviolet's "espresso_libre.css" (dark background): + + https://github.com/spox/ultraviolet/ + + This stylesheet was produced using Pandoc v2.0.2. + + Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). + Released under the GPL, version 2 or greater. + ------------------------------------------------------------------------------ +*/ +div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } +a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } +.sourceCode { overflow: visible; } +code.sourceCode { white-space: pre; } +@media print { +code.sourceCode { white-space: pre-wrap; } +div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } +} +pre.numberSource div.sourceLine, .numberSource a.sourceLine + { position: relative; } +pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before + { content: attr(data-line-number); + position: absolute; left: -5em; text-align: right; vertical-align: baseline; + border: none; pointer-events: all; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; } +pre.numberSource { margin-left: 3em; border-left: 1px solid #bdae9d; background-color: #2a211c; color: #bdae9d; padding-left: 4px; } +pre, code { color: #bdae9d; background-color: #2a211c; } +@media screen { +a.sourceLine::before { text-decoration: underline; color: initial; } +} +code span.kw { color: #43a8ed; font-weight: bold; } /* Keyword */ +code span.dt { text-decoration: underline; } /* DataType */ +code span.dv { color: #44aa43; } /* DecVal */ +code span.bn { color: #44aa43; } /* BaseN */ +code span.fl { color: #44aa43; } /* Float */ +code span.ch { color: #049b0a; } /* Char */ +code span.st { color: #049b0a; } /* String */ +code span.co { color: #0066ff; font-style: italic; } /* Comment */ +code span.al { color: #ffff00; } /* Alert */ +code span.fu { color: #ff9358; font-weight: bold; } /* Function */ +code span.er { color: #ffff00; font-weight: bold; } /* Error */ +code span.wa { color: #ffff00; font-weight: bold; } /* Warning */ +code span.cn { } /* Constant */ +code span.sc { color: #049b0a; } /* SpecialChar */ +code span.vs { color: #049b0a; } /* VerbatimString */ +code span.ss { color: #049b0a; } /* SpecialString */ +code span.im { } /* Import */ +code span.va { } /* Variable */ +code span.cf { color: #43a8ed; font-weight: bold; } /* ControlFlow */ +code span.op { } /* Operator */ +code span.bu { } /* BuiltIn */ +code span.ex { } /* Extension */ +code span.pp { font-weight: bold; } /* Preprocessor */ +code span.at { } /* Attribute */ +code span.do { color: #0066ff; font-style: italic; } /* Documentation */ +code span.an { color: #0066ff; font-weight: bold; font-style: italic; } /* Annotation */ +code span.co { color: #0066ff; font-weight: bold; font-style: italic; } /* Comment */ code span.in { color: #0066ff; font-weight: bold; font-style: italic; } /* Information */ \ No newline at end of file diff --git a/skylighting-css/built-in-styles/haddock.css b/skylighting-css/built-in-styles/haddock.css index e232514..e8c264d 100644 --- a/skylighting-css/built-in-styles/haddock.css +++ b/skylighting-css/built-in-styles/haddock.css @@ -1,59 +1,59 @@ -/* ============================================================================== - Haddock (pandoc built-in style) - ============================================================================== - Style based on Haddock's source highlighting: - - https://www.haskell.org/haddock/ - - This stylesheet was produced using Pandoc v2.0.2. - - Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). - Released under the GPL, version 2 or greater. - ------------------------------------------------------------------------------ -*/ -div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } -a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } -.sourceCode { overflow: visible; } -code.sourceCode { white-space: pre; } -@media print { -code.sourceCode { white-space: pre-wrap; } -div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } -} -pre.numberSource div.sourceLine, .numberSource a.sourceLine - { position: relative; } -pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before - { content: attr(data-line-number); - position: absolute; left: -5em; text-align: right; vertical-align: baseline; - border: none; pointer-events: all; - -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; - -ms-user-select: none; user-select: none; - padding: 0 4px; width: 4em; } -pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; color: #aaaaaa; padding-left: 4px; } -@media screen { -a.sourceLine::before { text-decoration: underline; color: initial; } -} -code span.kw { color: #0000ff; } /* Keyword */ -code span.ch { color: #008080; } /* Char */ -code span.st { color: #008080; } /* String */ -code span.co { color: #008000; } /* Comment */ -code span.ot { color: #ff4000; } /* Other */ -code span.al { color: #ff0000; } /* Alert */ -code span.er { color: #ff0000; font-weight: bold; } /* Error */ -code span.wa { color: #008000; font-weight: bold; } /* Warning */ -code span.cn { } /* Constant */ -code span.sc { color: #008080; } /* SpecialChar */ -code span.vs { color: #008080; } /* VerbatimString */ -code span.ss { color: #008080; } /* SpecialString */ -code span.im { } /* Import */ -code span.va { } /* Variable */ -code span.cf { color: #0000ff; } /* ControlFlow */ -code span.op { } /* Operator */ -code span.bu { } /* BuiltIn */ -code span.ex { } /* Extension */ -code span.pp { color: #ff4000; } /* Preprocessor */ -code span.do { color: #008000; } /* Documentation */ -code span.an { color: #008000; } /* Annotation */ -code span.cv { color: #008000; } /* CommentVar */ -code span.at { } /* Attribute */ +/* ============================================================================== + Haddock (pandoc built-in style) + ============================================================================== + Style based on Haddock's source highlighting: + + https://www.haskell.org/haddock/ + + This stylesheet was produced using Pandoc v2.0.2. + + Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). + Released under the GPL, version 2 or greater. + ------------------------------------------------------------------------------ +*/ +div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } +a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } +.sourceCode { overflow: visible; } +code.sourceCode { white-space: pre; } +@media print { +code.sourceCode { white-space: pre-wrap; } +div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } +} +pre.numberSource div.sourceLine, .numberSource a.sourceLine + { position: relative; } +pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before + { content: attr(data-line-number); + position: absolute; left: -5em; text-align: right; vertical-align: baseline; + border: none; pointer-events: all; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; } +pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; color: #aaaaaa; padding-left: 4px; } +@media screen { +a.sourceLine::before { text-decoration: underline; color: initial; } +} +code span.kw { color: #0000ff; } /* Keyword */ +code span.ch { color: #008080; } /* Char */ +code span.st { color: #008080; } /* String */ +code span.co { color: #008000; } /* Comment */ +code span.ot { color: #ff4000; } /* Other */ +code span.al { color: #ff0000; } /* Alert */ +code span.er { color: #ff0000; font-weight: bold; } /* Error */ +code span.wa { color: #008000; font-weight: bold; } /* Warning */ +code span.cn { } /* Constant */ +code span.sc { color: #008080; } /* SpecialChar */ +code span.vs { color: #008080; } /* VerbatimString */ +code span.ss { color: #008080; } /* SpecialString */ +code span.im { } /* Import */ +code span.va { } /* Variable */ +code span.cf { color: #0000ff; } /* ControlFlow */ +code span.op { } /* Operator */ +code span.bu { } /* BuiltIn */ +code span.ex { } /* Extension */ +code span.pp { color: #ff4000; } /* Preprocessor */ +code span.do { color: #008000; } /* Documentation */ +code span.an { color: #008000; } /* Annotation */ +code span.cv { color: #008000; } /* CommentVar */ +code span.at { } /* Attribute */ code span.in { color: #008000; } /* Information */ \ No newline at end of file diff --git a/skylighting-css/built-in-styles/kate.css b/skylighting-css/built-in-styles/kate.css index 21bc421..9278502 100644 --- a/skylighting-css/built-in-styles/kate.css +++ b/skylighting-css/built-in-styles/kate.css @@ -1,65 +1,65 @@ -/* ============================================================================== - Kate (pandoc built-in style) - ============================================================================== - Style based on Kate's default colors. - - This stylesheet was produced using Pandoc v2.0.2. - - Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). - Released under the GPL, version 2 or greater. - ------------------------------------------------------------------------------ -*/ -div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } -a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } -.sourceCode { overflow: visible; } -code.sourceCode { white-space: pre; } -@media print { -code.sourceCode { white-space: pre-wrap; } -div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } -} -pre.numberSource div.sourceLine, .numberSource a.sourceLine - { position: relative; } -pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before - { content: attr(data-line-number); - position: absolute; left: -5em; text-align: right; vertical-align: baseline; - border: none; pointer-events: all; - -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; - -ms-user-select: none; user-select: none; - padding: 0 4px; width: 4em; } -pre.numberSource { margin-left: 3em; border-left: 1px solid #a0a0a0; background-color: #ffffff; color: #a0a0a0; padding-left: 4px; } -pre, code { color: #1f1c1b; background-color: #ffffff; } -@media screen { -a.sourceLine::before { text-decoration: underline; color: initial; } -} -code span.kw { color: #1f1c1b; font-weight: bold; } /* Keyword */ -code span.dt { color: #0057ae; } /* DataType */ -code span.dv { color: #b08000; } /* DecVal */ -code span.bn { color: #b08000; } /* BaseN */ -code span.fl { color: #b08000; } /* Float */ -code span.cn { color: #aa5500; } /* Constant */ -code span.ch { color: #924c9d; } /* Char */ -code span.sc { color: #3daee9; } /* SpecialChar */ -code span.st { color: #bf0303; } /* String */ -code span.vs { color: #bf0303; } /* VerbatimString */ -code span.ss { color: #ff5500; } /* SpecialString */ -code span.im { color: #ff5500; } /* Import */ -code span.co { color: #898887; } /* Comment */ -code span.do { color: #607880; } /* Documentation */ -code span.an { color: #ca60ca; } /* Annotation */ -code span.cv { color: #0095ff; } /* CommentVar */ -code span.ot { color: #006e28; } /* Other */ -code span.fu { color: #644a9b; } /* Function */ -code span.va { color: #0057ae; } /* Variable */ -code span.cf { color: #1f1c1b; font-weight: bold; } /* ControlFlow */ -code span.op { color: #1f1c1b; } /* Operator */ -code span.bu { color: #644a9b; font-weight: bold; } /* BuiltIn */ -code span.ex { color: #0095ff; font-weight: bold; } /* Extension */ -code span.pp { color: #006e28; } /* Preprocessor */ -code span.at { color: #0057ae; } /* Attribute */ -code span.re { color: #0057ae; background-color: #e0e9f8; } /* RegionMarker */ -code span.in { color: #b08000; } /* Information */ -code span.wa { color: #bf0303; } /* Warning */ -code span.al { color: #bf0303; background-color: #f7e6e6; font-weight: bold; } /* Alert */ -code span.er { color: #bf0303; text-decoration: underline; } /* Error */ +/* ============================================================================== + Kate (pandoc built-in style) + ============================================================================== + Style based on Kate's default colors. + + This stylesheet was produced using Pandoc v2.0.2. + + Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). + Released under the GPL, version 2 or greater. + ------------------------------------------------------------------------------ +*/ +div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } +a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } +.sourceCode { overflow: visible; } +code.sourceCode { white-space: pre; } +@media print { +code.sourceCode { white-space: pre-wrap; } +div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } +} +pre.numberSource div.sourceLine, .numberSource a.sourceLine + { position: relative; } +pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before + { content: attr(data-line-number); + position: absolute; left: -5em; text-align: right; vertical-align: baseline; + border: none; pointer-events: all; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; } +pre.numberSource { margin-left: 3em; border-left: 1px solid #a0a0a0; background-color: #ffffff; color: #a0a0a0; padding-left: 4px; } +pre, code { color: #1f1c1b; background-color: #ffffff; } +@media screen { +a.sourceLine::before { text-decoration: underline; color: initial; } +} +code span.kw { color: #1f1c1b; font-weight: bold; } /* Keyword */ +code span.dt { color: #0057ae; } /* DataType */ +code span.dv { color: #b08000; } /* DecVal */ +code span.bn { color: #b08000; } /* BaseN */ +code span.fl { color: #b08000; } /* Float */ +code span.cn { color: #aa5500; } /* Constant */ +code span.ch { color: #924c9d; } /* Char */ +code span.sc { color: #3daee9; } /* SpecialChar */ +code span.st { color: #bf0303; } /* String */ +code span.vs { color: #bf0303; } /* VerbatimString */ +code span.ss { color: #ff5500; } /* SpecialString */ +code span.im { color: #ff5500; } /* Import */ +code span.co { color: #898887; } /* Comment */ +code span.do { color: #607880; } /* Documentation */ +code span.an { color: #ca60ca; } /* Annotation */ +code span.cv { color: #0095ff; } /* CommentVar */ +code span.ot { color: #006e28; } /* Other */ +code span.fu { color: #644a9b; } /* Function */ +code span.va { color: #0057ae; } /* Variable */ +code span.cf { color: #1f1c1b; font-weight: bold; } /* ControlFlow */ +code span.op { color: #1f1c1b; } /* Operator */ +code span.bu { color: #644a9b; font-weight: bold; } /* BuiltIn */ +code span.ex { color: #0095ff; font-weight: bold; } /* Extension */ +code span.pp { color: #006e28; } /* Preprocessor */ +code span.at { color: #0057ae; } /* Attribute */ +code span.re { color: #0057ae; background-color: #e0e9f8; } /* RegionMarker */ +code span.in { color: #b08000; } /* Information */ +code span.wa { color: #bf0303; } /* Warning */ +code span.al { color: #bf0303; background-color: #f7e6e6; font-weight: bold; } /* Alert */ +code span.er { color: #bf0303; text-decoration: underline; } /* Error */ code span. { color: #1f1c1b; } /* Normal */ \ No newline at end of file diff --git a/skylighting-css/built-in-styles/monochrome.css b/skylighting-css/built-in-styles/monochrome.css index e89de67..8bda7fe 100644 --- a/skylighting-css/built-in-styles/monochrome.css +++ b/skylighting-css/built-in-styles/monochrome.css @@ -1,45 +1,45 @@ -/* ============================================================================== - Monochrome (pandoc built-in style) - ============================================================================== - Style with no colors. - - This stylesheet was produced using Pandoc v2.0.2. - - Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). - Released under the GPL, version 2 or greater. - ------------------------------------------------------------------------------ -*/ -div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } -a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } -.sourceCode { overflow: visible; } -code.sourceCode { white-space: pre; } -@media print { -code.sourceCode { white-space: pre-wrap; } -div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } -} -pre.numberSource div.sourceLine, .numberSource a.sourceLine - { position: relative; } -pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before - { content: attr(data-line-number); - position: absolute; left: -5em; text-align: right; vertical-align: baseline; - border: none; pointer-events: all; - -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; - -ms-user-select: none; user-select: none; - padding: 0 4px; width: 4em; } -pre.numberSource { margin-left: 3em; padding-left: 4px; } -@media screen { -a.sourceLine::before { text-decoration: underline; color: initial; } -} -code span.kw { font-weight: bold; } /* Keyword */ -code span.dt { text-decoration: underline; } /* DataType */ -code span.co { font-style: italic; } /* Comment */ -code span.al { font-weight: bold; } /* Alert */ -code span.er { font-weight: bold; } /* Error */ -code span.wa { font-style: italic; } /* Warning */ -code span.cf { font-weight: bold; } /* ControlFlow */ -code span.pp { font-weight: bold; } /* Preprocessor */ -code span.do { font-style: italic; } /* Documentation */ -code span.an { font-style: italic; } /* Annotation */ -code span.cv { font-style: italic; } /* CommentVar */ +/* ============================================================================== + Monochrome (pandoc built-in style) + ============================================================================== + Style with no colors. + + This stylesheet was produced using Pandoc v2.0.2. + + Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). + Released under the GPL, version 2 or greater. + ------------------------------------------------------------------------------ +*/ +div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } +a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } +.sourceCode { overflow: visible; } +code.sourceCode { white-space: pre; } +@media print { +code.sourceCode { white-space: pre-wrap; } +div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } +} +pre.numberSource div.sourceLine, .numberSource a.sourceLine + { position: relative; } +pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before + { content: attr(data-line-number); + position: absolute; left: -5em; text-align: right; vertical-align: baseline; + border: none; pointer-events: all; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; } +pre.numberSource { margin-left: 3em; padding-left: 4px; } +@media screen { +a.sourceLine::before { text-decoration: underline; color: initial; } +} +code span.kw { font-weight: bold; } /* Keyword */ +code span.dt { text-decoration: underline; } /* DataType */ +code span.co { font-style: italic; } /* Comment */ +code span.al { font-weight: bold; } /* Alert */ +code span.er { font-weight: bold; } /* Error */ +code span.wa { font-style: italic; } /* Warning */ +code span.cf { font-weight: bold; } /* ControlFlow */ +code span.pp { font-weight: bold; } /* Preprocessor */ +code span.do { font-style: italic; } /* Documentation */ +code span.an { font-style: italic; } /* Annotation */ +code span.cv { font-style: italic; } /* CommentVar */ code span.in { font-style: italic; } /* Information */ \ No newline at end of file diff --git a/skylighting-css/built-in-styles/pygments.css b/skylighting-css/built-in-styles/pygments.css index 66379f8..49d5a85 100644 --- a/skylighting-css/built-in-styles/pygments.css +++ b/skylighting-css/built-in-styles/pygments.css @@ -1,62 +1,62 @@ -/* ============================================================================== - Pygments (pandoc built-in style) - ============================================================================== - Style based on Pygments' default colors. - - This stylesheet was produced using Pandoc v2.0.2. - - Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). - Released under the GPL, version 2 or greater. - ------------------------------------------------------------------------------ -*/ -div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } -a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } -.sourceCode { overflow: visible; } -code.sourceCode { white-space: pre; } -@media print { -code.sourceCode { white-space: pre-wrap; } -div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } -} -pre.numberSource div.sourceLine, .numberSource a.sourceLine - { position: relative; } -pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before - { content: attr(data-line-number); - position: absolute; left: -5em; text-align: right; vertical-align: baseline; - border: none; pointer-events: all; - -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; - -ms-user-select: none; user-select: none; - padding: 0 4px; width: 4em; } -pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; color: #aaaaaa; padding-left: 4px; } -@media screen { -a.sourceLine::before { text-decoration: underline; color: initial; } -} -code span.kw { color: #007020; font-weight: bold; } /* Keyword */ -code span.dt { color: #902000; } /* DataType */ -code span.dv { color: #40a070; } /* DecVal */ -code span.bn { color: #40a070; } /* BaseN */ -code span.fl { color: #40a070; } /* Float */ -code span.ch { color: #4070a0; } /* Char */ -code span.st { color: #4070a0; } /* String */ -code span.co { color: #60a0b0; font-style: italic; } /* Comment */ -code span.ot { color: #007020; } /* Other */ -code span.al { color: #ff0000; font-weight: bold; } /* Alert */ -code span.fu { color: #06287e; } /* Function */ -code span.er { color: #ff0000; font-weight: bold; } /* Error */ -code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ -code span.cn { color: #880000; } /* Constant */ -code span.sc { color: #4070a0; } /* SpecialChar */ -code span.vs { color: #4070a0; } /* VerbatimString */ -code span.ss { color: #bb6688; } /* SpecialString */ -code span.im { } /* Import */ -code span.va { color: #19177c; } /* Variable */ -code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ -code span.op { color: #666666; } /* Operator */ -code span.bu { } /* BuiltIn */ -code span.ex { } /* Extension */ -code span.pp { color: #bc7a00; } /* Preprocessor */ -code span.at { color: #7d9029; } /* Attribute */ -code span.do { color: #ba2121; font-style: italic; } /* Documentation */ -code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ -code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ +/* ============================================================================== + Pygments (pandoc built-in style) + ============================================================================== + Style based on Pygments' default colors. + + This stylesheet was produced using Pandoc v2.0.2. + + Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). + Released under the GPL, version 2 or greater. + ------------------------------------------------------------------------------ +*/ +div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } +a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } +.sourceCode { overflow: visible; } +code.sourceCode { white-space: pre; } +@media print { +code.sourceCode { white-space: pre-wrap; } +div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } +} +pre.numberSource div.sourceLine, .numberSource a.sourceLine + { position: relative; } +pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before + { content: attr(data-line-number); + position: absolute; left: -5em; text-align: right; vertical-align: baseline; + border: none; pointer-events: all; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; } +pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; color: #aaaaaa; padding-left: 4px; } +@media screen { +a.sourceLine::before { text-decoration: underline; color: initial; } +} +code span.kw { color: #007020; font-weight: bold; } /* Keyword */ +code span.dt { color: #902000; } /* DataType */ +code span.dv { color: #40a070; } /* DecVal */ +code span.bn { color: #40a070; } /* BaseN */ +code span.fl { color: #40a070; } /* Float */ +code span.ch { color: #4070a0; } /* Char */ +code span.st { color: #4070a0; } /* String */ +code span.co { color: #60a0b0; font-style: italic; } /* Comment */ +code span.ot { color: #007020; } /* Other */ +code span.al { color: #ff0000; font-weight: bold; } /* Alert */ +code span.fu { color: #06287e; } /* Function */ +code span.er { color: #ff0000; font-weight: bold; } /* Error */ +code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ +code span.cn { color: #880000; } /* Constant */ +code span.sc { color: #4070a0; } /* SpecialChar */ +code span.vs { color: #4070a0; } /* VerbatimString */ +code span.ss { color: #bb6688; } /* SpecialString */ +code span.im { } /* Import */ +code span.va { color: #19177c; } /* Variable */ +code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ +code span.op { color: #666666; } /* Operator */ +code span.bu { } /* BuiltIn */ +code span.ex { } /* Extension */ +code span.pp { color: #bc7a00; } /* Preprocessor */ +code span.at { color: #7d9029; } /* Attribute */ +code span.do { color: #ba2121; font-style: italic; } /* Documentation */ +code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ +code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ \ No newline at end of file diff --git a/skylighting-css/built-in-styles/tango.css b/skylighting-css/built-in-styles/tango.css index 2df7e62..7e7d34c 100644 --- a/skylighting-css/built-in-styles/tango.css +++ b/skylighting-css/built-in-styles/tango.css @@ -1,62 +1,62 @@ -/* ============================================================================== - Tango (pandoc built-in style) - ============================================================================== - Style based on Pygments' "tango" colors. - - This stylesheet was produced using Pandoc v2.0.2. - - Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). - Released under the GPL, version 2 or greater. - ------------------------------------------------------------------------------ -*/ -div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } -a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } -.sourceCode { overflow: visible; } -code.sourceCode { white-space: pre; } -@media print { -code.sourceCode { white-space: pre-wrap; } -div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } -} -pre.numberSource div.sourceLine, .numberSource a.sourceLine - { position: relative; } -pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before - { content: attr(data-line-number); - position: absolute; left: -5em; text-align: right; vertical-align: baseline; - border: none; pointer-events: all; - -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; - -ms-user-select: none; user-select: none; - padding: 0 4px; width: 4em; } -pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; color: #aaaaaa; padding-left: 4px; } -pre, code { background-color: #f8f8f8; } -@media screen { -a.sourceLine::before { text-decoration: underline; color: initial; } -} -code span.kw { color: #204a87; font-weight: bold; } /* Keyword */ -code span.dt { color: #204a87; } /* DataType */ -code span.dv { color: #0000cf; } /* DecVal */ -code span.bn { color: #0000cf; } /* BaseN */ -code span.fl { color: #0000cf; } /* Float */ -code span.ch { color: #4e9a06; } /* Char */ -code span.st { color: #4e9a06; } /* String */ -code span.co { color: #8f5902; font-style: italic; } /* Comment */ -code span.ot { color: #8f5902; } /* Other */ -code span.al { color: #ef2929; } /* Alert */ -code span.fu { color: #000000; } /* Function */ -code span.er { color: #a40000; font-weight: bold; } /* Error */ -code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */ -code span.cn { color: #000000; } /* Constant */ -code span.sc { color: #000000; } /* SpecialChar */ -code span.vs { color: #4e9a06; } /* VerbatimString */ -code span.ss { color: #4e9a06; } /* SpecialString */ -code span.im { } /* Import */ -code span.va { color: #000000; } /* Variable */ -code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */ -code span.op { color: #ce5c00; font-weight: bold; } /* Operator */ -code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */ -code span.ex { } /* Extension */ -code span.at { color: #c4a000; } /* Attribute */ -code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */ -code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */ -code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */ +/* ============================================================================== + Tango (pandoc built-in style) + ============================================================================== + Style based on Pygments' "tango" colors. + + This stylesheet was produced using Pandoc v2.0.2. + + Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). + Released under the GPL, version 2 or greater. + ------------------------------------------------------------------------------ +*/ +div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } +a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } +.sourceCode { overflow: visible; } +code.sourceCode { white-space: pre; } +@media print { +code.sourceCode { white-space: pre-wrap; } +div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } +} +pre.numberSource div.sourceLine, .numberSource a.sourceLine + { position: relative; } +pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before + { content: attr(data-line-number); + position: absolute; left: -5em; text-align: right; vertical-align: baseline; + border: none; pointer-events: all; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; } +pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; color: #aaaaaa; padding-left: 4px; } +pre, code { background-color: #f8f8f8; } +@media screen { +a.sourceLine::before { text-decoration: underline; color: initial; } +} +code span.kw { color: #204a87; font-weight: bold; } /* Keyword */ +code span.dt { color: #204a87; } /* DataType */ +code span.dv { color: #0000cf; } /* DecVal */ +code span.bn { color: #0000cf; } /* BaseN */ +code span.fl { color: #0000cf; } /* Float */ +code span.ch { color: #4e9a06; } /* Char */ +code span.st { color: #4e9a06; } /* String */ +code span.co { color: #8f5902; font-style: italic; } /* Comment */ +code span.ot { color: #8f5902; } /* Other */ +code span.al { color: #ef2929; } /* Alert */ +code span.fu { color: #000000; } /* Function */ +code span.er { color: #a40000; font-weight: bold; } /* Error */ +code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */ +code span.cn { color: #000000; } /* Constant */ +code span.sc { color: #000000; } /* SpecialChar */ +code span.vs { color: #4e9a06; } /* VerbatimString */ +code span.ss { color: #4e9a06; } /* SpecialString */ +code span.im { } /* Import */ +code span.va { color: #000000; } /* Variable */ +code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */ +code span.op { color: #ce5c00; font-weight: bold; } /* Operator */ +code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */ +code span.ex { } /* Extension */ +code span.at { color: #c4a000; } /* Attribute */ +code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */ +code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */ +code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */ code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */ \ No newline at end of file diff --git a/skylighting-css/built-in-styles/zenburn.css b/skylighting-css/built-in-styles/zenburn.css index 0c41002..1255e80 100644 --- a/skylighting-css/built-in-styles/zenburn.css +++ b/skylighting-css/built-in-styles/zenburn.css @@ -1,65 +1,65 @@ -/* ============================================================================== - Zenburn (pandoc built-in style) - ============================================================================== - Style based on the popular "Zenburn" Vim color scheme: - - http://kippura.org/zenburnpage/ - - This stylesheet was produced using Pandoc v2.0.2. - - Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). - Released under the GPL, version 2 or greater. - ------------------------------------------------------------------------------ -*/ -div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } -a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } -.sourceCode { overflow: visible; } -code.sourceCode { white-space: pre; } -@media print { -code.sourceCode { white-space: pre-wrap; } -div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } -} -pre.numberSource div.sourceLine, .numberSource a.sourceLine - { position: relative; } -pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before - { content: attr(data-line-number); - position: absolute; left: -5em; text-align: right; vertical-align: baseline; - border: none; pointer-events: all; - -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; - -ms-user-select: none; user-select: none; - padding: 0 4px; width: 4em; } -pre.numberSource { margin-left: 3em; padding-left: 4px; } -pre, code { color: #cccccc; background-color: #303030; } -@media screen { -a.sourceLine::before { text-decoration: underline; color: initial; } -} -code span.kw { color: #f0dfaf; } /* Keyword */ -code span.dt { color: #dfdfbf; } /* DataType */ -code span.dv { color: #dcdccc; } /* DecVal */ -code span.bn { color: #dca3a3; } /* BaseN */ -code span.fl { color: #c0bed1; } /* Float */ -code span.ch { color: #dca3a3; } /* Char */ -code span.st { color: #cc9393; } /* String */ -code span.co { color: #7f9f7f; } /* Comment */ -code span.ot { color: #efef8f; } /* Other */ -code span.al { color: #ffcfaf; } /* Alert */ -code span.fu { color: #efef8f; } /* Function */ -code span.er { color: #c3bf9f; } /* Error */ -code span.wa { color: #7f9f7f; font-weight: bold; } /* Warning */ -code span.cn { color: #dca3a3; font-weight: bold; } /* Constant */ -code span.sc { color: #dca3a3; } /* SpecialChar */ -code span.vs { color: #cc9393; } /* VerbatimString */ -code span.ss { color: #cc9393; } /* SpecialString */ -code span.im { } /* Import */ -code span.va { } /* Variable */ -code span.cf { color: #f0dfaf; } /* ControlFlow */ -code span.op { color: #f0efd0; } /* Operator */ -code span.bu { } /* BuiltIn */ -code span.ex { } /* Extension */ -code span.pp { color: #ffcfaf; font-weight: bold; } /* Preprocessor */ -code span.at { } /* Attribute */ -code span.do { color: #7f9f7f; } /* Documentation */ -code span.an { color: #7f9f7f; font-weight: bold; } /* Annotation */ -code span.cv { color: #7f9f7f; font-weight: bold; } /* CommentVar */ +/* ============================================================================== + Zenburn (pandoc built-in style) + ============================================================================== + Style based on the popular "Zenburn" Vim color scheme: + + http://kippura.org/zenburnpage/ + + This stylesheet was produced using Pandoc v2.0.2. + + Pandoc is (c) 2006-2017 John MacFarlane (jgm@berkeley.edu). + Released under the GPL, version 2 or greater. + ------------------------------------------------------------------------------ +*/ +div.sourceLine, a.sourceLine { display: inline-block; min-height: 1.25em; } +a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; } +.sourceCode { overflow: visible; } +code.sourceCode { white-space: pre; } +@media print { +code.sourceCode { white-space: pre-wrap; } +div.sourceLine, a.sourceLine { text-indent: -1em; padding-left: 1em; } +} +pre.numberSource div.sourceLine, .numberSource a.sourceLine + { position: relative; } +pre.numberSource div.sourceLine::before, .numberSource a.sourceLine::before + { content: attr(data-line-number); + position: absolute; left: -5em; text-align: right; vertical-align: baseline; + border: none; pointer-events: all; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; } +pre.numberSource { margin-left: 3em; padding-left: 4px; } +pre, code { color: #cccccc; background-color: #303030; } +@media screen { +a.sourceLine::before { text-decoration: underline; color: initial; } +} +code span.kw { color: #f0dfaf; } /* Keyword */ +code span.dt { color: #dfdfbf; } /* DataType */ +code span.dv { color: #dcdccc; } /* DecVal */ +code span.bn { color: #dca3a3; } /* BaseN */ +code span.fl { color: #c0bed1; } /* Float */ +code span.ch { color: #dca3a3; } /* Char */ +code span.st { color: #cc9393; } /* String */ +code span.co { color: #7f9f7f; } /* Comment */ +code span.ot { color: #efef8f; } /* Other */ +code span.al { color: #ffcfaf; } /* Alert */ +code span.fu { color: #efef8f; } /* Function */ +code span.er { color: #c3bf9f; } /* Error */ +code span.wa { color: #7f9f7f; font-weight: bold; } /* Warning */ +code span.cn { color: #dca3a3; font-weight: bold; } /* Constant */ +code span.sc { color: #dca3a3; } /* SpecialChar */ +code span.vs { color: #cc9393; } /* VerbatimString */ +code span.ss { color: #cc9393; } /* SpecialString */ +code span.im { } /* Import */ +code span.va { } /* Variable */ +code span.cf { color: #f0dfaf; } /* ControlFlow */ +code span.op { color: #f0efd0; } /* Operator */ +code span.bu { } /* BuiltIn */ +code span.ex { } /* Extension */ +code span.pp { color: #ffcfaf; font-weight: bold; } /* Preprocessor */ +code span.at { } /* Attribute */ +code span.do { color: #7f9f7f; } /* Documentation */ +code span.an { color: #7f9f7f; font-weight: bold; } /* Annotation */ +code span.cv { color: #7f9f7f; font-weight: bold; } /* CommentVar */ code span.in { color: #7f9f7f; font-weight: bold; } /* Information */ \ No newline at end of file diff --git a/skylighting-css/sass-templates/README.md b/skylighting-css/sass-templates/README.md index dae8098..00f22a7 100644 --- a/skylighting-css/sass-templates/README.md +++ b/skylighting-css/sass-templates/README.md @@ -1,47 +1,47 @@ -# Sass Highlighting Templates for Pandoc - - pandoc v2.0.2 | v1.19.2 - -Sass templates for creating custom syntax highlighting themes for pandoc v2. - ------ - -**Table of Contents** - - - - - [Resources List](#resources-list) - - [Pandoc v1 Styles](#pandoc-v1-styles) - - [Introduction](#introduction) - - - ------ - -# Resources List - - - [`bare-bones.scss`](./bare-bones.scss) — Basic Sass boilerplate replicating pandoc’s built-in sytles. - - [`build-n-watch.bat`](./build-n-watch.bat) — Batch script for building and watching SCSS files in this folder. - - [`UNLICENSE`](./UNLICENSE) — The Unlicense terms (pulic domain) for the SCSS files. - -## Pandoc v1 Styles - - - [`/pandoc_v1/`](./pandoc_v1/) - -In the “[`/pandoc_v1/`](./pandoc_v1/)” you’ll’ find the equivalent files for pandoc v1 — version 2 introduced some changes in syntax highlighting HTML tags and built-in styles’ CSS, so the old files are kept for projects that still require pandoc `v1.x`. - -From [pandoc v2.0 release notes](https://github.com/jgm/pandoc/releases/tag/2.0): - -> The way highlighted code blocks are formatted in HTML has been changed (David Baynard), in ways that may require changes in hard-coded CSS affecting highlighting. (If you haven’t included hard-coded highlighting CSS in your template, you needn’t change anything.) - -Most notably, line-numbered code dosen’t use HTML tables anymore. - -# Introduction - -Sass (syntactically awesome stylesheets) is a great tool for creating CSS stylesheets: - - - - -Especially so if you’re planning to create a stylesheet that applies different color themes for each language — then Sass will save you time and let you work with smaller and less entangled source files. - -Here you’ll find some ready-made SCSS templates and modules to style pandoc syntax highlighting. +# Sass Highlighting Templates for Pandoc + + pandoc v2.0.2 | v1.19.2 + +Sass templates for creating custom syntax highlighting themes for pandoc v2. + +----- + +**Table of Contents** + + + + - [Resources List](#resources-list) + - [Pandoc v1 Styles](#pandoc-v1-styles) + - [Introduction](#introduction) + + + +----- + +# Resources List + + - [`bare-bones.scss`](./bare-bones.scss) — Basic Sass boilerplate replicating pandoc’s built-in sytles. + - [`build-n-watch.bat`](./build-n-watch.bat) — Batch script for building and watching SCSS files in this folder. + - [`UNLICENSE`](./UNLICENSE) — The Unlicense terms (pulic domain) for the SCSS files. + +## Pandoc v1 Styles + + - [`/pandoc_v1/`](./pandoc_v1/) + +In the “[`/pandoc_v1/`](./pandoc_v1/)” you’ll’ find the equivalent files for pandoc v1 — version 2 introduced some changes in syntax highlighting HTML tags and built-in styles’ CSS, so the old files are kept for projects that still require pandoc `v1.x`. + +From [pandoc v2.0 release notes](https://github.com/jgm/pandoc/releases/tag/2.0): + +> The way highlighted code blocks are formatted in HTML has been changed (David Baynard), in ways that may require changes in hard-coded CSS affecting highlighting. (If you haven’t included hard-coded highlighting CSS in your template, you needn’t change anything.) + +Most notably, line-numbered code dosen’t use HTML tables anymore. + +# Introduction + +Sass (syntactically awesome stylesheets) is a great tool for creating CSS stylesheets: + + - + +Especially so if you’re planning to create a stylesheet that applies different color themes for each language — then Sass will save you time and let you work with smaller and less entangled source files. + +Here you’ll find some ready-made SCSS templates and modules to style pandoc syntax highlighting. diff --git a/skylighting-css/sass-templates/build-n-watch.bat b/skylighting-css/sass-templates/build-n-watch.bat index 7d5e328..8885698 100644 --- a/skylighting-css/sass-templates/build-n-watch.bat +++ b/skylighting-css/sass-templates/build-n-watch.bat @@ -1,8 +1,8 @@ -CALL SCSS --update --force ./:./ --sourcemap=none --style=expanded -CALL SCSS --watch ./:./ --sourcemap=none --style=expanded - -:: NOTE: Possible styles: -:: - nested (default) -:: - compact -:: - compressed +CALL SCSS --update --force ./:./ --sourcemap=none --style=expanded +CALL SCSS --watch ./:./ --sourcemap=none --style=expanded + +:: NOTE: Possible styles: +:: - nested (default) +:: - compact +:: - compressed :: - expanded \ No newline at end of file diff --git a/templates/html5/github/GitHub-Template-Preview.html b/templates/html5/github/GitHub-Template-Preview.html index bed9b35..bfbf244 100644 --- a/templates/html5/github/GitHub-Template-Preview.html +++ b/templates/html5/github/GitHub-Template-Preview.html @@ -1,301 +1,301 @@ - - - - - - - - - - GitHub Pandoc HTML5 Template — Preview - - - - - - -
      -
      -

      GitHub Pandoc HTML5 Template

      -
      - -
      -

      This is a preview of “GitHub Pandoc HTML5 Templatev1.1, © Tristano Ajmone 2017, MIT License (MIT).

      -

      CSS Styling: This template supports styling for all the standard markdown elements, some GitHub flavored markdown elements (task lists, etc.), and some of GitHub’s advanced CSS styling (alerts) via the custom pp macros of the Pandoc-Goodies project.

      -

      Template Variables: This template supports all the standard pandoc template variables, but also allows overriding them with some custom variables. The template was adapted from the default html5 template that shipped with pandoc v1.19.2.1.

      -

      Standard Typography

      -

      Lorem markdownum stagna de spatiantes mirabatur arboribus at nunc, somnus sanguine quosque genusque addenda socia.1 Plus ipsisque latent, genus, medio aut rima haberet.

      -

      Quem palluerat, vulgaris pignora: Crtl+Z.2

      -
      -

      Et vult Ulixe nec mater moras veluti spatio omnia sub quemque ripas ubi. Nil non, sub nec, ubi ferant deus pacis Turni, parentum.

      -
      -

      Ut nobis Ampycides esset indigenae eiecit domini successibus Aiaci tecta nunc terris, Argolica videres est neque. Aeacides caloris, magna canes.3

      -
      -
      -
        -
      1. Nec et tormenta tacitae decet aethere
      2. -
      3. Nullamque corpus -
          -
        1. Sic nunc naides dubiis
        2. -
        3. Virgo forti ardent
        4. -
        5. Dic pro captantur exitus quo viris infera
        6. -
      4. -
      5. Adit Symplegadas inque
      6. -
      -
        -
      • Dic pro captantur exitus quo viris infera
      • -
      • Humanam tenderet -
          -
        • Est esset devoveas
        • -
        • Adit Symplegadas inque
        • -
      • -
      • Lelex ad ira
      • -
      • Inpositus cum genus extulit nec inseris ille
      • -
      -

      -h1 -

      -

      -h2 -

      -

      -h3 -

      -

      -h4 -

      -
      -h5 -
      -
      -h6 -
      -
      #! python
      -
      -# Fibonacci series
      -a, b = 0, 1
      -while b < 200:
      -       print b,
      -       a, b = b, a+b
      -

      Definition lists

      -
      -
      Term 1
      -

      Definition 1

      -
      -
      Term 2 with inline markup
      -

      Definition 2

      -

      Hora sequantur nimium exiguis et in fit coniuge aures, adfuit.

      -

      Ut sentesflumen, mea ira, et ubi manus silicem.

      -
      -
      - - - - - - - - - - - - - - - - - - - - -
      Header 1Header 2Header 3
      CellCellCell
      CellCellCell
      -

      Pandoc Markdown

      -

      Line blocks

      -
      The limerick packs laughs anatomical -In space that is quite economical. -   But the good ones I’ve seen -   So seldom are clean -And the clean ones so seldom are comical
      -

      GFM Features

      -

      Inline text elements

      -You can use the mark tag to highlight text. -

      -

      This line of text is meant to be treated as deleted text.

      -

      Keystroke can be rendered with <key> tag: Shift+U

      -

      Task Lists

      -

      GFM Task Lists can be used within pandoc markdown documents through our custom pp macros. Example:

      -
      !TaskList(
      -!Task[x][I'm a _checked_ task]
      -!Task[ ][I'm an _unchecked_ task]
      -)
      -

      … will produce:

      -
        -
      • -I’m a checked task -
      • -
      • -I’m an unchecked task -
      • -
      -

      GitHub Extended CSS Features

      -

      Alerts

      -

      Alerts (aka flash messages) are part of GitHub’s Primer CSS, and they are available in documents previews:

      - -

      These are the different type of alerts available, along with the custom pp-macros to generate them inside markdown source:

      -
      -
      -

      Default alert — Created with the !GFMAlert(TEXT) pp macro.

      -
      -
      -
      -
      -

      Warning alert — Created with the !GFMWarn(TEXT) pp macro.

      -
      -
      -
      -
      -

      Error alert — Created with the !GFMError(TEXT) pp macro.

      -
      -
      -
      -
      -

      Success alert — Created with the !GFMSuccess(TEXT) pp macro.

      -
      -
      -
      -
      -

      Plain alert — Created with the !GFMAlertPlain(TEXT) pp macro.

      -

      This alert is not part of the original set of GitHub Alerts, it’s a custom addition.

      -
      -
      -

      The macro’s parameter will be treated as markdown content if pandoc’s markdown_in_html_blocks extension is enabled (default in pandoc markdown):

      -
      !GFMAlert(
      -This alert contains __markdown__ formatting and _spans_ over <mark>multiple paragraphs</mark>.
      -
      -Any `markdown` element and block can be placed inside the alert:
      -
      -- List item
      -- List item
      -- List item
      -)
      -
      -
      -

      This alert contains markdown formatting and spans over multiple paragraphs.

      -

      Any markdown element and block can be placed inside the alert:

      -
        -
      • List item
      • -
      • List item
      • -
      • List item
      • -
      -
      -
      -

      Extra Template Variables

      -

      Beside supporting all the standard pandoc variables (pandoc 1.19.2.1), some extra variables were added to the template to allow finer customization.

      -

      The variables title, author and date all have a counterpart with the docmeta- prefix added to their name (ie: docmeta-title, docmeta-author and docmeta-date). These alternative variables are intended to be used in the <meta> elements of the <head> section in the html source. If an alternative docmeta- variable is found, it will be used instead of its default conterpart to fill the metadata; if not, the default (unprefixed) variable will be employed as usual.

      -

      This can be exploited to produce a different text in the <title> tag and the actual document’s title, or to display authors names only in the source <meta> elements but not in the actual document (ie: by setting only the docmeta- variable).

      -

      For an example of their usage, see the preview.yaml file in the src folder, and examine the template source code.

      -

      The use of the alternative variables is completely optional, and by ignoring them the template will follow the conventional variables system of the default pandoc templates.

      - - - - - - - - - - - - - - - - - - - - - -
      default varalternative var
      titledocmeta-title
      authordocmeta-author
      datedocmeta-date
      -
      -
      -
        -
      1. Nec opus caecoque frondibus fervet.

      2. -
      3. Hora sequantur nimium exiguis et in fit coniuge aures, adfuit.

      4. -
      5. Turni, parentum. Ut nobis Ampycides esset indigenae eiecit domini successibus Aiaci tecta nunc terris, Argolica videres est neque. Aeacides caloris, magna canes.

      6. -
      -
      -
      - - + + + + + + + + + + GitHub Pandoc HTML5 Template — Preview + + + + + + +
      +
      +

      GitHub Pandoc HTML5 Template

      +
      + +
      +

      This is a preview of “GitHub Pandoc HTML5 Templatev1.1, © Tristano Ajmone 2017, MIT License (MIT).

      +

      CSS Styling: This template supports styling for all the standard markdown elements, some GitHub flavored markdown elements (task lists, etc.), and some of GitHub’s advanced CSS styling (alerts) via the custom pp macros of the Pandoc-Goodies project.

      +

      Template Variables: This template supports all the standard pandoc template variables, but also allows overriding them with some custom variables. The template was adapted from the default html5 template that shipped with pandoc v1.19.2.1.

      +

      Standard Typography

      +

      Lorem markdownum stagna de spatiantes mirabatur arboribus at nunc, somnus sanguine quosque genusque addenda socia.1 Plus ipsisque latent, genus, medio aut rima haberet.

      +

      Quem palluerat, vulgaris pignora: Crtl+Z.2

      +
      +

      Et vult Ulixe nec mater moras veluti spatio omnia sub quemque ripas ubi. Nil non, sub nec, ubi ferant deus pacis Turni, parentum.

      +
      +

      Ut nobis Ampycides esset indigenae eiecit domini successibus Aiaci tecta nunc terris, Argolica videres est neque. Aeacides caloris, magna canes.3

      +
      +
      +
        +
      1. Nec et tormenta tacitae decet aethere
      2. +
      3. Nullamque corpus +
          +
        1. Sic nunc naides dubiis
        2. +
        3. Virgo forti ardent
        4. +
        5. Dic pro captantur exitus quo viris infera
        6. +
      4. +
      5. Adit Symplegadas inque
      6. +
      +
        +
      • Dic pro captantur exitus quo viris infera
      • +
      • Humanam tenderet +
          +
        • Est esset devoveas
        • +
        • Adit Symplegadas inque
        • +
      • +
      • Lelex ad ira
      • +
      • Inpositus cum genus extulit nec inseris ille
      • +
      +

      +h1 +

      +

      +h2 +

      +

      +h3 +

      +

      +h4 +

      +
      +h5 +
      +
      +h6 +
      +
      #! python
      +
      +# Fibonacci series
      +a, b = 0, 1
      +while b < 200:
      +       print b,
      +       a, b = b, a+b
      +

      Definition lists

      +
      +
      Term 1
      +

      Definition 1

      +
      +
      Term 2 with inline markup
      +

      Definition 2

      +

      Hora sequantur nimium exiguis et in fit coniuge aures, adfuit.

      +

      Ut sentesflumen, mea ira, et ubi manus silicem.

      +
      +
      + + + + + + + + + + + + + + + + + + + + +
      Header 1Header 2Header 3
      CellCellCell
      CellCellCell
      +

      Pandoc Markdown

      +

      Line blocks

      +
      The limerick packs laughs anatomical +In space that is quite economical. +   But the good ones I’ve seen +   So seldom are clean +And the clean ones so seldom are comical
      +

      GFM Features

      +

      Inline text elements

      +You can use the mark tag to highlight text. +

      +

      This line of text is meant to be treated as deleted text.

      +

      Keystroke can be rendered with <key> tag: Shift+U

      +

      Task Lists

      +

      GFM Task Lists can be used within pandoc markdown documents through our custom pp macros. Example:

      +
      !TaskList(
      +!Task[x][I'm a _checked_ task]
      +!Task[ ][I'm an _unchecked_ task]
      +)
      +

      … will produce:

      +
        +
      • +I’m a checked task +
      • +
      • +I’m an unchecked task +
      • +
      +

      GitHub Extended CSS Features

      +

      Alerts

      +

      Alerts (aka flash messages) are part of GitHub’s Primer CSS, and they are available in documents previews:

      + +

      These are the different type of alerts available, along with the custom pp-macros to generate them inside markdown source:

      +
      +
      +

      Default alert — Created with the !GFMAlert(TEXT) pp macro.

      +
      +
      +
      +
      +

      Warning alert — Created with the !GFMWarn(TEXT) pp macro.

      +
      +
      +
      +
      +

      Error alert — Created with the !GFMError(TEXT) pp macro.

      +
      +
      +
      +
      +

      Success alert — Created with the !GFMSuccess(TEXT) pp macro.

      +
      +
      +
      +
      +

      Plain alert — Created with the !GFMAlertPlain(TEXT) pp macro.

      +

      This alert is not part of the original set of GitHub Alerts, it’s a custom addition.

      +
      +
      +

      The macro’s parameter will be treated as markdown content if pandoc’s markdown_in_html_blocks extension is enabled (default in pandoc markdown):

      +
      !GFMAlert(
      +This alert contains __markdown__ formatting and _spans_ over <mark>multiple paragraphs</mark>.
      +
      +Any `markdown` element and block can be placed inside the alert:
      +
      +- List item
      +- List item
      +- List item
      +)
      +
      +
      +

      This alert contains markdown formatting and spans over multiple paragraphs.

      +

      Any markdown element and block can be placed inside the alert:

      +
        +
      • List item
      • +
      • List item
      • +
      • List item
      • +
      +
      +
      +

      Extra Template Variables

      +

      Beside supporting all the standard pandoc variables (pandoc 1.19.2.1), some extra variables were added to the template to allow finer customization.

      +

      The variables title, author and date all have a counterpart with the docmeta- prefix added to their name (ie: docmeta-title, docmeta-author and docmeta-date). These alternative variables are intended to be used in the <meta> elements of the <head> section in the html source. If an alternative docmeta- variable is found, it will be used instead of its default conterpart to fill the metadata; if not, the default (unprefixed) variable will be employed as usual.

      +

      This can be exploited to produce a different text in the <title> tag and the actual document’s title, or to display authors names only in the source <meta> elements but not in the actual document (ie: by setting only the docmeta- variable).

      +

      For an example of their usage, see the preview.yaml file in the src folder, and examine the template source code.

      +

      The use of the alternative variables is completely optional, and by ignoring them the template will follow the conventional variables system of the default pandoc templates.

      + + + + + + + + + + + + + + + + + + + + + +
      default varalternative var
      titledocmeta-title
      authordocmeta-author
      datedocmeta-date
      +
      +
      +
        +
      1. Nec opus caecoque frondibus fervet.

      2. +
      3. Hora sequantur nimium exiguis et in fit coniuge aures, adfuit.

      4. +
      5. Turni, parentum. Ut nobis Ampycides esset indigenae eiecit domini successibus Aiaci tecta nunc terris, Argolica videres est neque. Aeacides caloris, magna canes.

      6. +
      +
      +
      + + diff --git a/templates/html5/github/GitHub.html5 b/templates/html5/github/GitHub.html5 index db2535e..a5496c4 100644 --- a/templates/html5/github/GitHub.html5 +++ b/templates/html5/github/GitHub.html5 @@ -1,95 +1,95 @@ - - - - - - - -$if(docmeta-author)$ -$for(docmeta-author)$ - -$endfor$ -$else$ -$for(author-meta)$ - -$endfor$ -$endif$ -$if(docmeta-date)$ - -$else$ -$if(date-meta)$ - -$endif$ -$endif$ -$if(keywords)$ - -$endif$ - $if(docmeta-title)$$docmeta-title$$else$$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$$endif$ - - -$if(quotes)$ - -$endif$ -$if(highlighting-css)$ - -$endif$ -$for(css)$ - -$endfor$ -$if(math)$ - $math$ -$endif$ - -$for(header-includes)$ - $header-includes$ -$endfor$ - - -
      -$for(include-before)$ -$include-before$ -$endfor$ -$if(title)$ -
      -

      $title$

      -$if(subtitle)$ -

      $subtitle$

      -$endif$ -$for(author)$ -

      $author$

      -$endfor$ -$if(date)$ -

      $date$

      -$endif$ -
      -$endif$ -$if(toc)$ - -$endif$ -$body$ -$for(include-after)$ -$include-after$ -$endfor$ -
      - - + + + + + + + +$if(docmeta-author)$ +$for(docmeta-author)$ + +$endfor$ +$else$ +$for(author-meta)$ + +$endfor$ +$endif$ +$if(docmeta-date)$ + +$else$ +$if(date-meta)$ + +$endif$ +$endif$ +$if(keywords)$ + +$endif$ + $if(docmeta-title)$$docmeta-title$$else$$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$$endif$ + + +$if(quotes)$ + +$endif$ +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ + +$for(header-includes)$ + $header-includes$ +$endfor$ + + +
      +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
      +

      $title$

      +$if(subtitle)$ +

      $subtitle$

      +$endif$ +$for(author)$ +

      $author$

      +$endfor$ +$if(date)$ +

      $date$

      +$endif$ +
      +$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ +
      + + diff --git a/templates/html5/github/INSTALL.bat b/templates/html5/github/INSTALL.bat index 96b80d9..7e37eeb 100644 --- a/templates/html5/github/INSTALL.bat +++ b/templates/html5/github/INSTALL.bat @@ -1,26 +1,26 @@ -:: "INSTALL.bat" v1.0 (2017-04-13) by Tristano Ajmone. -@ECHO OFF -ECHO. -ECHO ============================================================================== -ECHO Install GitHub Pandoc HTML5 Template -ECHO ============================================================================== -SET "_DEST=%APPDATA%\Pandoc\templates\" -ECHO This script will copy "GitHub.html5" to pandoc's default templates folder for -ECHO the current user, so that it will be always available to pandoc: -ECHO. -ECHO %_DEST% -ECHO. -ECHO Any previous version of the file will be overwritten without confirmation. -ECHO. -:: Ask for confirmation. Defaults to NO after 20 sec timeout (time to read text). -CHOICE /C NY /D N /T 20 /M "Do you wish to install the template" -IF ERRORLEVEL 2 GOTO :DO_INSTALL -ECHO. -ECHO Installation aborted... -EXIT /B - -:DO_INSTALL -ECHO. -:: NOTE: XCOPY will create the "templates" subfolder if not present. -XCOPY /Y %~dp0GitHub.html5 %_DEST% +:: "INSTALL.bat" v1.0 (2017-04-13) by Tristano Ajmone. +@ECHO OFF +ECHO. +ECHO ============================================================================== +ECHO Install GitHub Pandoc HTML5 Template +ECHO ============================================================================== +SET "_DEST=%APPDATA%\Pandoc\templates\" +ECHO This script will copy "GitHub.html5" to pandoc's default templates folder for +ECHO the current user, so that it will be always available to pandoc: +ECHO. +ECHO %_DEST% +ECHO. +ECHO Any previous version of the file will be overwritten without confirmation. +ECHO. +:: Ask for confirmation. Defaults to NO after 20 sec timeout (time to read text). +CHOICE /C NY /D N /T 20 /M "Do you wish to install the template" +IF ERRORLEVEL 2 GOTO :DO_INSTALL +ECHO. +ECHO Installation aborted... +EXIT /B + +:DO_INSTALL +ECHO. +:: NOTE: XCOPY will create the "templates" subfolder if not present. +XCOPY /Y %~dp0GitHub.html5 %_DEST% EXIT /B \ No newline at end of file diff --git a/templates/html5/github/README.md b/templates/html5/github/README.md index 6b4b751..e4e132b 100644 --- a/templates/html5/github/README.md +++ b/templates/html5/github/README.md @@ -1,101 +1,101 @@ -# GitHub Pandoc HTML5 Template - - pandoc v1.19.2 - -A pandoc html5 template mimicking GitHub’s documents preview. Supports extended GitHub Flavored Markdown features through custom pp-macros that leverage Raw HTML and GitHub’s CSS. - - - [Live GitHub HTML Preview](http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/templates/html5/github/GitHub-Template-Preview.html) - ------ - -**Table of Contents** - - - - - [Features](#features) - - [License](#license) - - [Credits](#credits) - - [GitHub Markdown CSS](#github-markdown-css) - - [Primer CSS](#primer-css) - - [Changelog](#changelog) - - - ------ - -# Features - -This html5 pandoc template will format your documents using GitHub’s stylesheets. Beside covering the standard markdown elements, this template also supports some of GitHub’s extra HTML styling: - - - [Inline highlighter](http://primercss.io/type/#inline-text-elements) via `` tag - - Keystrokes via `` tag (eg: Ctrl+Z) - - [Task lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists) - - [Alerts](http://primercss.io/alerts/) (aka Flash messages) - -These elements can be integrated in pandoc source documents via our custom pp-macros for generating Raw HTML elements. For example, you can now use GFM Task Lists in your pandoc documents via the following pp-macros: - - !TaskList( - !Task[x][I'm a _checked_ task] - !Task[ ][I'm an _unchecked_ task] - ) - -… which will be preprocessed to Raw HTML: - -``` html -
        -
      • -I’m a checked task -
      • -
      • -I’m an unchecked task -
      • -
      -``` - -… and will render in previews as: - -
        -
      • -I’m a checked task -
      • -
      • -I’m an unchecked task -
      • -
      - -# License - - - [LICENSE](./LICENSE) - -**GitHub HTML5 Panodc Template** is Copyright © Tristano Ajmone, 2017, released under [The MIT License](./LICENSE) (MIT). - -# Credits - -This template is build on top of [Sindre Sorhus](https://github.com/sindresorhus)’ **GitHub Markdown CSS**, plus some CSS modules taken from [GitHub](https://github.com) Incorporation’s **Primer CSS**: - - - [GitHub Markdown CSS](https://sindresorhus.com/github-markdown-css) - - [Primer-CSS](http://primercss.io/) - -## GitHub Markdown CSS - -**GitHub Markdown CSS** is Copyright © Sindre Sorhus, released under [The MIT License](https://github.com/sindresorhus/github-markdown-css/blob/gh-pages/readme.md) (MIT). - -These template files are derivatives from **GitHub Markdown CSS**: - - - [`src/github-markdown.css`](./src/github-markdown.css) (adapted from [`github-markdown.css`](https://github.com/sindresorhus/github-markdown-css/blob/gh-pages/github-markdown.css)) - - [`src/markdown-body.css`](./src/markdown-body.css) (taken from [`readme.md`](https://github.com/sindresorhus/github-markdown-css/blob/gh-pages/readme.md)) - -## Primer CSS - -**Primer CSS** is Copyright © 2016 GitHub Inc., released under [The MIT License](https://github.com/primer/primer-css/blob/master/LICENSE) (MIT). - -These template files are derivatives from the **Primer CSS** project’s modules: - - - [`src/alerts.css`](./src/alerts.css) (taken from [`flash.scss`](https://github.com/primer/primer-alerts/blob/master/lib/flash.scss)) - -# Changelog - - - **v1.1** (2017-04-10) - - Added new custom Alert class “`flash-plain`” with greyish colors. (pp-macro: `!GFMAlertPlain()`). - - **v1.0** (2017-04-09) - - First release. +# GitHub Pandoc HTML5 Template + + pandoc v1.19.2 + +A pandoc html5 template mimicking GitHub’s documents preview. Supports extended GitHub Flavored Markdown features through custom pp-macros that leverage Raw HTML and GitHub’s CSS. + + - [Live GitHub HTML Preview](http://htmlpreview.github.io/?https://github.com/tajmone/pandoc-goodies/blob/master/templates/html5/github/GitHub-Template-Preview.html) + +----- + +**Table of Contents** + + + + - [Features](#features) + - [License](#license) + - [Credits](#credits) + - [GitHub Markdown CSS](#github-markdown-css) + - [Primer CSS](#primer-css) + - [Changelog](#changelog) + + + +----- + +# Features + +This html5 pandoc template will format your documents using GitHub’s stylesheets. Beside covering the standard markdown elements, this template also supports some of GitHub’s extra HTML styling: + + - [Inline highlighter](http://primercss.io/type/#inline-text-elements) via `` tag + - Keystrokes via `` tag (eg: Ctrl+Z) + - [Task lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists) + - [Alerts](http://primercss.io/alerts/) (aka Flash messages) + +These elements can be integrated in pandoc source documents via our custom pp-macros for generating Raw HTML elements. For example, you can now use GFM Task Lists in your pandoc documents via the following pp-macros: + + !TaskList( + !Task[x][I'm a _checked_ task] + !Task[ ][I'm an _unchecked_ task] + ) + +… which will be preprocessed to Raw HTML: + +``` html +
        +
      • +I’m a checked task +
      • +
      • +I’m an unchecked task +
      • +
      +``` + +… and will render in previews as: + +
        +
      • +I’m a checked task +
      • +
      • +I’m an unchecked task +
      • +
      + +# License + + - [LICENSE](./LICENSE) + +**GitHub HTML5 Panodc Template** is Copyright © Tristano Ajmone, 2017, released under [The MIT License](./LICENSE) (MIT). + +# Credits + +This template is build on top of [Sindre Sorhus](https://github.com/sindresorhus)’ **GitHub Markdown CSS**, plus some CSS modules taken from [GitHub](https://github.com) Incorporation’s **Primer CSS**: + + - [GitHub Markdown CSS](https://sindresorhus.com/github-markdown-css) + - [Primer-CSS](http://primercss.io/) + +## GitHub Markdown CSS + +**GitHub Markdown CSS** is Copyright © Sindre Sorhus, released under [The MIT License](https://github.com/sindresorhus/github-markdown-css/blob/gh-pages/readme.md) (MIT). + +These template files are derivatives from **GitHub Markdown CSS**: + + - [`src/github-markdown.css`](./src/github-markdown.css) (adapted from [`github-markdown.css`](https://github.com/sindresorhus/github-markdown-css/blob/gh-pages/github-markdown.css)) + - [`src/markdown-body.css`](./src/markdown-body.css) (taken from [`readme.md`](https://github.com/sindresorhus/github-markdown-css/blob/gh-pages/readme.md)) + +## Primer CSS + +**Primer CSS** is Copyright © 2016 GitHub Inc., released under [The MIT License](https://github.com/primer/primer-css/blob/master/LICENSE) (MIT). + +These template files are derivatives from the **Primer CSS** project’s modules: + + - [`src/alerts.css`](./src/alerts.css) (taken from [`flash.scss`](https://github.com/primer/primer-alerts/blob/master/lib/flash.scss)) + +# Changelog + + - **v1.1** (2017-04-10) + - Added new custom Alert class “`flash-plain`” with greyish colors. (pp-macro: `!GFMAlertPlain()`). + - **v1.0** (2017-04-09) + - First release. diff --git a/templates/html5/github/src/BUILD-PREVIEW.bat b/templates/html5/github/src/BUILD-PREVIEW.bat index 2001736..3b813b1 100644 --- a/templates/html5/github/src/BUILD-PREVIEW.bat +++ b/templates/html5/github/src/BUILD-PREVIEW.bat @@ -1,66 +1,66 @@ -:: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -:: GitHub HTML5 Pandoc Template Preview builder v1.1 (2017-04-09) -:: (c) Tristano Ajmone, 2017. MIT License (MIT). -:: https://github.com/tajmone/pandoc-goodies -:: ////////////////////////////////////////////////////////////////////////////// -:: -:: SCRIPT REQUIREMENTS: -:: -- pandoc must be available on the system %PATH%: -:: http://pandoc.org -:: -- pp v. >= 1.4 must be available on the system %PATH%: -:: http://cdsoft.fr/pp/ -:: ------------------------------------------------------------------------------ -@ECHO OFF -ECHO. -ECHO ============================================================================== -ECHO Building GitHub html5 template preview... -ECHO ============================================================================== -:: ============================================================================== -:: CHECK SYSTEM REQUIREMENTS -:: ============================================================================== -:: Before starting to build, check that all required tools are available: -:: ------------------------------------------------------------------------------ -ECHO 1) Checking that system requirement are met. -CALL pandoc -v >nul 2>&1 -IF ERRORLEVEL 1 ( - ECHO ERROR! In order to execute this script, pandoc must be on the system %%PATH%%: - ECHO. - ECHO http://pandoc.org - EXIT /B -) -CALL pp -v >nul 2>&1 -IF ERRORLEVEL 1 ( - ECHO ERROR! In order to execute this script, pp must be on the system %%PATH%%: - ECHO. - ECHO http://cdsoft.fr/pp/ - EXIT /B -) -:: ============================================================================== -:: BUILD TEMPLATE PREVIEW -:: ============================================================================== -:: Initialize pp-macros environment variable %PP_MACROS_PATH%. -:: ------------------------------------------------------------------------------ -ECHO 2) Initalizing pp-macros environment. -:: ------------------------------------------------------------------------------ -:: Invoke pp on markdown source and pipe its output to pandoc. -:: ------------------------------------------------------------------------------ -CALL ..\..\..\..\pp\macros\INIT-ENV.bat -ECHO 3) Invoking pp preprocessor and piping output to pandoc. -pp -import %PP_MACROS_PATH%macros.pp ^ - PREVIEW.yaml ^ - PREVIEW.md ^ - | pandoc -f markdown ^ - -t html5 ^ - --standalone ^ - --template=..\GitHub.html5 ^ - --toc ^ - --smart ^ - --normalize ^ - -o ..\GitHub-Template-Preview.html -:: ------------------------------------------------------------------------------ -EXIT /B - -:: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -:: CHANGELOG -:: ////////////////////////////////////////////////////////////////////////////// +:: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ +:: GitHub HTML5 Pandoc Template Preview builder v1.1 (2017-04-09) +:: (c) Tristano Ajmone, 2017. MIT License (MIT). +:: https://github.com/tajmone/pandoc-goodies +:: ////////////////////////////////////////////////////////////////////////////// +:: +:: SCRIPT REQUIREMENTS: +:: -- pandoc must be available on the system %PATH%: +:: http://pandoc.org +:: -- pp v. >= 1.4 must be available on the system %PATH%: +:: http://cdsoft.fr/pp/ +:: ------------------------------------------------------------------------------ +@ECHO OFF +ECHO. +ECHO ============================================================================== +ECHO Building GitHub html5 template preview... +ECHO ============================================================================== +:: ============================================================================== +:: CHECK SYSTEM REQUIREMENTS +:: ============================================================================== +:: Before starting to build, check that all required tools are available: +:: ------------------------------------------------------------------------------ +ECHO 1) Checking that system requirement are met. +CALL pandoc -v >nul 2>&1 +IF ERRORLEVEL 1 ( + ECHO ERROR! In order to execute this script, pandoc must be on the system %%PATH%%: + ECHO. + ECHO http://pandoc.org + EXIT /B +) +CALL pp -v >nul 2>&1 +IF ERRORLEVEL 1 ( + ECHO ERROR! In order to execute this script, pp must be on the system %%PATH%%: + ECHO. + ECHO http://cdsoft.fr/pp/ + EXIT /B +) +:: ============================================================================== +:: BUILD TEMPLATE PREVIEW +:: ============================================================================== +:: Initialize pp-macros environment variable %PP_MACROS_PATH%. +:: ------------------------------------------------------------------------------ +ECHO 2) Initalizing pp-macros environment. +:: ------------------------------------------------------------------------------ +:: Invoke pp on markdown source and pipe its output to pandoc. +:: ------------------------------------------------------------------------------ +CALL ..\..\..\..\pp\macros\INIT-ENV.bat +ECHO 3) Invoking pp preprocessor and piping output to pandoc. +pp -import %PP_MACROS_PATH%macros.pp ^ + PREVIEW.yaml ^ + PREVIEW.md ^ + | pandoc -f markdown ^ + -t html5 ^ + --standalone ^ + --template=..\GitHub.html5 ^ + --toc ^ + --smart ^ + --normalize ^ + -o ..\GitHub-Template-Preview.html +:: ------------------------------------------------------------------------------ +EXIT /B + +:: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ +:: CHANGELOG +:: ////////////////////////////////////////////////////////////////////////////// :: v1.0 (2017-04-08) -- First release. \ No newline at end of file diff --git a/templates/html5/github/src/BUILD-TEMPLATE.bat b/templates/html5/github/src/BUILD-TEMPLATE.bat index 002ab53..4991238 100644 --- a/templates/html5/github/src/BUILD-TEMPLATE.bat +++ b/templates/html5/github/src/BUILD-TEMPLATE.bat @@ -1,58 +1,58 @@ -:: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -:: GitHub HTML5 Pandoc Template builder v1.0 (2017-04-08) -:: (c) Tristano Ajmone, 2017. MIT License (MIT). -:: https://github.com/tajmone/pandoc-goodies -:: ////////////////////////////////////////////////////////////////////////////// -:: -:: SCRIPT REQUIREMENTS: -:: -- clean-css-cli v. >= 4.0 (Node.js), installed locally or globally): -:: https://www.npmjs.com/package/clean-css-cli -:: https://github.com/jakubpawlowicz/clean-css-cli -:: ------------------------------------------------------------------------------ -@ECHO OFF -ECHO. -ECHO ============================================================================== -ECHO Building GitHub html5 pandoc template... -ECHO ============================================================================== -:: ============================================================================== -:: CHECK SYSTEM REQUIREMENTS -:: ============================================================================== -:: Before starting to build, check that all required tools are available: -:: ------------------------------------------------------------------------------ -ECHO 1) Checking that system requirement are met. -CALL cleancss -v >nul 2>&1 -IF ERRORLEVEL 1 ( - ECHO ERROR! In order to execute this script, you must install clean-css-cli: - ECHO. - ECHO https://www.npmjs.com/package/clean-css-cli - EXIT /B -) -:: ============================================================================== -:: BUILD MINIFIED CSS -:: ============================================================================== -:: Build a minified and optimized CSS files from multiple sources. -:: ------------------------------------------------------------------------------ -ECHO 2) Merging CSS source files into single minified CSS. -CALL cleancss -O2 ^ - github-markdown.css ^ - markdown-body.css ^ - alerts.css ^ - -o GitHub-Template_B.css -:: ============================================================================== -:: BUILD HTML5 TEMPLATE -:: ============================================================================== -:: The final template is created by concatenating together three source files. -:: Splitting the html template file into two halves after the inline CSS opening -:: tag was the easiest solution (instead of using in-file replacement tools). -:: ------------------------------------------------------------------------------ -ECHO 3) Concatenating template source files. -TYPE GitHub-Template_A.html5 > ..\GitHub.html5 -TYPE GitHub-Template_B.css >> ..\GitHub.html5 -TYPE GitHub-Template_C.html5 >> ..\GitHub.html5 -:: ------------------------------------------------------------------------------ -EXIT /B - -:: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -:: CHANGELOG -:: ////////////////////////////////////////////////////////////////////////////// +:: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ +:: GitHub HTML5 Pandoc Template builder v1.0 (2017-04-08) +:: (c) Tristano Ajmone, 2017. MIT License (MIT). +:: https://github.com/tajmone/pandoc-goodies +:: ////////////////////////////////////////////////////////////////////////////// +:: +:: SCRIPT REQUIREMENTS: +:: -- clean-css-cli v. >= 4.0 (Node.js), installed locally or globally): +:: https://www.npmjs.com/package/clean-css-cli +:: https://github.com/jakubpawlowicz/clean-css-cli +:: ------------------------------------------------------------------------------ +@ECHO OFF +ECHO. +ECHO ============================================================================== +ECHO Building GitHub html5 pandoc template... +ECHO ============================================================================== +:: ============================================================================== +:: CHECK SYSTEM REQUIREMENTS +:: ============================================================================== +:: Before starting to build, check that all required tools are available: +:: ------------------------------------------------------------------------------ +ECHO 1) Checking that system requirement are met. +CALL cleancss -v >nul 2>&1 +IF ERRORLEVEL 1 ( + ECHO ERROR! In order to execute this script, you must install clean-css-cli: + ECHO. + ECHO https://www.npmjs.com/package/clean-css-cli + EXIT /B +) +:: ============================================================================== +:: BUILD MINIFIED CSS +:: ============================================================================== +:: Build a minified and optimized CSS files from multiple sources. +:: ------------------------------------------------------------------------------ +ECHO 2) Merging CSS source files into single minified CSS. +CALL cleancss -O2 ^ + github-markdown.css ^ + markdown-body.css ^ + alerts.css ^ + -o GitHub-Template_B.css +:: ============================================================================== +:: BUILD HTML5 TEMPLATE +:: ============================================================================== +:: The final template is created by concatenating together three source files. +:: Splitting the html template file into two halves after the inline CSS opening +:: tag was the easiest solution (instead of using in-file replacement tools). +:: ------------------------------------------------------------------------------ +ECHO 3) Concatenating template source files. +TYPE GitHub-Template_A.html5 > ..\GitHub.html5 +TYPE GitHub-Template_B.css >> ..\GitHub.html5 +TYPE GitHub-Template_C.html5 >> ..\GitHub.html5 +:: ------------------------------------------------------------------------------ +EXIT /B + +:: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ +:: CHANGELOG +:: ////////////////////////////////////////////////////////////////////////////// :: v1.0 (2017-04-08) -- First release. \ No newline at end of file diff --git a/templates/html5/github/src/BUILD.bat b/templates/html5/github/src/BUILD.bat index 1e133fd..6d1322a 100644 --- a/templates/html5/github/src/BUILD.bat +++ b/templates/html5/github/src/BUILD.bat @@ -1,3 +1,3 @@ -@ECHO OFF -CALL BUILD-TEMPLATE.bat -CALL BUILD-PREVIEW.bat +@ECHO OFF +CALL BUILD-TEMPLATE.bat +CALL BUILD-PREVIEW.bat diff --git a/templates/html5/github/src/GitHub-Template_A.html5 b/templates/html5/github/src/GitHub-Template_A.html5 index 2e22f4f..523518d 100644 --- a/templates/html5/github/src/GitHub-Template_A.html5 +++ b/templates/html5/github/src/GitHub-Template_A.html5 @@ -1,42 +1,42 @@ - - - - - - - -$if(docmeta-author)$ -$for(docmeta-author)$ - -$endfor$ -$else$ -$for(author-meta)$ - -$endfor$ -$endif$ -$if(docmeta-date)$ - -$else$ -$if(date-meta)$ - -$endif$ -$endif$ -$if(keywords)$ - -$endif$ - $if(docmeta-title)$$docmeta-title$$else$$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$$endif$ - - -$if(quotes)$ - -$endif$ -$if(highlighting-css)$ - -$endif$ -$for(css)$ - -$endfor$ -$if(math)$ - $math$ -$endif$ - -$for(header-includes)$ - $header-includes$ -$endfor$ - - -
      -$for(include-before)$ -$include-before$ -$endfor$ -$if(title)$ -
      -

      $title$

      -$if(subtitle)$ -

      $subtitle$

      -$endif$ -$for(author)$ -

      $author$

      -$endfor$ -$if(date)$ -

      $date$

      -$endif$ -
      -$endif$ -$if(toc)$ - -$endif$ -$body$ -$for(include-after)$ -$include-after$ -$endfor$ -
      - - + + +$if(quotes)$ + +$endif$ +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ + +$for(header-includes)$ + $header-includes$ +$endfor$ + + +
      +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
      +

      $title$

      +$if(subtitle)$ +

      $subtitle$

      +$endif$ +$for(author)$ +

      $author$

      +$endfor$ +$if(date)$ +

      $date$

      +$endif$ +
      +$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ +
      + + diff --git a/templates/html5/github/src/markdown-body.css b/templates/html5/github/src/markdown-body.css index 4b75677..00719d8 100644 --- a/templates/html5/github/src/markdown-body.css +++ b/templates/html5/github/src/markdown-body.css @@ -1,16 +1,16 @@ -/* ============================================================================== - GitHub Markdown by sindresorhus - ============================================================================== - This file was adapted from the GitHub Markdown CSS project: - - -- https://github.com/sindresorhus/github-markdown-css/blob/b99cdc4/readme.md - - GitHub Markdown CSS (c) Sindre Sorhus. Released under The MIT License (MIT). - ============================================================================== */ -.markdown-body { - box-sizing: border-box; - min-width: 200px; - max-width: 980px; - margin: 0 auto; - padding: 45px; +/* ============================================================================== + GitHub Markdown by sindresorhus + ============================================================================== + This file was adapted from the GitHub Markdown CSS project: + + -- https://github.com/sindresorhus/github-markdown-css/blob/b99cdc4/readme.md + + GitHub Markdown CSS (c) Sindre Sorhus. Released under The MIT License (MIT). + ============================================================================== */ +.markdown-body { + box-sizing: border-box; + min-width: 200px; + max-width: 980px; + margin: 0 auto; + padding: 45px; } \ No newline at end of file