npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

markdown-up

v3.3.2

Published

MarkdownUp is a Markdown viewer

Downloads

80

Readme

MarkdownUp

npm GitHub

MarkdownUp is a Markdown viewer.

Links

View Local Markdown Files

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

pip install markdown-up
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 https://craigahobbs.github.io/markdown-up/extra/index.html

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

python3 -m http.server

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

    ...
    <script type="module">
        import {MarkdownUp} from 'https://craigahobbs.github.io/markdown-up/lib/app.js';
        const app = new MarkdownUp(window, {'url': 'other.md'});
        app.run();
    </script>
    ...

To view a different Markdown resource, set the application's "url" hash parameter (i.e., "http://127.0.0.1:8000#url=other.md").

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 BareScript 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:
    # Render the hello title
    helloTitle = 'Hello #' + (ixHello + 1)
    markdownPrint('', '## ' + helloTitle)

    # Render the hello drawing
    drawNew(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
endwhile
~~~

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 that uses the unittest.mds system library:

include <unittest.mds>

function testSanity():
    unittestEqual(1 + 1, 2)
endfunction
unittestRunTest('testSanity')

unittestReport()

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

Debug Mode

Debug mode logs the script runtime duration and runs the BareScript linter, which performs static code analysis on your code and reports warnings for any issues found.

Debug mode also enables debug logging using the systemLogDebug function. For example:

systemLogDebug('Hello debug')

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

Links

The MarkdownUp Package

The markdown-up package exposes various functionality of the MarkdownUp application, such as rendering data tables and charts. For more information, refer to the MarkdownUp package documentation.

Development

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 '[email protected]' -k github 'craigahobbs'