40ants-project-templates

40ANTS-PROJECT-TEMPLATES ASDF System Details

Installation

You can install this library from Quicklisp, but you want to receive updates quickly, then install it from Ultralisp.org:

(ql-dist:install-dist "http://dist.ultralisp.org/"
                      :prompt nil)
(ql:quickload :40ants-project-templates)

Usage

This library provides following template classes:

To create new projects out of these templates, use functions create-library and create-reblocks-app:

CL-USER> (40ants-project-templates:create-reblocks-app
          #P"/tmp/my-web-app/"
          "my-web-app"
          "My experimental web application")

Optionally, you can give :REQUEST-ALL-OPTIONS-P T argument to force Mystic to ask about all template option including optional.

Also, you can use more generic MYSTIC:RENDER function and pass arguments as a list:

CL-USER> (mystic:list-templates)
(#<40ANTS-PROJECT-TEMPLATES/REBLOCKS-APP:REBLOCKS-APP-TEMPLATE {7010EACC03}>
 #<40ANTS-PROJECT-TEMPLATES/LIBRARY:LIBRARY-TEMPLATE {7010EACC23}>)

CL-USER> (first *)
#<40ANTS-PROJECT-TEMPLATES/REBLOCKS-APP:REBLOCKS-APP-TEMPLATE {7010EACC03}>

CL-USER> (mystic:render *
                        (list :name "my-web-app"
                              :author "John Doe")
                        #P"/tmp/my-web-app/")

Templates

CL Library

Mystic template to create a Common Lisp library with documentation, tests and continuous integration.

Use 40ants-project-templates:create-library function to generate a skeleton for a new CL library.

Included mixins

Options

  • :AUTHOR - Author. Required. The project author's name.

  • :NAME - Name. Required. The project's name.

  • :DESCRIPTION - Description. A short, one-line description of the project.

  • :DOC-THEME - Documentation Theme. A theme name in the form of the fully specified symbol name (as a string). Example: 40ants-doc-theme-40ants:40ants-theme.

  • :EMAIL - Email. The project author's email.

  • :GITHUB - GitHub URL. The project's URL on the GitHub.

  • :HOMEPAGE - Homepage. URL of the project's homepage.

  • :LICENSE - License. Default: "BSD". The project's license string, e.g. 'MIT', 'GPLv3'.

function
directory-path name description &key request-all-options

Creates Common Lisp library in the specified directory.

Pass :REQUEST-ALL-OPTIONS T to fill all optional options or use more generic call to MYSTIC:RENDER function to pass any options you like as a list.

Should return a file object, which creates main lisp file.

Use make-file function to create a mystic.template.file:file object.

Should return a file object, which creates {{ name }}.asd file.

Reblocks Web App

This template creates a Reblocks web application with a few simple widgets.

Other behaviour is inherited from library-template.

Use 40ants-project-templates:create-reblocks-app function to generate a skeleton for a new web service.

Options

  • :AUTHOR - Author. Required. The project author's name.

  • :NAME - Name. Required. The project's name.

  • :DESCRIPTION - Description. A short, one-line description of the project.

  • :DOC-THEME - Documentation Theme. A theme name in the form of the fully specified symbol name (as a string). Example: 40ants-doc-theme-40ants:40ants-theme.

  • :EMAIL - Email. The project author's email.

  • :GITHUB - GitHub URL. The project's URL on the GitHub.

  • :HOMEPAGE - Homepage. URL of the project's homepage.

  • :LICENSE - License. Default: "BSD". The project's license string, e.g. 'MIT', 'GPLv3'.

function
directory-path name description &key request-all-options

Creates Common Lisp web application in the specified directory.

Pass :REQUEST-ALL-OPTIONS T to fill all optional options or use more generic call to MYSTIC:RENDER function to pass any options you like as a list.

JSON-RPC API Server

This template creates a JSON-RPC API server.

Other behaviour is inherited from library-template. This server will provide:

  • API methods created using openrpc-server system.

  • OpenRPC specification at /openrpc.json URI.

  • Logging, configured to output data in JSON format.

  • Optional SLYNK server running on port given as SLYNK_PORT env variable.

Use 40ants-project-templates:create-jsonrpc-app function to generate a skeleton for a new web service.

Options

  • :AUTHOR - Author. Required. The project author's name.

  • :NAME - Name. Required. The project's name.

  • :DESCRIPTION - Description. A short, one-line description of the project.

  • :DOC-THEME - Documentation Theme. A theme name in the form of the fully specified symbol name (as a string). Example: 40ants-doc-theme-40ants:40ants-theme.

  • :EMAIL - Email. The project author's email.

  • :GITHUB - GitHub URL. The project's URL on the GitHub.

  • :HOMEPAGE - Homepage. URL of the project's homepage.

  • :LICENSE - License. Default: "BSD". The project's license string, e.g. 'MIT', 'GPLv3'.

function
directory-path name description &key request-all-options

Creates Common Lisp RPC API application in the specified directory.

Pass :REQUEST-ALL-OPTIONS T to fill all optional options or use more generic call to MYSTIC:RENDER function to pass any options you like as a list.

Mixins

CI

CLPM

Adds clpmfile into the root of the project.

Docs

Gitignore

Adds .gitignore into the root of the project.

Default list of patterns which returned by patterns-to-ignore generic function.

Should return a list of patterns to add to .gitignore. Default method takes them from *patterns* variable.

Qlfile

Adds qlfile into the root of the project.

Returns a list of strings which will be concatentated to build a qlfile.

Rove Tests

Utilities

A Mystic template mixin for rendering a list of files using Mustache.

The file's contents, a Mustache template string.

The path to the file relative to the directory, a Mustache template string.

function
system-name path output-path-template

Appends options description to the documentation string of a given template class.

Options are sorted by their keyword argument name but "required" go before optional.

Wrap this function call with EVAL-WHEN if calling it as a toplevel form.

Warning, this function trims all leading whitespaces from lines of original template class docstrings.