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

asciidoctor-stylesheets

v0.7.1

Published

Modern CSS to style AsciiDoc HTML5 output

Downloads

26

Readme

Asciidoctor stylesheets

Build Status

This project is a factory for stylesheets that can be used to style the HTML generated by an AsciiDoc processor (specifically the html5 backend). In addition to being a general purpose AsciiDoc stylesheet generator, it is used to generate the default stylesheet that is bundled with Asciidoctor.

Usage

$ npm i asciidoctor-stylesheets

All the stylesheets will be available in the node_modules/asciidoctor-stylesheets/css.

TIP: If you are using Sass, you can import the Sass files from the node_modules/asciidoctor-stylesheets/sass directory.

Setup and compilation

To setup the project, make sure you have Node.js and npm (or yarn) installed. Next, run npm to install the required dependencies:

$ npm i

Once you have the dependencies installed, you can build the stylesheets.

Build the stylesheets

To build the stylesheets, run:

$ npm run build

The stylesheets are compiled from the Sass source files in the sass/ folder and written to the css/ folder. You can then reference the stylesheets in css/ from your HTML file.

Create sample documents

First, create a sample AsciiDoc file, such as:

= Introduction to AsciiDoc
Doc Writer <[email protected]>

A preface about http://asciidoc.org[AsciiDoc].

== First Section

* item 1
* item 2

[source,ruby]
puts "Hello, World!"

TIP: Alternatively, you can use this README as an example.

Then, use AsciiDoc or Asciidoctor to generate HTML that uses one of the stylesheets from the +css/+ directory:

$ asciidoctor -a stylesheet=./css/asciidoctor.css sample.adoc

If you want to activate syntax highlighting in the code, add this argument:

-a source-highlighter=highlightjs

Now just browse to +sample.html+ in your browser and checkout the result!

External preview

You may want to preview sample HTML files on another computer or device. To do that, you need to serve them through a web server. You can quickly serve HTML files in the root directory of the project using the following command:

python -m SimpleHTTPServer 4242

Create a new theme

Themes go in the sass/ folder. To create a new theme (e.g., hipster), start by creating two new files:

sass/hipster.scss

  • Imports the theme settings, which includes default variables and resets
  • Imports the AsciiDoc components
  • Defines any explicit customizations

sass/settings/_hipster.scss

  • Sets variables that customize the AsciiDoc CSS components

Here's a minimal version of sass/hipster.scss:

@import "settings/hipster";
@import "components/asciidoc";
@import "components/awesome-icons";

NOTE: You don't have to include the underscore prefix when importing files.

You can add any explicit customizations below the import lines.

The variables you can set in sass/settings/_hipster.scss are defined in the global settings and imports for the AsciiDoc components.

Happy theming!