Giter Site home page Giter Site logo

artturin / nixdoc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nix-community/nixdoc

0.0 1.0 0.0 81 KB

Tool to generate documentation for Nix library functions [maintainer=@tazjin,@ryantm]

License: GNU General Public License v3.0

Rust 29.64% Nix 70.36%

nixdoc's Introduction

nixdoc

This tool is (for now) a proof-of-concept to generate documentation for Nix library functions from the source files in nixpkgs/lib.

It uses rnix to parse Nix source files, which are then transformed into a DocBook representation of the function set.

Please see this Discourse thread for information on the documentation format and general discussion.

Check out this example of documentation generated for the strings.nix file.

Comment format

(Note: The parser for this is a quick hack, I don't want to spend time writing a better one before I know how it's supposed to work.)

Currently, identifiers are included in the documentation if they have a preceding comment in multiline syntax /* something */.

Two special line beginnings are recognised:

  • Example: Everything following this line will be assumed to be a verbatim usage example.
  • Type: This line will be interpreted as a faux type signature.

These will result in appropriate elements being inserted into the output.

Function arguments

Function arguments can be documented by prefixing them with a comment:

/* This function does the thing a number of times. */
myFunction =
    # The thing to do
    thing:
    # How many times to do it
    n: doNTimes n thing

Caveats & TODOs

Please check the issues page.

Building

This project requires a nightly Rust compiler build.

nixdoc's People

Watchers

 avatar

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.