From d7f599a0d15e79a656dd503e817caed0b4a0fc26 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sat, 12 Apr 2025 12:22:43 -0700 Subject: [PATCH] updating manual and function --- docs/manual.scr | 3 ++- mcodex.lisp | 14 ++++++++++++-- package.lisp | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/manual.scr b/docs/manual.scr index 42ddd1f..129e930 100644 --- a/docs/manual.scr +++ b/docs/manual.scr @@ -4,6 +4,7 @@ This is the top-level for my various lisp projects. @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.) @end(list) @@ -24,4 +25,4 @@ documentation. @cl:doc(function build-and-publish) ) -@end(section) \ No newline at end of file +@end(section) diff --git a/mcodex.lisp b/mcodex.lisp index f39fc87..5527449 100644 --- a/mcodex.lisp +++ b/mcodex.lisp @@ -11,7 +11,11 @@ (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.") (defparameter *top-level* "/srv/www/codex/" "Default remote base directory for deployed documentation.") @@ -148,7 +152,8 @@ Notes: (error "Package name must not be empty")) (if (string-equal pkg-str "mcodex") *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*) (site (format nil "web.metacircular.net:~A" (mcodex-path))) @@ -200,14 +205,17 @@ Notes: (defun build-and-publish (&optional (package (package-name *package*))) "Build and publish a site for PACKAGE with a package-specific remote path. + Parameters: PACKAGE (string or symbol, optional): The package or system to document and deploy. Defaults to the current package’s name (via `package-name` and `*package*`). + Returns: `nil` if the build and deployment succeed, or `nil` if either fails, with errors printed to `*error-output*`. + Description: 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*` @@ -215,10 +223,12 @@ Description: Simplifies deployment for clients who want package-specific paths (e.g., /srv/www/codex/test/ for :test) without specifying paths manually. + Example: (build-and-publish) ; Builds and deploys to .../codex/ for mcodex. (build-and-publish \"test\") ; Builds and deploys to .../codex/test/. + Notes: - Assumes `publish-site` and `mcodex-path` are available. - Inherits `publish-site`’s requirements (Codex, rsync, SSH). diff --git a/package.lisp b/package.lisp index 24ad060..833f449 100644 --- a/package.lisp +++ b/package.lisp @@ -3,6 +3,7 @@ (defpackage #:mcodex (:use #:cl) (:export #:rsync + #:doc-path #:build-site #:deploy-site #:publish-site