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

@matjp/jweb

v0.1.9

Published

The JWEB System of Structured Documentation

Downloads

5

Readme

JWEB

JWEB is a modern, simplified implementation of the CWEB system of literate programming.

Program texts are written in Markdown with fenced code blocks instead of TeX.

ctangle has been re-implemented as jtangle which has been enhanced to support the Javascript and Typescript languages in addition to the original ctangle support for C and C++.

jtangle is written in JWEB, so it is self-built.

Since TeX is not used no re-implementation of cweave was required.

How it works

Write your program as a Markdown document consisting of sections of descriptive text together with fenced code blocks formatted using CWEB control codes and section texts.

Language Specifier

The output language is indicated by this Markdown front-matter:

---
jweb:<language>
---

where <language> is the language specifier that will be appended to the output filename. e.g. (c, cpp, js, ts).

See cwebman.pdf in docs for the CWEB syntax, and see jtangle.md and the examples folder for JWEB source examples.

Generating a target source file

jtangle accepts WEB files as input, so any existing CWEB (*.w) file can be processed into a program source file.

Note that the command line syntax for jtangle is different to that of ctangle. i.e.

jtangle(args[, logFunc])

args is a string array containing the following members in the same order: [options] webfile[.w] {changefile[.ch]|-} outlang outfile

where outlang is the target language extension and outfile is the filename without language extension.

logFunc is a function taking a single string parameter that will output that string somewhere as a log message. If no function is passed console.log will be used.

When building from a Markdown source an intermediate WEB file must be generated before calling jtangle. A build script build.js is provided to fully process a Markdown file.

The markdown file is converted into a WEB file by concatenating all of the fenced code blocks together and adding CWEB section control codes.

Then the WEB file is passed into jtangle to produce the target source file.

See package.json for examples of calling build.js for jtangle and the examples.

VS Code Extension

JWEB Editor is a VS Code extension for editing JWEB files.

It automates the calling of jtangle on each file save and allows the use of syntax highlighting, Markdown preview and other Markdown extensions with your JWEB documents.

paypal