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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@forastro/asciidoc

v2.5.0

Published

This library is a set of tools that are designed to work with Asciidoc. The main focus of this library is to use and configure a tool called the Asciidoc loader. The loader is the tool that is responsible for extracting info from Asciidoc files. This l

Readme

For Astro Asciidoc

This library is a set of tools that are designed to work with Asciidoc. The main focus of this library is to use and configure a tool called the Asciidoc loader. The loader is the tool that is responsible for extracting info from Asciidoc files. This library also comes with some nice tools to help you work with Asciidoc.

For further documentation read <https//:forastro-docs.onrender.com/libraries/asciidoc>.

Usage

To install the library all you have to do is use your favorite package manager.

To use this library all you have to do is import asciidocLoader from @forastro/asciidoc.

import { asciidocLoader } from "@forastro/asciidoc"

Then go to the content collection file in Astro's file and type this.

  import {asciidocLoader} from "@forastro/asciidoc"
  import { z defineCollection } from 'astro:content'

   const topic defineCollection({
        loader: asciidocLoader("src/data")
        schema: z.object({
            doctitle: z.string()
        })
        .transform((it)=> ({
            title: it.doctitle
        }))
    })

    export  const collections = {
        topic
    }

This should get you setup with Astro. This integration does provide it's own schema. It's called the asciidocBaseSchema It's a schema that extract's properties from Asciidoc files. Then transform's them into objects that are written in camelCase forms. The title will come from Asciidoc's doctitle property always.

The object that is parsed is this type.

{
    author: string;
    authors: string[];
    description: string;
    email?: string | undefined;
    title: string;
    authorInitials: string;
    firstName: string;
    middleName: string;
    lastName: string;
    createdAt: string;
    updatedAt: string;
}

To use this schema all you have to do is import it from @forastro/asciidoc. Then use it in define collections.

  import {asciidocLoader, asciidocBaseSchema } from "@forastro/asciidoc"
  import { defineCollection } from 'astro:content'

   const topic defineCollection({
        loader: asciidocLoader("src/data")
        schema: asciidocBaseSchema
    })

    export const collections = {
        topic
    }

Configuration

If you're a asciidoc user from a different language then I need you to know that. For now you will not be able to use extensions from the Asciidoc ecosystem yet. This config file exists so that users can create their own blocks and macros. The config file will also allow you to register attributes that will be sent to all Asciidoc files.

You must create a config file at the root of your project that is an asciidoc.config file. With either an .mjs or .mts file. Any other extension will give out an error.

The config file takes the following properties.

  • attributes: An object literal of global attributes that are allowed to be applied to each document.
  • blocks: An object literal that takes in keys with and name whose values must be two an object literal with two props.
    • context The context for the block.
    • render The function that will render the content that will be displayed
  • macros: An object literal that takes inline: and block: as properties.
    • The inline: and block: props both take in an object literal that must provide props Who's values are an object literal with both context: and render:.

Remember to export default the config file. If you need help with the types please use the config file use the AsciidocConfigObject type.

import { AsciidocConfigObject } from "@forastro/asciidoc"

 export default {
    attributes: {

    },
    blocks: {

    },
    macros:{
        inline:{},
        block:{}
    }
 } satisfies AsciidocConfigObject

Styling

This plugin allows you to use Tailwind or UnoCSS to style your blog pages. To use either use the appropriate module from @forastro/asciidoc.

Tailwind

import { tailwindAsciidocTypography } from "@forastro/asciidoc/tailwind"

export default {
    plugins:[
        tailwindAsciidocTypography
    ]
}

Uno

import { presetAsciidocTypography } from "@forastro/asciidoc/unocss"

export default {
    plugins:[
        presetAsciidocTypography()
    ]
}

When using For astro Asciidoc only shiki and prisma are supported for syntax highlighting. This is what Astro does so I decided to follow that.

To configure a syntax highlighter you must. Create a asciidoc.config.m{js,ts} file. Inside of it use the attributes.sourceHighlighter prop to specify what highlighter you want to use. For Shiki the only thing you can do is customize the theme nothing else. When it comes to Prism you must use your own stylesheet for the theme there's nothing else that can be done.

By default Shiki is used with the light theme as github-dark and the dark theme being github-light. This is made under the assumption that under light pages the code can be seen clearly but under darkness light can shine through.

Contributions

If you want to file issues or make a contribution go to the For Astro Repo. If you are a member of the Asciidoc team I will gladly transfer this library to you.