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

ascaid

v1.10.23

Published

Hassle-free documentation generation powered by AsciiDoc

Downloads

520

Readme

Banner

ascaid

Hassle-free documentation generation powered by AsciiDoc

TL;DR

⚡️ Write documents in AsciiDoc format

⚡️ Include text-based diagrams in your documents:

⚡️ Extend AsciiDoc with custom extensions:

⚡️ Publish your documents to Confluence and code hosting services

Longer Description

ascaid makes it easy to write partially-generated documentation in AsciiDoc format. Generating the documentation can help with reducing documentation CRUFT.

Under the hood, ascaid uses Asciidoctor.js and Pandoc and offers the following main features:

The following diagram shows a typical document writing and publishing workflow with ascaid.

Diagram

Note: This document is generated with ascaid itself. Check out the source here.

Installation

Requirements

  1. A Unix-like operating system (WSL is also supported)

  2. Bash

  3. Node.js

  4. Pandoc

You can install the package globally with npm:

npm install -g ascaid

CLI Usage

ascaid help

Usage: ascaid [options] [command]

Hassle-free documentation generation powered by AsciiDoc

Options:
  -V, --version                  output the version number
  -h, --help                     display help for command

Commands:
  serve [directory]              start an AsciiDoc server
  adoc-to-gfm <srcDir> <outDir>  AsciiDoc -> GitHub flavored markdown
  gfm-to-confluence <dir>        Publish a GitHub flavored markdown directory
                                 to Confluence
  help [command]                 display help for command

ascaid serve

Usage: ascaid-serve [options] [rootDir]

Start an AsciiDoc server

Arguments:
  rootDir                         server root directory (default: current
                                  directory)

Options:
  -V, --version                   output the version number
  -c, --config <path>             config file path
  -a, --attribute [key=value...]  set a document attribute. The value given
                                  will override values from the config file.
                                  Passing the key without =value will unset the
                                  attribute (default: [])
  -h, --help                      display help for command

ascaid adoc-to-gfm

Usage: ascaid-adoc-to-gfm [options] <srcDir> <outDir>

Recursively convert AsciiDoc files in a directory to GitHub flavored markdown

Arguments:
  srcDir                          source directory
  outDir                          output directory

Options:
  -V, --version                   output the version number
  --ignore [globPattern...]       glob patterns to ignore (default: ["**/_*"])
  -c, --config <path>             config file path
  -a, --attribute [key=value...]  set a document attribute. The value given
                                  will override values from the config file.
                                  Passing the key without =value will unset the
                                  attribute (default: [])
  -h, --help                      display help for command

ascaid gfm-to-confluence

Usage: ascaid-gfm-to-confluence [options] <dir>

Recursively publish a GitHub flavored markdown directory to Confluence

Arguments:
  dir                                dir to publish to Confluence

Options:
  -V, --version                      output the version number
  --api-base-url [apiBaseUrl]        Confluence API base URL
  --api-username [apiUsername]       Confluence API username
  --api-password [apiPassword]       Confluence API password
  --space-key [spaceKey]             Confluence space key
  --root-page-id [rootPageId]        Confluence root page ID
  --root-page-title [rootPageTitle]  Confluence root page title
  -h, --help                         display help for command

Config File

You can optionally use a config file to register custom extensions and set Asciidoctor.js options. On startup, ascaid looks for a config file named ascaid.config.json or ascaid.config.jsonc in the current working directory. The following block shows an example config file:

{
  // JSON comments will be striped out

  "$schema": "https://raw.githubusercontent.com/fardjad/node-ascaid/master/ascaid.config.schema.json",
  "extensions": [
    // npm i asciidoctor-kroki
    "asciidoctor-kroki",

    "./path/to/extension.js"
  ],

  // https://docs.asciidoctor.org/asciidoctor/latest/api/options/
  "asciidoctorOptions": {
    // https://docs.asciidoctor.org/asciidoc/latest/attributes/document-attributes-ref/
    "attributes": {
      "nofooter": true,
      "kroki-server-url": "http://my-server-url:port"
    }
  }
}

Extensions

ascaid supports Asciidoctor.js Extensions.

An example implementation of a custom extension can be found here.

Publishing Documents to Confluence

In order to publish AsciiDoc documents to Confluence, you should first convert them to GitHub Flavored Markdown (see CLI Usage for more info). Then you’ll need to create an API token and a root page to publish the documents under. An example project with GitHub Actions integration can be found here.