The mystic Reference Manual

This is the mystic Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:24:14 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 mystic

A project skeleton generator.

Maintainer

Fernando Borretti <>

Author

Fernando Borretti <>

Home Page
Source Control

(GIT )

Bug Tracker
License

MIT

Long Description

# Mystic

[![Build Status](https://travis-ci.org/roswell/mystic.svg?branch=master)](https://travis-ci.org/roswell/mystic)

A modular project skeleton generator.

# Overview

Some features:

* **Declarative:** Options are specified in a declarative interface, so you have
have multiple front-ends (command line, web, etc.) to the project generator.

* **Modular:** Most of the functionality common to different templates
(e.g. Travis support, the ‘.gitignore‘ file) is implemented as mixins.

# Usage

“‘lisp
(mystic:render (make-instance ’mystic.template.library:library-template)
(list :name "your-project"
:author "You"
:email "you@gmail.com"
:license "MIT"
:description "A one-line description of your project."
:dependencies "clack, postmodern")
#p"/home/you/code/your-project/")
“‘

I’ll get around to writing an actual interface at some point.

# License

Copyright (c) 2016 Fernando Borretti (eudoxiahp@gmail.com)

Licensed under the MIT License.

Version

0.1

Dependencies
  • cl-mustache (system).
  • split-sequence (system).
  • anaphora (system).
  • alexandria (system).
  • ubiquitous (system).
  • local-time (system).
Source

mystic.asd.

Child Component

src (module).


3 Modules

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


3.1 mystic/src

Source

mystic.asd.

Parent Component

mystic (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 mystic/mystic.asd

Source

mystic.asd.

Parent Component

mystic (system).

ASDF Systems

mystic.


4.1.2 mystic/src/util.lisp

Source

mystic.asd.

Parent Component

src (module).

Packages

mystic.util.

Public Interface

4.1.3 mystic/src/mystic.lisp

Dependency

util.lisp (file).

Source

mystic.asd.

Parent Component

src (module).

Packages

mystic.

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 mystic

Source

mystic.lisp.

Use List

common-lisp.

Public Interface
Internals

5.2 mystic.util

Utilities for Mystic.

Source

util.lisp.

Use List

common-lisp.

Public Interface

6 Definitions

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


6.1 Public Interface


6.1.1 Ordinary functions

Function: list-templates ()

Return a list of project templates.

Package

mystic.

Source

mystic.lisp.

Function: make-option (name title docstring &key requiredp processor default)
Package

mystic.

Source

mystic.lisp.

Function: parse-comma-separated-list (systems-list)
Package

mystic.util.

Source

util.lisp.

Function: parse-systems-list (systems-list)
Package

mystic.util.

Source

util.lisp.

Function: read-template-file (pathname &key asdf-system)

Read a pathname relative to the templates/ directory into a string.

Package

mystic.util.

Source

util.lisp.

Function: register-template (template)

Register a template.

Package

mystic.

Source

mystic.lisp.

Function: render (template options directory &key request-all-options-p)

Render a @cl:param(template) to a @cl:param(directory). The @cl:param(options) are a plist of option names to their supplied values.

This is the user-level entrypoint, and performs option validation and anything that needs to be done before handing over the task of rendering to the actual @c(render-template) method.

Package

mystic.

Source

mystic.lisp.

Function: render-string (template-string data)

Render a Mustache template string to a string.

Package

mystic.util.

Source

util.lisp.

Function: strip-whitespace (string)
Package

mystic.util.

Source

util.lisp.

Function: write-file (string pathname)

Write a string to a file (absolute path), creating it if necessary, and creating its parent directories as well.

Package

mystic.util.

Source

util.lisp.


6.1.2 Generic functions

Generic Reader: option-default (object)
Package

mystic.

Methods
Reader Method: option-default ((condition ask-about-defaults))
Source

mystic.lisp.

Target Slot

option-default.

Reader Method: option-default ((option option))

The option’s default value. This value will not be passed through an option processor.

Source

mystic.lisp.

Target Slot

default.

Generic Reader: option-docstring (object)
Package

mystic.

Methods
Reader Method: option-docstring ((condition base-option-condition))
Source

mystic.lisp.

Target Slot

docstring.

Reader Method: option-docstring ((option option))

The option’s documentation string.

Source

mystic.lisp.

Target Slot

docstring.

Generic Reader: option-name (object)
Package

mystic.

Methods
Reader Method: option-name ((condition base-option-condition))
Source

mystic.lisp.

Target Slot

option-name.

Reader Method: option-name ((option option))

The name of the option, a keyword, e.g. @c(:project-name).

Source

mystic.lisp.

Target Slot

name.

Generic Reader: option-required-p (object)
Package

mystic.

Methods
Reader Method: option-required-p ((option option))

Whether the option is required. False by default.

Source

mystic.lisp.

Target Slot

requiredp.

Generic Reader: option-title (object)
Package

mystic.

Methods
Reader Method: option-title ((option option))

The human-readable option name, e.g. @c("Project Name").

Source

mystic.lisp.

Target Slot

title.

Generic Function: render-template (template options directory)

Render a @cl:param(template) to a @cl:param(directory). The @cl:param(options) are a plist of option names to their supplied values.

Package

mystic.

Source

mystic.lisp.

Method Combination

progn.

Options

:most-specific-first

Generic Reader: template-docstring (object)
Package

mystic.

Methods
Reader Method: template-docstring ((template template))

The template’s documentation string.

Source

mystic.lisp.

Target Slot

docstring.

Generic Reader: template-name (object)
Package

mystic.

Methods
Reader Method: template-name ((template template))

The template’s human-readable name.

Source

mystic.lisp.

Target Slot

name.

Generic Reader: template-options (object)
Package

mystic.

Methods
Reader Method: template-options ((template template))

A list of template options.

Source

mystic.lisp.

Target Slot

options.

Generic Function: validate-options (template options &key request-all-options-p)

Validates templates and returns a plist where keys are option names. This plist will be used to render templates.

A template or mixin might define a method for this generic function either to
apply some additional validation or to add calculated variables to the plist. For example, if some option contains a system name, you might want to uppercase it or to replace
dashes with underscores and store results to a separate variable.

Package

mystic.

Source

mystic.lisp.

Methods
Method: validate-options ((template template) (options list) &key request-all-options-p)

Take a plist of options, and validate it against the options in the template.

When ASK-ABOUT-DEFAULTS-P is T, Mystic will ask user about all options missing from OPTIONS list but used in TEMPLATE. Asking is performed as condition signaling and a user can choose one of available restarts:

- USE-DEFAULT - use default specified in the option’s code.
- USE-VALUE-FROM-CONFIG - use value from config.
- USE-VALUE - enter a value interactively.
- STORE-VALUE - enter a value and store it in the config for future calls.


6.1.3 Standalone methods

Method: print-object ((obj prompt-option) stream)
Source

mystic.lisp.


6.1.4 Conditions

Condition: ask-about-defaults

Signalled when user passed REQUEST-ALL-OPTIONS-P argument to RENDER method and didn’t supply some option value which has a default.

Package

mystic.

Source

mystic.lisp.

Direct superclasses

base-option-condition.

Direct methods

option-default.

Direct slots
Slot: option-default

The default value of the option.

Initargs

:option-default

Readers

option-default.

Writers

This slot is read-only.

Condition: ask-about-option-without-default

Signalled when user passed REQUEST-ALL-OPTIONS-P argument to RENDER method, didn’t supply an option value and we don’t have a default or saved value for it.

Package

mystic.

Source

mystic.lisp.

Direct superclasses

base-option-condition.

Direct methods

option-value.

Direct slots
Slot: value

The value from config.

Initargs

:value

Readers

option-value.

Writers

This slot is read-only.

Condition: ask-about-value-from-config

Signalled when user passed REQUEST-ALL-OPTIONS-P argument to RENDER method, didn’t supply some option value but a value for this option was found in a config file.

Package

mystic.

Source

mystic.lisp.

Direct superclasses

base-option-condition.

Direct methods
Direct slots
Slot: value

The value from config.

Initargs

:value

Readers

option-value.

Writers

This slot is read-only.

Slot: config-path

Path to the config.

Initargs

:config-path

Readers

config-path.

Writers

This slot is read-only.

Condition: bad-option-value

Signalled when a some value is in wrong format or type.

Package

mystic.

Source

mystic.lisp.

Direct superclasses

base-option-condition.

Direct methods
Direct slots
Slot: value

Wrong value of an option.

Initform

(quote (error "argument :value is required."))

Initargs

:value

Readers

option-value.

Writers

This slot is read-only.

Slot: problem

What is wrong with value.

Initform

(quote (error "argument :problem is required."))

Initargs

:problem

Readers

option-value-problem.

Writers

This slot is read-only.

Condition: base-option-condition
Package

mystic.

Source

mystic.lisp.

Direct superclasses

condition.

Direct subclasses
Direct methods
Direct slots
Slot: option-name

The name of the option.

Initargs

:option-name

Readers

option-name.

Writers

This slot is read-only.

Slot: docstring

Documentation of the option.

Initargs

:docstring

Readers

option-docstring.

Writers

This slot is read-only.

Condition: missing-required-option

Signalled when a required option is not supplied.

Package

mystic.

Source

mystic.lisp.

Direct superclasses

base-option-condition.


6.1.5 Classes

Class: boolean-option

A yes or no option.

Package

mystic.

Source

mystic.lisp.

Direct superclasses

option.

Class: multiple-choice-option

An option that gives the user a choice from a list.

Package

mystic.

Source

mystic.lisp.

Direct superclasses

option.

Direct methods

option-choices.

Direct slots
Slot: choices

A list of strings.

Type

list

Initargs

:choices

Readers

option-choices.

Writers

This slot is read-only.

Class: option

An option to a template.

Package

mystic.

Source

mystic.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: name

The name of the option, a keyword, e.g. @c(:project-name).

Type

keyword

Initargs

:name

Readers

option-name.

Writers

This slot is read-only.

Slot: title

The human-readable option name, e.g. @c("Project Name").

Type

string

Initargs

:title

Readers

option-title.

Writers

This slot is read-only.

Slot: docstring

The option’s documentation string.

Type

string

Initargs

:docstring

Readers

option-docstring.

Writers

This slot is read-only.

Slot: requiredp

Whether the option is required. False by default.

Type

boolean

Initargs

:requiredp

Readers

option-required-p.

Writers

This slot is read-only.

Slot: processor

A function used to process the value given to the option.

Type

function

Initform

(function identity)

Initargs

:processor

Readers

option-processor.

Writers

This slot is read-only.

Slot: default

The option’s default value. This value will not be passed through an option processor.

Initargs

:default

Readers

option-default.

Writers

This slot is read-only.

Class: prompt-option

An option that prompts the user for a value.

Package

mystic.

Source

mystic.lisp.

Direct superclasses

option.

Direct methods

print-object.

Class: template

Represents a template.

Package

mystic.

Source

mystic.lisp.

Direct methods
Direct slots
Slot: name

The template’s human-readable name.

Type

string

Initargs

:name

Readers

template-name.

Writers

This slot is read-only.

Slot: docstring

The template’s documentation string.

Type

string

Initargs

:docstring

Readers

template-docstring.

Writers

This slot is read-only.

Slot: options

A list of template options.

Type

list

Initargs

:options

Readers

template-options.

Writers

This slot is read-only.


6.2 Internals


6.2.1 Special variables

Special Variable: *templates*

The list of templates.

Package

mystic.

Source

mystic.lisp.


6.2.2 Ordinary functions

Function: config-pathname ()
Package

mystic.

Source

mystic.lisp.

Function: read-new-value ()
Package

mystic.

Source

mystic.lisp.


6.2.3 Generic functions

Generic Reader: config-path (condition)
Package

mystic.

Methods
Reader Method: config-path ((condition ask-about-value-from-config))
Source

mystic.lisp.

Target Slot

config-path.

Generic Reader: option-choices (object)
Package

mystic.

Methods
Reader Method: option-choices ((multiple-choice-option multiple-choice-option))

A list of strings.

Source

mystic.lisp.

Target Slot

choices.

Generic Reader: option-processor (object)
Package

mystic.

Methods
Reader Method: option-processor ((option option))

A function used to process the value given to the option.

Source

mystic.lisp.

Target Slot

processor.

Generic Reader: option-value (condition)
Package

mystic.

Methods
Reader Method: option-value ((condition bad-option-value))
Source

mystic.lisp.

Target Slot

value.

Reader Method: option-value ((condition ask-about-option-without-default))
Source

mystic.lisp.

Target Slot

value.

Reader Method: option-value ((condition ask-about-value-from-config))
Source

mystic.lisp.

Target Slot

value.

Generic Reader: option-value-problem (condition)
Package

mystic.

Methods
Reader Method: option-value-problem ((condition bad-option-value))
Source

mystic.lisp.

Target Slot

problem.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   C   F   G   L   M   O   P   R   S   T   V   W  
Index Entry  Section

C
config-path: Private generic functions
config-path: Private generic functions
config-pathname: Private ordinary functions

F
Function, config-pathname: Private ordinary functions
Function, list-templates: Public ordinary functions
Function, make-option: Public ordinary functions
Function, parse-comma-separated-list: Public ordinary functions
Function, parse-systems-list: Public ordinary functions
Function, read-new-value: Private ordinary functions
Function, read-template-file: Public ordinary functions
Function, register-template: Public ordinary functions
Function, render: Public ordinary functions
Function, render-string: Public ordinary functions
Function, strip-whitespace: Public ordinary functions
Function, write-file: Public ordinary functions

G
Generic Function, config-path: Private generic functions
Generic Function, option-choices: Private generic functions
Generic Function, option-default: Public generic functions
Generic Function, option-docstring: Public generic functions
Generic Function, option-name: Public generic functions
Generic Function, option-processor: Private generic functions
Generic Function, option-required-p: Public generic functions
Generic Function, option-title: Public generic functions
Generic Function, option-value: Private generic functions
Generic Function, option-value-problem: Private generic functions
Generic Function, render-template: Public generic functions
Generic Function, template-docstring: Public generic functions
Generic Function, template-name: Public generic functions
Generic Function, template-options: Public generic functions
Generic Function, validate-options: Public generic functions

L
list-templates: Public ordinary functions

M
make-option: Public ordinary functions
Method, config-path: Private generic functions
Method, option-choices: Private generic functions
Method, option-default: Public generic functions
Method, option-default: Public generic functions
Method, option-docstring: Public generic functions
Method, option-docstring: Public generic functions
Method, option-name: Public generic functions
Method, option-name: Public generic functions
Method, option-processor: Private generic functions
Method, option-required-p: Public generic functions
Method, option-title: Public generic functions
Method, option-value: Private generic functions
Method, option-value: Private generic functions
Method, option-value: Private generic functions
Method, option-value-problem: Private generic functions
Method, print-object: Public standalone methods
Method, template-docstring: Public generic functions
Method, template-name: Public generic functions
Method, template-options: Public generic functions
Method, validate-options: Public generic functions

O
option-choices: Private generic functions
option-choices: Private generic functions
option-default: Public generic functions
option-default: Public generic functions
option-default: Public generic functions
option-docstring: Public generic functions
option-docstring: Public generic functions
option-docstring: Public generic functions
option-name: Public generic functions
option-name: Public generic functions
option-name: Public generic functions
option-processor: Private generic functions
option-processor: Private generic functions
option-required-p: Public generic functions
option-required-p: Public generic functions
option-title: Public generic functions
option-title: Public generic functions
option-value: Private generic functions
option-value: Private generic functions
option-value: Private generic functions
option-value: Private generic functions
option-value-problem: Private generic functions
option-value-problem: Private generic functions

P
parse-comma-separated-list: Public ordinary functions
parse-systems-list: Public ordinary functions
print-object: Public standalone methods

R
read-new-value: Private ordinary functions
read-template-file: Public ordinary functions
register-template: Public ordinary functions
render: Public ordinary functions
render-string: Public ordinary functions
render-template: Public generic functions

S
strip-whitespace: Public ordinary functions

T
template-docstring: Public generic functions
template-docstring: Public generic functions
template-name: Public generic functions
template-name: Public generic functions
template-options: Public generic functions
template-options: Public generic functions

V
validate-options: Public generic functions
validate-options: Public generic functions

W
write-file: Public ordinary functions


A.4 Data types

Jump to:   A   B   C   F   M   O   P   S   T   U  
Index Entry  Section

A
ask-about-defaults: Public conditions
ask-about-option-without-default: Public conditions
ask-about-value-from-config: Public conditions

B
bad-option-value: Public conditions
base-option-condition: Public conditions
boolean-option: Public classes

C
Class, boolean-option: Public classes
Class, multiple-choice-option: Public classes
Class, option: Public classes
Class, prompt-option: Public classes
Class, template: Public classes
Condition, ask-about-defaults: Public conditions
Condition, ask-about-option-without-default: Public conditions
Condition, ask-about-value-from-config: Public conditions
Condition, bad-option-value: Public conditions
Condition, base-option-condition: Public conditions
Condition, missing-required-option: Public conditions

F
File, mystic.asd: The mystic/mystic․asd file
File, mystic.lisp: The mystic/src/mystic․lisp file
File, util.lisp: The mystic/src/util․lisp file

M
missing-required-option: Public conditions
Module, src: The mystic/src module
multiple-choice-option: Public classes
mystic: The mystic system
mystic: The mystic package
mystic.asd: The mystic/mystic․asd file
mystic.lisp: The mystic/src/mystic․lisp file
mystic.util: The mystic․util package

O
option: Public classes

P
Package, mystic: The mystic package
Package, mystic.util: The mystic․util package
prompt-option: Public classes

S
src: The mystic/src module
System, mystic: The mystic system

T
template: Public classes

U
util.lisp: The mystic/src/util․lisp file