Giter VIP home page Giter VIP logo

erudite's Introduction

ERUDITE

Quicklisp MIT License

Introduction

Erudite is a Literate Programming System for Common Lisp

Features

  • Interactive development. No tangling phase in which code is extracted from documentation. Documentation is written in Common Lisp comments. This allows for incremental development: you can load your code, work from SLIME, etc, directly, as in any other Lisp project.

  • Multiple syntaxes. Multiple type of literate syntax are supported. It is possible to choose from the default Erudite syntax, or use plain Latex or Sphinx syntax, and potentially others.

  • Multiple outputs. Like Latex, Sphinx, Markdown, HTML, etc.

  • Automatic indexing and cross-references.

  • A command line interface.

  • It is portable. You can compile and use in several CL systems (has been tested on SBCL, CCL, CLISP, ECL, so far)

Quickstart

Write your embedded documentation in lisp comments (;; and #| … |# are supported). Use either erudite, latex or sphinx syntax, and produce output to one of them or markdown.

Example in the built-in erudite syntax:

#|
@title Erudite
@subtitle Literate Programming System for Common Lisp

@author Mariano Montone
@syntax erudite

@section Introduction

@ignore
|#
(in-package #:erudite)

#|
@end ignore

For a full example, see erudite.lisp.

Run make to build erudite command line if you want to run it from there, and then sudo make install to install.

Usage: erudite [-hvd] [+vd] [OPTIONS] FILES...

Erudite is a Literate Programming System for Common Lisp
  -h, --help                  Print this help and exit.
  --version                   Print Erudite version
  -(+)v, --verbose[=yes/no]   Run in verbose mode
                              Fallback: yes
                              Default: no
                              Environment: VERBOSE
  -(+)d, --debug[=on/off]     Turn debugging on or off.
                              Fallback: on
                              Default: off
                              Environment: DEBUG
  -(+)id, --implicit-doc[=yes/no] Treat all comments as documentation
                              Fallback: yes
                              Default: yes
  -(+)ic, --implicit-code[=yes/no] Include all code in documentation
                              Fallback: yes
                              Default: yes
  -o, --output=OUTPUT         The output file. If none is used, result is 
                              printed to stdout
  --output-type=OUTPUT-TYPE   The output type. One of 'latex', 
                              'sphinx','markdown'
                              Default: latex
  --syntax=SYNTAX             The syntax used in source files. One of 'erudite',
                              'latex', 'sphinx', 'markdown'
                              Default: erudite
  --author=AUTHOR             The author to appear in the document
  --title=TITLE               The document title

Or run it from lisp, using the erudite function described below.

To build erudite own documentation, run make under the doc directory:

make pdf
make sphinx-pdf
make sphinx-html
make markdown

Look at the doc directory for output examples.

Functions

erudite

(pathname files &rest args &key (output-type *output-type*)
          (syntax *syntax*) &allow-other-keys)

Processes literate lisp files and creates a document.

  • pathname: Pathname of the file to generate. If nil, output to a string. If t, print to standard output.
  • files: Literate lisp files to compile
  • args: All sort of options passed to the generation functions
  • output-type: The kind of document to generate. One of :latex, :sphinx, :markdown Default: :latex
  • syntax: The kind of syntax used in the literate source files. One of: :erudite, :latex, :sphinx, :markdown. Default: :erudite

References

erudite's People

Contributors

mmontone avatar vindarel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

erudite's Issues

Can we capture a function output ?

Hi,

Is it possible (or the goal) in erudite to capture and print the output of a function, akin to org mode ?

I'm imagining:

#| The latest news are:

@capture
#|
(defun latest-news ()
  (…))
(latest-news)

Regards

No process-doc for markdown syntax

Hi,

I'm interested to write embedded doc in markdown (as advertised :D ) but it seems support doesn't exist.

(erudite:erudite t "test.lisp" :output-type :markdown :syntax :markdown)
ERROR: There is no primary method for the generic function
         #<STANDARD-GENERIC-FUNCTION ERUDITE::PROCESS-DOC (5)>
       when called with arguments
         (:MARKDOWN :MARKDOWN "Hello erudite."
          #<SB-IMPL::STRING-OUTPUT-STREAM {10049C0123}>
          #<CLOSURE (FLET ERUDITE::PROCESS-CONT :IN ERUDITE::PROCESS-FRAGMENT) {10049C673B}>).
See also:

And indeed, there is no process-doc method that specializes on :markdown.

I see a syntax/markdown.lisp file, then no *markdown-syntax* as with *erudite-syntax*. Is it ready, is there much left ?

Regards

How to comment code ?

I have unfinished code that I'd like to show in the documentation, but that shouldn't be run. If I comment it inside #|…|#, it is outputted as regular text (expected). If I comment it with ;;, it is a it annoying.
So I thought there could be a @comment syntax, is there one ? (couldn't see one in erudite.lisp) I also could use markdown's code snippet inside the #|, but markdown syntax for input is not supported.

thanks

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.