Module MarkDownToHTML 2.7.1

Tags: Markdown, HTML, Converter, StaticHTMLSites, Markdown, HTML, Converter, StaticHTMLSites

A collection of PowerShell commands to convert Markdown files to static HTML sites in various ways.

Components packaged with this module:

Component Version Description
Markdig 0.28.1 Fast Markdown processor for .NET
highlight.js 11.5.1 Code syntax highlighter
KaTeX 0.15.3 Math typesetting
Mermaid 9.0.0 Diagramming
Svgbob 0.6.6 Text based diagramming
Code Syntax Highlighting (highlight.js)

Pre-configured code syntax highlighting languages in this package:

Language Fenced Code Block Alias
Bash bash, sh, zsh
C# csharp, cs
C c, h
C++ cpp, hpp, cc, hh, c++, h++, cxx, hxx
Clojure clojure, clj
Clojure REPL clojure-repl
CMake cmake, cmake.in
CSS css
Diff diff, patch
DOS .bat dos, bat, cmd
F# fsharp, fs
Groovy groovy
Go go, golang
HTML/XML xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist, svg
HTTP http, https
Java java, jsp
JavaScript javascript, js, jsx
JSON json
Julia julia
Julia REPL julia-repl
LaTex tex
Lisp lisp
Makefile makefile, mk, mak, make
Markdown markdown, md, mkdown, mkd
Maxima maxima
Perl perl, pl, pm
Plain Text plaintext, txt, text
PowerShell powershell, ps, ps1
Python python, py, gyp
Python REPL python-repl, pycon
R r
Rust rust, rs
SQL sql
TOML, INI ini, toml
Visual Basic.net vbnet, vb
YAML yml, yaml

See also Customization for more information.

Markdown Extensions

Projects generated by New-StaticHTMLSiteProject have following Markdown extensions pre-configured:

  • common
  • definitionlists
  • mathematics
  • diagrams
  • pipetables
  • autoidentifiers

Exported Functions

Release Notes

Release notes for this and previous releases are on GitHub at: MarkdownToHtml Releases.

Upgrading Custom Templates and Static Site Projects.

Unless there is a known incompatibility (see below) or you want to take advantage of new capabilities, no action is needed.

Refer to Upgrading Custom Conversion Templates for custom template upgrade instructions and to Upgrading Static Site Projects for static site upgrades.

Known Incompatibilities

2.7.0

The fix for issue #35 introduces an issue with site_navigation configurations in Build.json build configuration files which are below the directory tree specified in the mardown_dir option of the top-level build configuration file (Build.json). The fix now handles relative links correctly. If you have gotten navigation links to work by using links which are not relative to the Build.json file they are defined in, the no longer work.

To locate these links you can use the Test-LocalSiteLinks function.

2.0.0

If you have have conversion projects which use the mathematics extensions and were created with versions of this module older than 2.0.0 (i.e. 1.* or 0.*). The version of Markdig included in this release introduces an incompatiblity with projects which use the mathematics extension.

To address this incompaibility the KaTex configuration in all deployed html templates (md_template.html) need to be updated like so:

<script>
    // <![CDATA[
    window.onload = function() {
        var tex = document.getElementsByClassName("math");
        Array.prototype.forEach.call(tex, function(el) {
            katex.render(el.textContent, el, {
                                                displayMode: (el.nodeName == "DIV"),
                                                macros: {
                                                            "\\(": "",
                                                            "\\)": "",
                                                            "\\[": "",
                                                            "\\]": ""
                                                        }
                                           })
        });
    };
    // ]]>
</script>

Module: MarkDownToHTML; Version: 2.7.1; (c) 2018-2022 WetHat Lab. All rights reserved.