- Description: A bunch of Mystic templates to create
CLlibrary, web-project,APImicroservice andCLIcommand. - Licence: Unlicense
- Author: Alexander Artemenko svetlyak.40wt@gmail.com
- Homepage: https://40ants.com/project-templates/
- Bug tracker: https://github.com/40ants/project-templates/issues
- Source control: GIT
- Depends on: alexandria, cl-ppcre, mystic, mystic-file-mixin, str
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)
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/")
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.
: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- GitHubURL. The project'sURLon the GitHub.:HOMEPAGE- Homepage.URLof 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.
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.
: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- GitHubURL. The project'sURLon the GitHub.:HOMEPAGE- Homepage.URLof 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.
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:
APImethods created usingopenrpc-serversystem.- Open
RPCspecification at /openrpc.jsonURI. - Logging, configured to output data in
JSONformat. - Optional
SLYNKserver running on port given asSLYNK_PORTenv variable.
Use 40ants-project-templates:create-jsonrpc-app function to generate a skeleton
for a new web service.
: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- GitHubURL. The project'sURLon the GitHub.:HOMEPAGE- Homepage.URLof 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.
class 40ants-project-templates/mixin/ci:ci-mixin (file-mixin)
Adds docs based on 40ants-docs.
class 40ants-project-templates/mixin/clpm:clpm-mixin (file-mixin)
Adds clpmfile into the root of the project.
class 40ants-project-templates/mixin/docs:docs-mixin (file-mixin)
Adds docs based on 40ants-docs.
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.
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.
class 40ants-project-templates/mixin/rove-tests:rove-tests-mixin (file-mixin)
Adds tests based on Rove.
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.