The charje.documentation Reference Manual

This is the charje.documentation Reference Manual, version 0.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:34:47 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 charje.documentation

Documentation is an opinionated yet customizable docstring parsing library.

Author

Charles Jackson <>

Home Page

https://git.sr.ht/~charje/documentation

Source Control

https://git.sr.ht/~charje/documentation

License

AGPL V3 or any later version

Version

0.0.0

Dependency

alexandria (system).

Source

charje.documentation.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 charje.documentation/src

Source

charje.documentation.asd.

Parent Component

charje.documentation (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 charje.documentation/charje.documentation.asd

Source

charje.documentation.asd.

Parent Component

charje.documentation (system).

ASDF Systems

charje.documentation.


4.1.2 charje.documentation/src/package.lisp

Source

charje.documentation.asd.

Parent Component

src (module).

Packages

charje.documentation.


4.1.3 charje.documentation/src/main.lisp

Dependency

package.lisp (file).

Source

charje.documentation.asd.

Parent Component

src (module).

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 charje.documentation

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Macros

Macro: defdocstring (name &rest parts)

Define a docstring parser to be used in ‘parse’ or ‘defdocstring’.

NAME: The name of class resulting class.

PARTS: The docstring parsers in the order they should be parsed. This should be the same order that the sections appear in the docstrings.

Package

charje.documentation.

Source

main.lisp.

Macro: define-docstring-parser (name slots &rest body)

Define a docstring parser mixin class for use in ‘parse’ and ‘defdocstring’.

NAME: The name of the docstring parser. NAME is also bound in the BODY as the docstring object.

SLOTS: A list of slots defined exactly as if for ‘defclass’. Any methods defined by the slots will be available in BODY.

BODY: Code to parse a docstring. The docstring to be
parsed is in (remains NAME). It should be parsed into the SLOTS.

This is just to reduce the boiler plate of ‘defclass’ and
‘defmethod’ for ‘initialize-instance’. If you need something like a meta class feel free to just define a class and an ‘initialize-instance’ method.

Package

charje.documentation.

Source

main.lisp.

Macro: do-sections ((section-name docstring) &body body)

Parse sections in DOCSTRING until there are none left.

SECTION-NAME: The name of the parsed section. It is lexically bound in BODY.

DOCSTRING: The docstring object to operate on.

BODY: Code to do something with SECTION-NAME. Usually process it
and or store it into one of the slots of DOCSTRING.

At the each iteration, the current section (SECTION-NAME) is
considered consumed. If at any point you want to end parsing and consider the current section not consumed, simply ‘return’.

This macro also updates the ‘remains’ of DOCSTRING to no longer
include the consumed sections.

This macro is for parsing multiple sections at once. For parsing a single section, see the more primitive ‘parse-section’.

Package

charje.documentation.

Source

main.lisp.


6.1.2 Ordinary functions

Function: parse (type docstring)

Parse DOCSTRING into a docstring object according to the docstring parser TYPE.

TYPE: The docstring parser as defined by ‘defdocstring’ and ‘define-docstring-parser’.

DOCSTRING: the raw docstring to be parsed.

Package

charje.documentation.

Source

main.lisp.

Function: parse-section (docstring)

Parse a section out of DOCSTRING. Return (values section section-end).

DOCSTRING: The raw docstring to be partially parsed.

The first return value, section, is a string of the section. The second return value, section-end, is the number of characters parsed; it is effectively the length of the section.

Sections are separated by two consecutive ‘#newline’. A single ‘#newline’ followed by any whitespace will be reduced to a single ‘#space’ in the result.

Package

charje.documentation.

Source

main.lisp.


6.1.3 Generic functions

Generic Reader: descriptions (object)
Package

charje.documentation.

Methods
Reader Method: descriptions ((description description))

automatically generated reader method

Source

main.lisp.

Target Slot

description-sections.

Generic Function: parameter-description (docstring name)
Package

charje.documentation.

Methods
Method: parameter-description ((docstring parameter-descriptions) (name symbol))

Return the description of the symbol NAME according to DOCSTRING.

Source

main.lisp.

Generic Reader: parameter-descriptions (object)
Package

charje.documentation.

Methods
Reader Method: parameter-descriptions ((parameter-descriptions parameter-descriptions))

automatically generated reader method

Source

main.lisp.

Target Slot

parameters-descriptions.

Generic Reader: remains (object)
Package

charje.documentation.

Methods
Reader Method: remains ((docstring docstring))

automatically generated reader method

Source

main.lisp.

Target Slot

remains.

Generic Writer: (setf remains) (object)
Package

charje.documentation.

Methods
Writer Method: (setf remains) ((docstring docstring))

automatically generated writer method

Source

main.lisp.

Target Slot

remains.

Generic Reader: synopsis (object)
Package

charje.documentation.

Methods
Reader Method: synopsis ((synopsis synopsis))

automatically generated reader method

Source

main.lisp.

Target Slot

synopsis.


6.1.4 Standalone methods

Method: initialize-instance :after ((synopsis synopsis) &rest initargs0 &key &allow-other-keys)
Source

main.lisp.

Method: initialize-instance :after ((description description) &rest initargs0 &key &allow-other-keys)
Source

main.lisp.

Method: initialize-instance :after ((parameter-descriptions parameter-descriptions) &rest initargs0 &key &allow-other-keys)
Source

main.lisp.


6.1.5 Classes

Class: description
Package

charje.documentation.

Source

main.lisp.

Direct superclasses

docstring.

Direct subclasses

full.

Direct methods
Direct slots
Slot: description-sections
Type

list

Readers

descriptions.

Writers

(setf raw-descriptions).

Class: full
Package

charje.documentation.

Source

main.lisp.

Direct superclasses
Class: parameter-descriptions
Package

charje.documentation.

Source

main.lisp.

Direct superclasses

docstring.

Direct subclasses

full.

Direct methods
Direct slots
Slot: parameters-descriptions
Type

hash-table

Initform

(make-hash-table :test (function equal))

Readers

parameter-descriptions.

Writers

This slot is read-only.

Class: synopsis
Package

charje.documentation.

Source

main.lisp.

Direct superclasses

docstring.

Direct subclasses

full.

Direct methods
Direct slots
Slot: synopsis
Type

string

Initform

""

Readers

synopsis.

Writers

(setf raw-synopsis).


6.2 Internals


6.2.1 Ordinary functions

Function: parameter-description-parts (section)
Package

charje.documentation.

Source

main.lisp.

Function: parameter-name-p (string)
Package

charje.documentation.

Source

main.lisp.

Function: skip-whitespace (position string)
Package

charje.documentation.

Source

main.lisp.

Function: whitespacep (char)
Package

charje.documentation.

Source

main.lisp.


6.2.2 Generic functions

Generic Writer: (setf raw-descriptions) (object)
Package

charje.documentation.

Methods
Writer Method: (setf raw-descriptions) ((description description))

automatically generated writer method

Source

main.lisp.

Target Slot

description-sections.

Generic Writer: (setf raw-synopsis) (object)
Package

charje.documentation.

Methods
Writer Method: (setf raw-synopsis) ((synopsis synopsis))

automatically generated writer method

Source

main.lisp.

Target Slot

synopsis.


6.2.3 Classes

Class: docstring
Package

charje.documentation.

Source

main.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: remains
Type

string

Initargs

:docstring

Readers

remains.

Writers

(setf remains).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
D   F   G   I   M   P   R   S   W  
Index Entry  Section

(
(setf raw-descriptions): Private generic functions
(setf raw-descriptions): Private generic functions
(setf raw-synopsis): Private generic functions
(setf raw-synopsis): Private generic functions
(setf remains): Public generic functions
(setf remains): Public generic functions

D
defdocstring: Public macros
define-docstring-parser: Public macros
descriptions: Public generic functions
descriptions: Public generic functions
do-sections: Public macros

F
Function, parameter-description-parts: Private ordinary functions
Function, parameter-name-p: Private ordinary functions
Function, parse: Public ordinary functions
Function, parse-section: Public ordinary functions
Function, skip-whitespace: Private ordinary functions
Function, whitespacep: Private ordinary functions

G
Generic Function, (setf raw-descriptions): Private generic functions
Generic Function, (setf raw-synopsis): Private generic functions
Generic Function, (setf remains): Public generic functions
Generic Function, descriptions: Public generic functions
Generic Function, parameter-description: Public generic functions
Generic Function, parameter-descriptions: Public generic functions
Generic Function, remains: Public generic functions
Generic Function, synopsis: Public generic functions

I
initialize-instance: Public standalone methods
initialize-instance: Public standalone methods
initialize-instance: Public standalone methods

M
Macro, defdocstring: Public macros
Macro, define-docstring-parser: Public macros
Macro, do-sections: Public macros
Method, (setf raw-descriptions): Private generic functions
Method, (setf raw-synopsis): Private generic functions
Method, (setf remains): Public generic functions
Method, descriptions: Public generic functions
Method, initialize-instance: Public standalone methods
Method, initialize-instance: Public standalone methods
Method, initialize-instance: Public standalone methods
Method, parameter-description: Public generic functions
Method, parameter-descriptions: Public generic functions
Method, remains: Public generic functions
Method, synopsis: Public generic functions

P
parameter-description: Public generic functions
parameter-description: Public generic functions
parameter-description-parts: Private ordinary functions
parameter-descriptions: Public generic functions
parameter-descriptions: Public generic functions
parameter-name-p: Private ordinary functions
parse: Public ordinary functions
parse-section: Public ordinary functions

R
remains: Public generic functions
remains: Public generic functions

S
skip-whitespace: Private ordinary functions
synopsis: Public generic functions
synopsis: Public generic functions

W
whitespacep: Private ordinary functions