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

@oxide/react-asciidoc

v1.0.2

Published

React renderer for AsciiDoc

Downloads

742

Readme

React AsciiDoc

Warning Work in progress, not ready for use

A React renderer for AsciiDoc. Built on top of Asciidoctor.js. Designed to be equivalent in output of the built-in HTML5 converter. Will allow for custom components to be passed in similar to Custom converters in Asciidoctor.js and custom block types.

Currently just a proof of concept, working towards style parity with the built-in converter.

Installing

To view any of the examples first install all necessary modules:

npm install

Previewing

You can then preview any of the examples by running npm run dev and visting http://localhost:8000/?example=[EXAMPLE]&renderer=[RENDERER]. See here for the example names. Use renderer=react for the React renderer and renderer=html for the HTML one.

Note The example name must be identical to the file name without the file ending, it is case sensitive

Running tests

Before running the full set of tests we must first generate the screenshots. The tests are running a visual diff on the original renderer and the React one. You must therefore run the following command first:

npm run test:init

This will produce an error on first run; this is expected, as it needs to generate the screenshots. You should then run the following command, which runs all of the React renderer tests, comparing them to the baseline.

npm run test:run

GIF of the visual diff tests

Limitations

We do not have access to the inline nodes. They can be customised but not with React. You can write a standard asciidoctor.js custom converter instead. Using a JSX to string converter is planned to make it easier to create converters for inline nodes.

Current Progress

Tests are showing the following examples are identical to the HTML5 renderer using the default asciidoctor stylesheet.

  • [x] Audio
  • [x] Admonition
  • [x] CoList
  • [x] DList
  • [x] Example
  • [x] Floating Title
  • [x] Inline Anchor
  • [x] Inline Break
  • [x] Inline Button
  • [x] Inline Callout
  • [x] Inline Image
  • [x] Inline KBD
  • [x] Inline Menu
  • [x] Inline Quoteed
  • [x] Listing
  • [x] Literal
  • [x] OList
  • [x] Open
  • [x] Page Break
  • [x] Paragraph
  • [x] Pass
  • [x] Preamble
  • [x] Quote
  • [x] Sidebar
  • [x] Thematic Break
  • [x] Toc
  • [ ] Document
  • [ ] Embedded
  • [ ] Image
  • [ ] Inline Footnote
  • [ ] Outline
  • [ ] Section
  • [ ] Stem
  • [ ] Table
  • [ ] Video