updating manual and function

This commit is contained in:
Kyle Isom 2025-04-12 12:22:43 -07:00
parent 8e20ab7bd7
commit d7f599a0d1
3 changed files with 15 additions and 3 deletions

View File

@ -4,6 +4,7 @@
This is the top-level for my various lisp projects. This is the top-level for my various lisp projects.
@begin(list) @begin(list)
@item(@link[uri="/binary/"](binary) - functions for reading and writing integers from binary streams.)
@item(@link[uri="/kutils/"](kutils) - my personal utility library.) @item(@link[uri="/kutils/"](kutils) - my personal utility library.)
@end(list) @end(list)

View File

@ -11,7 +11,11 @@
(in-package :mcodex) (in-package :mcodex)
(defparameter *doc-path* "docs/build/mcodex/html/" (defun doc-path (&optional (package (package-name *package*)))
"Return the default documentation path for the current package."
(format nil "docs/build/~a/html/" (string-downcase package)))
(defparameter *doc-path* (doc-path)
"Default local directory for Codex-generated documentation.") "Default local directory for Codex-generated documentation.")
(defparameter *top-level* "/srv/www/codex/" (defparameter *top-level* "/srv/www/codex/"
"Default remote base directory for deployed documentation.") "Default remote base directory for deployed documentation.")
@ -148,7 +152,8 @@ Notes:
(error "Package name must not be empty")) (error "Package name must not be empty"))
(if (string-equal pkg-str "mcodex") (if (string-equal pkg-str "mcodex")
*top-level* *top-level*
(format nil "~A~A/" *top-level* pkg-str)))) (uiop:ensure-directory-pathname
(format nil "~A~A/" *top-level* pkg-str)))))
(defun publish-site (&key (path *doc-path*) (defun publish-site (&key (path *doc-path*)
(site (format nil "web.metacircular.net:~A" (mcodex-path))) (site (format nil "web.metacircular.net:~A" (mcodex-path)))
@ -200,14 +205,17 @@ Notes:
(defun build-and-publish (&optional (package (package-name *package*))) (defun build-and-publish (&optional (package (package-name *package*)))
"Build and publish a site for PACKAGE with a package-specific remote path. "Build and publish a site for PACKAGE with a package-specific remote path.
Parameters: Parameters:
PACKAGE (string or symbol, optional): The package or system to document and deploy. PACKAGE (string or symbol, optional): The package or system to document and deploy.
Defaults to the current packages name (via `package-name` and `*package*`). Defaults to the current packages name (via `package-name` and `*package*`).
Returns: Returns:
`nil` if the build and deployment succeed, or `nil` if either fails, with errors printed `nil` if the build and deployment succeed, or `nil` if either fails, with errors printed
to `*error-output*`. to `*error-output*`.
Description: Description:
A high-level wrapper around `publish-site` that uses `mcodex-path` to determine the A high-level wrapper around `publish-site` that uses `mcodex-path` to determine the
remote deployment path based on PACKAGE. Calls `publish-site` with default `*doc-path*` remote deployment path based on PACKAGE. Calls `publish-site` with default `*doc-path*`
@ -215,10 +223,12 @@ Description:
Simplifies deployment for clients who want package-specific paths (e.g., /srv/www/codex/test/ Simplifies deployment for clients who want package-specific paths (e.g., /srv/www/codex/test/
for :test) without specifying paths manually. for :test) without specifying paths manually.
Example: Example:
(build-and-publish) ; Builds and deploys to .../codex/ for mcodex. (build-and-publish) ; Builds and deploys to .../codex/ for mcodex.
(build-and-publish \"test\") ; Builds and deploys to .../codex/test/. (build-and-publish \"test\") ; Builds and deploys to .../codex/test/.
Notes: Notes:
- Assumes `publish-site` and `mcodex-path` are available. - Assumes `publish-site` and `mcodex-path` are available.
- Inherits `publish-site`s requirements (Codex, rsync, SSH). - Inherits `publish-site`s requirements (Codex, rsync, SSH).

View File

@ -3,6 +3,7 @@
(defpackage #:mcodex (defpackage #:mcodex
(:use #:cl) (:use #:cl)
(:export #:rsync (:export #:rsync
#:doc-path
#:build-site #:build-site
#:deploy-site #:deploy-site
#:publish-site #:publish-site