ljs2

2.0.3 • Public • Published

ljs2

      :::       ::::::::::: ::::::::   ::::::::
     :+:           :+:    :+:    :+: :+:    :+:
    +:+           +:+    +:+              +:+
   +#+           +#+    +#++:++#++     +#+
  +#+           +#+           +#+   +#+
 #+#       #+# #+#    #+#    #+#  #+#
########## #####      ########  ##########

Generate docs from your source

Command Line

If ljs2 is installed globally, you can use ljs2 command line tool to process your literate javascript files

You can use npx to proxy commands to ljs2 directly, e.g. npx ljs2 input.js

Otherwise, if you want it installed as a standalone, use yarn global add ljs2 or npm i -g ljs2

$ ljs2 input-file.js -o output-file.md
$ ljs2 --help

This file is generated from ljs2's source code! View it here

Usage

The basic idea with ljs2 is to prefix literate comments with the /** literate comment block indicator (note the additional asterisk). Literate comments are then visible in the markdown document.

Additionally, individual, non-literate comments can use the magic directive: " =>" directly after the comment to either:

  • via the include directive, include other literate code files: // => include other-literate-file.js
  • via the plain directive, include other markdown files as included comments: // => plain other-file.md

Configuration

Many of ljs2's behavior can be customized via flags. Please see ljs2 --help for more information, or peruse the tests and their fixtures

Release History

  • 1.0.02016-09-19 — Initial release
    • forked off of ljs 0.3.2
  • 2.0.02019-01-10 — Major rewrite using sywac

Contributors

Related work

This tool can be used to do literate programming! Docco is similar tool, however ljs2 is markup-language-agnostic.

The MIT License (MIT)

  • Copyright (c) 2016 Brekk Bockrath
  • Copyright (c) 2013, 2014 Oleg Grenrus

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Dependents (0)

Package Sidebar

Install

npm i ljs2

Weekly Downloads

0

Version

2.0.3

License

MIT

Unpacked Size

419 kB

Total Files

96

Last publish

Collaborators

  • brekk