1.9.1 • Public • Published


npm GitHub

MarkdownUp is a Markdown viewer.


View Local Markdown Files

To view local Markdown files, use the MarkdownUp launcher from a terminal prompt:

pip install markdown-up

Host Markdown Web Pages

To host a Markdown resource, download the MarkdownUp application stub to the directory containing your Markdown files:

curl -O

To test your Markdown page, start a local static web server:

python3 -m http.server

By default, MarkdownUp fetches the "" resource. To change the default resource, update the application stub file, index.html. For example:

    <script type="module">
        import {MarkdownUp} from '';
        const app = new MarkdownUp(window, {'url': ''});;

To view a different Markdown resource, set the application's "url" hash parameter (i.e., "").

Dynamic Markdown Applications

Using MarkdownUp's "markdown-script" fenced code blocks, you can dynamically generate Markdown, allowing you to build lightweight, client-rendered web applications with no HTML, no CSS, and a single dependency (MarkdownUp). The "markdown-script" fenced code blocks are interpreted as the CalcScript programming language. In addition to generating Markdown, you can fetch text and JSON resources, create SVG drawings, parse CSV, render data tables, draw line charts, and more. For more information, see the MarkdownUp Library.

For example:

# Dynamic Markdown Example

~~~ markdown-script
# Variable arguments
helloCount = if(vCount != null, vCount, 3)

# Constants
width = 200
height = 60
borderSize = 5

# Render the more/less menu
markdownPrint( \
    '', \
    if(helloCount <= 1, 'Less', '[Less](#var.vCount=' + (helloCount - 1) + ')') + ' | ', \
    '[More](#var.vCount=' + (helloCount + 1) + ')' \

# Render many hellos
ixHello = 0
while ixHello < helloCount do
    # Render the hello title
    helloTitle = 'Hello #' + (ixHello + 1)
    markdownPrint('', '## ' + helloTitle)

    # Render the hello drawing
    setDrawingSize(width, height)
    drawStyle('red', borderSize, 'blue')
    drawRect(0.5 * borderSize, 0.5 * borderSize, width - borderSize, height - borderSize)
    drawTextStyle(0.67 * height, 'white', true)
    drawText(helloTitle, 0.5 * width, 0.55 * height)

    ixHello = ixHello + 1

Click here to see the example in action.

The MarkdownUp Include Library

MarkdownUp provides some additional functionality that can be included at runtime. Consider the following example with the unit test include library:

include ''

function testSanity()
    unittestEquals(1 + 1, 2)


See the MarkdownUp Include Library documentation for more information on the available include libraries.

Debug Mode

Debug mode enables logging output using the debugLog function. For example:

debugLog('Hello debug')

Debug mode also enables the CalcScript linter, which performs static code analysis on your code and reports warnings for any issues found.

To turn on debug mode, click the debug button in the MarkdownUp menu in the upper-right of the page.


The MarkdownUp Package

The markdown-up package contains functions for parsing CSV, manipulating data, and rendering tables and charts. For more information, refer to the MarkdownUp package documentation.


This package is developed using javascript-build. It was started using javascript-template as follows:

template-specialize javascript-template/template/ markdown-up/ -k package markdown-up -k name 'Craig A. Hobbs' -k email '' -k github 'craigahobbs'


npm i markdown-up

DownloadsWeekly Downloads






Unpacked Size

126 kB

Total Files


Last publish


  • craigahobbs