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

@frantic1048/est

v0.0.4

Published

reStructuredText parser and renderer

Downloads

14

Readme

Est

|license|_ |code quality|_ |ci|_ |dm|_

.. |license| image:: https://img.shields.io/github/license/frantic1048/est.svg?style=flat-square .. _license: https://github.com/frantic1048/est/blob/master/LICENSE .. |code quality| image:: https://img.shields.io/codacy/grade/3aa60448106f4001b7ac194829f98397.svg?style=flat-square .. _code quality: https://www.codacy.com/app/frantic1048/Est/dashboard .. |ci| image:: https://img.shields.io/travis/frantic1048/Est.svg?style=flat-square .. _ci: https://travis-ci.org/frantic1048/Est .. |dm| image:: https://img.shields.io/david/frantic1048/Est.svg?style=flat-square .. _dm: https://david-dm.org/frantic1048/Est

reStructuredText parser and renderer.

Install

Use yarn to fetch the package, or npm if you prefer.

.. code:: sh

yarn add @frantic1048/Est

Usage

After build:

.. code:: js

// do not forget the ``@frantic1048`` scope
import est from '@frantic1048/Est'

// directly render rST into HTML string
const html = est.rst2html('reStructuredText string...')


// or...?
// welcome to the dark side...

// generate parsing tree
// which is an ASTy instance
const parse_t = est.parse('reStructuredText string...')

// transfrom parsing tree into doc tree
// which is an ASTy instance
const doc_t = est.transfrom(parse_t)

// render the doc tree into HTML string
const html_the_harder_way = est.render(doc_t)

All node types of the parsed tree can be found from est.TokenTypes .

.. _ASTy: https://github.com/rse/asty

The node structure of a specific markup could be referred in test/grammar.<MarkupName>.js

Render function is under constructing.

Build

Prepare:

.. code:: sh

# fetch source code
git clone https://github.com/frantic1048/Est.git

# fetch dependencies
yarn

Build and run test:

.. code:: sh

yarn ci

Production build:

.. code:: sh

yarn dist

Develop:

.. code:: sh

yarn dev

The build output is under lib folder. All possible files are:

:est.dev.js: trace on, CommonJS module, debug and develop oriented. :est.min.js: trace off, single variable, Browser oriented. :est.js: trace off, CommonJS module, Node.js oriented.

Recognized Markups

:Inline:

  • emphasis <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#emphasis>_

  • strong emphasis <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#strong-emphasis>_

  • interpreted text <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#interpreted-text>_

  • inline literal <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-literals>_

  • hyperlink reference <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#hyperlink-references>_

  • substitution reference <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#substitution-references>_

  • inline internal target <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-internal-targets>_

  • standalone hyperlink <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#standalone-hyperlinks>_

    URI is refer to RFC 3986 <https://tools.ietf.org/html/rfc3986#appendix-A>_ 's absolute-URI definition, no scheme restriction.

    Email address is a simplified subset of URI. See TextEmailAdress rule in src/parser.pegjs

:Block-level:

  • section <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#sections>_

    Unlike adorment line should be longer than title text in spec, section adornment length > 3 is accepted length.

  • transition <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#transitions>_

  • paragraph <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#paragraphs>_

  • bullet list <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#bullet-lists>_

    fixed 2 spaces indent.

  • enumerated list <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#enumerated-lists>_

    the text immediately after the enumerator determines the indentation (same as spec).

  • definition list <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#definition-lists>_

    fixed 4 spaces indent.

  • field list <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#field-lists>_

  • option list <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#option-lists>_

  • footnote <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#footnotes>_

    standalone hyperlink is not recognized in field name, while the other inline markups is recognized.

  • citation <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#citations>_

  • hyperlink target <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#hyperlink-targets>_

  • directive <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#directives>_

  • substitution definition <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#substitution-definitions>_