Skip to content

A bunch of Mystic templates to create CL library, web-project, API microservice and CLI command.

Notifications You must be signed in to change notification settings

40ants/project-templates

Repository files navigation

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

class 40ants-project-templates/library:library-template (qlfile-mixin clpm-mixin docs-mixin ci-mixin rove-tests-mixin gitignore-mixin file-mixin)

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 40ants-project-templates:create-library 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.

generic-function 40ants-project-templates/library:make-core-file template

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

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

generic-function 40ants-project-templates/library:make-system-file template

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

Reblocks Web App

class 40ants-project-templates/reblocks-app:reblocks-app-template (library-template)

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 40ants-project-templates:create-reblocks-app 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

class 40ants-project-templates/jsonrpc-app:jsonrpc-app-template (library-template)

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 40ants-project-templates:create-jsonrpc-app 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

class 40ants-project-templates/mixin/ci:ci-mixin (file-mixin)

Adds docs based on 40ants-docs.

CLPM

class 40ants-project-templates/mixin/clpm:clpm-mixin (file-mixin)

Adds clpmfile into the root of the project.

Docs

class 40ants-project-templates/mixin/docs:docs-mixin (file-mixin)

Adds docs based on 40ants-docs.

Gitignore

class 40ants-project-templates/mixin/gitignore:gitignore-mixin ()

Adds .gitignore into the root of the project.

variable 40ants-project-templates/mixin/gitignore:*patterns* ("~" ".#" ".*.undo-tree")

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

generic-function 40ants-project-templates/mixin/gitignore:patterns-to-ignore template

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

Qlfile

class 40ants-project-templates/mixin/qlfile:qlfile-mixin (file-mixin)

Adds qlfile into the root of the project.

generic-function 40ants-project-templates/mixin/qlfile:qlfile-pieces template

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

Rove Tests

class 40ants-project-templates/mixin/rove-tests:rove-tests-mixin (file-mixin)

Adds tests based on Rove.

Utilities

class mystic.template.file:file-mixin (template)

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

class mystic.template.file:file ()

A file.

reader mystic.template.file:file-content (file) (:content)

The file's contents, a Mustache template string.

reader mystic.template.file:file-path (file) (:path)

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

function mystic.template.file:make-file system-name path output-path-template

function 40ants-project-templates/utils:ensure-template-docstring-has-options-description CLASS-NAME &KEY (TITLE "## Options")

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.


[generated by 40ANTS-DOC]

About

A bunch of Mystic templates to create CL library, web-project, API microservice and CLI command.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published