2017-08-27

(sph documentation)

extracting and formatting guile scheme code documentation

formats are theoretically extendable with an alist of procedures and registration in a hashtable

part of sph-lib

example

this in a file and you have a program for printing module documentation. default format is itpn.

(import (sph) (sph documentation) (only (sph one) string->datum) (only (sph string) parenthesise))
(display
  (format-module-documentation
    (map (compose string->datum parenthesise) (tail (program-arguments))) (q default)))
(newline)

$ guile t.scm "sph one"

bindings

import name

(sph documentation)

exports

default-format-arguments

procedure

signature

arguments type ->

pair/list:alist symbol:"procedure"/"syntax"/"variable" -> string

description

formats argumets in sph type-signature notation format.

arguments as retrieved by "module-binding-info", which uses (ice-9 session) "procedure-arguments"

display-module-information-short

procedure

signature

a [markdown?] ->

doc-bindings

procedure

signature

libraries [pair] ->

(list ...) -> ((symbol:name . list:library-name) ...)

description

get a list of all bindings and the library name they belong to for all specified library names

docstring-split-signature

procedure

signature

a line-prefix c ->

description

string string procedure:{string:type-signatures string:rest-of-docstring} -> any

if a string starts with a type-signature, split string at the end of it

documentation-display-formats

variable

format-module-documentation

procedure

signature

module-names [format-handler-name] ->

((symbol ...) ...)/(symbol ...) symbol ->

description

output documentation for a list of module-names. format-handler-name can currently either be

default, itpn.

for just retrieving module documentation you might want to consider (sph binding-info)

lines->docstring

procedure

signature

a indent ->

list (string ...) -> string

module-description

procedure

signature

name ->

(symbol ...) -> false/string

description

get the module description from an exported variable with a specific name.

(a b c) -> a-b-c-description

module-find-one-information

procedure

signature

search-paths module-find-one-arguments ... ->

module-find-one-information-sorted

procedure

signature

search-paths module-find-arguments ... ->

sort-module-information

procedure

signature

a ->

sph-documentation-description

variable

tags: programming guile documentation library scheme sph-lib sph-documentation