Skip to content

Commit

Permalink
Autobuilder now passes unknown arguments to the docs-builder:build fu…
Browse files Browse the repository at this point in the history
…nction.
  • Loading branch information
svetlyak40wt committed Dec 14, 2024
1 parent 6daab71 commit df50bd8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/docs/
/.qlot/
README
*.fasl
18 changes: 15 additions & 3 deletions src/autobuilder.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
(:import-from #:fs-watcher)
(:import-from #:trivial-open-browser
#:open-browser)
(:import-from #:alexandria
#:remove-from-plistf)
(:export #:build
#:stop))
(in-package #:docs-autobuilder)
Expand Down Expand Up @@ -67,10 +69,17 @@
(subseq file 0 (length root))))))


(defun build (system &key in-thread port (interface "localhost"))
(defun build (system &rest rest-args
&key in-thread port (interface "localhost")
&allow-other-keys)
(when *server*
(error "Server already running."))

(remove-from-plistf rest-args
:in-thread
:port
:interface)

(let* ((system-path (asdf:system-relative-pathname system "./"))
(docs-path (handler-bind ((docs-builder:documentation-has-problems
(lambda (c)
Expand All @@ -88,7 +97,9 @@
:address interface)))
(url (format nil "http://~A:~A/"
interface port)))
(open-browser url)

(with-simple-restart (skip-opening-the-browser "Skip opening the browser")
(open-browser url))

(labels ((build-system (changed-file)
(cond
Expand All @@ -105,7 +116,8 @@
(handler-case
(progn
(ql:quickload system)
(docs-builder:build system))
(apply #'docs-builder:build system
rest-args))
(docs-builder:documentation-has-problems (c)
(log:error "Unable to build docs for ~A system. ~A"
system c))
Expand Down

0 comments on commit df50bd8

Please sign in to comment.