Git Product home page Git Product logo

documentarian's Introduction

Documentarian

Build Status

Documentarian is a minimal documentation generation tool for Janet projects.

Documentarian makes it easy to take the docstrings you've already written for your code and turn them into a simple Markdown-formatted document. This document can be included in your repository and read easily on services like GitHub.

Installing

To install, run:

$ jpm install https://github.com/pyrmont/documentarian

Usage

$ /path/to/documentarian

Documentarian depends on your project having a project.janet file that contains a :name key in the declare-project form and a :source key in either the declare-source or declare-native forms. The :source key can be associated with individual files or a directory containing Janet files.

Since the API document is generated in Markdown, you can include Markdown in your docstrings. Don't forget that Janet supports `-delimited long strings in addition to regular "-delimited strings. Long strings preserve whitespace (including newlines) which can be used to create lists, headings and code blocks.

By default, your documentation is saved to a file called api.md in the current working directory. Documentarian includes a simple template that is used to produce the api.md file. You can specify your own template file using the -t command-line argument (see below). The file must be in the Mustache templating language. Documentarian processes the template using Musty. Please note that Musty is an incomplete implementation and does not support the more advanced features of Mustache.

Command-Line Arguments

Documentarian supports the following command-line arguments:

 -d, --defix <prefix>       Remove <prefix> from all namespaces.
 -L, --link-prefix <url>    Use <url> as prefix for source code links.

 -x, --exclude <path>       Exclude bindings in <path> from the API document.
 -P, --private              Include private values in the API document.

 -p, --project <path>       Use <path> as project file. (Default: project.janet)
 -l, --local                Set Janet's syspath to ./jpm_tree.
 -t, --tree <path>          Set Janet's syspath to <path>.

 -e, --echo                 Output to stdout rather than output file.
 -o, --out <path>           Use <path> as filename for the API document. (Default: api.md)
 -T, --template <path>      Use <path> as template for the API document.

 -h, --help                 Show this help message.

Development

Preparing

Clone the repository and then run:

$ jpm [-l] run dev-deps

Building

$ jpm [-l] build

Testing

$ jpm [-l] test

Bugs

Found a bug? I'd love to know about it. The best way is to report your bug in the Issues section on GitHub.

Licence

Documentarian is licensed under the MIT Licence. See LICENSE for more details.

Thanks

Special thanks to Andrew Chambers (@andrewchambers) and Zach Smith (@subsetpark) for their feedback and suggestions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.