diff --git a/40ants-doc.asd b/40ants-doc.asd index 977c0977..bc401ace 100644 --- a/40ants-doc.asd +++ b/40ants-doc.asd @@ -19,6 +19,10 @@ (asdf:register-system-packages "common-html" '("COMMON-HTML.EMITTER")) +(asdf:register-system-packages "common-doc" '("COMMON-DOC.OPS" + "COMMON-DOC.FORMAT")) + +(asdf:register-system-packages "log4cl" '("LOG")) (asdf:register-system-packages "3bmd-ext-code-blocks" '("3BMD-CODE-BLOCKS")) diff --git a/src/args.lisp b/src/args.lisp index 5cbd4e70..ecd9f706 100644 --- a/src/args.lisp +++ b/src/args.lisp @@ -1,7 +1,5 @@ (defpackage #:40ants-doc/args - (:use #:cl) - (:import-from #:40ants-doc/page) - (:import-from #:40ants-doc/reference)) + (:use #:cl)) (in-package 40ants-doc/args) diff --git a/src/builder.lisp b/src/builder.lisp index fad76406..a509d800 100644 --- a/src/builder.lisp +++ b/src/builder.lisp @@ -1,9 +1,8 @@ (uiop:define-package #:40ants-doc/builder (:use #:cl) - (:import-from #:dexador) - (:import-from #:alexandria - #:assoc-value) + ;; NO LINT (:import-from #:3bmd) + ;; NO LINT (:import-from #:3bmd-code-blocks) (:import-from #:named-readtables) (:import-from #:pythonic-string-reader) @@ -12,7 +11,6 @@ (:import-from #:40ants-doc/page #:page-base-dir #:page-format) - (:import-from #:40ants-doc/utils) (:import-from #:40ants-doc/builder/printer) (:import-from #:40ants-doc #:defsection) @@ -25,12 +23,24 @@ (:import-from #:40ants-doc/search) (:import-from #:40ants-doc/commondoc/transcribe) (:import-from #:40ants-doc/changelog) + (:import-from #:40ants-doc/commondoc/changelog) + (:import-from #:40ants-doc/commondoc/section) + (:import-from #:40ants-doc/commondoc/xref) (:import-from #:40ants-doc/commondoc/image) - (:import-from #:40ants-doc/reference - #:make-external-reference) (:import-from #:40ants-doc/external-index #:write-references-index) (:import-from #:40ants-doc/commondoc/reference) + (:import-from #:40ants-doc/commondoc/builder + #:to-commondoc) + (:import-from #:40ants-doc/link) + (:import-from #:40ants-doc/rewrite) + (:import-from #:40ants-doc/themes/api) + (:import-from #:common-doc) + (:import-from #:common-doc.format) + (:import-from #:common-html) + (:import-from #:common-html.emitter) + (:import-from #:commondoc-markdown) + (:export #:*document-html-top-blocks-of-links* #:*document-html-bottom-blocks-of-links* @@ -238,10 +248,8 @@ (40ants-doc/reference-api:*source-uri-fn* source-uri-fn)) (40ants-doc/commondoc/format:with-format (format) - (let* ((document - (40ants-doc/commondoc/builder:to-commondoc object)) - (processed-document - (process-document document)) + (let* ((document (to-commondoc object)) + (processed-document (process-document document)) (40ants-doc/builder/printer::*full-package-names* full-package-names)) (with-output-to-string (stream) (common-doc.format:emit-document (make-instance format) @@ -328,9 +336,7 @@ (40ants-doc/themes/api::with-theme (theme) (let* ((sections (uiop:ensure-list sections)) (pages (mapcar #'40ants-doc/page:ensure-page sections)) - (page-documents (mapcar - #'40ants-doc/commondoc/builder:to-commondoc - pages))) + (page-documents (mapcar #'to-commondoc pages))) (multiple-value-bind (full-document references) (process-document (common-doc:make-document "Documentation" :children page-documents) diff --git a/src/builder/printer.lisp b/src/builder/printer.lisp index ec8e44ba..4fe5e5b5 100644 --- a/src/builder/printer.lisp +++ b/src/builder/printer.lisp @@ -2,9 +2,6 @@ (:use #:cl) (:import-from #:named-readtables) (:import-from #:pythonic-string-reader) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/core - #:defsection) (:export #:*document-uppercase-is-code*)) (in-package 40ants-doc/builder/printer) diff --git a/src/commondoc/arglist.lisp b/src/commondoc/arglist.lisp index 9b6c9209..030f2991 100644 --- a/src/commondoc/arglist.lisp +++ b/src/commondoc/arglist.lisp @@ -1,7 +1,9 @@ (uiop:define-package #:40ants-doc/commondoc/arglist (:use #:cl) (:import-from #:common-doc) + (:import-from #:common-doc.format) (:import-from #:common-html.emitter) + (:import-from #:commondoc-markdown) (:import-from #:spinneret #:with-html) (:import-from #:40ants-doc/utils diff --git a/src/commondoc/builder.lisp b/src/commondoc/builder.lisp index ffbf5563..cd57e221 100644 --- a/src/commondoc/builder.lisp +++ b/src/commondoc/builder.lisp @@ -2,9 +2,9 @@ (:use #:cl) (:import-from #:40ants-doc/commondoc/markdown #:parse-markdown) - (:import-from #:40ants-doc/utils) (:import-from #:40ants-doc/object-package) (:import-from #:40ants-doc/docstring) + (:import-from #:40ants-doc/reference) (:export #:to-commondoc #:reference-to-commondoc)) (in-package 40ants-doc/commondoc/builder) diff --git a/src/commondoc/bullet.lisp b/src/commondoc/bullet.lisp index a2891587..605e527b 100644 --- a/src/commondoc/bullet.lisp +++ b/src/commondoc/bullet.lisp @@ -12,7 +12,11 @@ #:with-tag) (:import-from #:40ants-doc/render/args #:arglist-to-string) + (:import-from #:common-doc) + (:import-from #:spinneret) (:import-from #:40ants-doc/commondoc/arglist) + (:import-from #:40ants-doc/reference) + (:import-from #:40ants-doc/reference-api) (:import-from #:40ants-doc/ignored-words #:ignored-words) (:import-from #:40ants-doc/dislocated-symbols @@ -25,6 +29,8 @@ (:import-from #:commondoc-markdown/emitter #:hash-link) (:import-from #:40ants-doc/builder/printer) + (:import-from #:common-doc.format + #:emit-document) (:export #:make-bullet)) (in-package 40ants-doc/commondoc/bullet) @@ -150,9 +156,9 @@ (common-doc::children obj)))))))) -(defmethod common-doc.format:emit-document ((format commondoc-markdown:markdown) - (node bullet) - stream) +(defmethod emit-document ((format commondoc-markdown:markdown) + (node bullet) + stream) (let* ((reference (doc-reference node)) (arglists (bullet-arglist node)) (locative-type (string-downcase diff --git a/src/commondoc/changelog.lisp b/src/commondoc/changelog.lisp index 2fe79bf5..38cb05bc 100644 --- a/src/commondoc/changelog.lisp +++ b/src/commondoc/changelog.lisp @@ -8,6 +8,10 @@ (:import-from #:40ants-doc/changelog) (:import-from #:alexandria #:when-let) + (:import-from #:common-html) + (:import-from #:common-doc) + (:import-from #:common-doc.ops) + (:import-from #:common-doc.format) (:import-from #:local-time #:parse-timestring #:format-rfc1123-timestring) diff --git a/src/commondoc/format.lisp b/src/commondoc/format.lisp index d30cb859..adb5e1cc 100644 --- a/src/commondoc/format.lisp +++ b/src/commondoc/format.lisp @@ -1,5 +1,7 @@ (uiop:define-package #:40ants-doc/commondoc/format (:use #:cl) + (:import-from #:common-html) + (:import-from #:commondoc-markdown) (:export #:with-format #:current-files-extension #:files-extension diff --git a/src/commondoc/image.lisp b/src/commondoc/image.lisp index 4a3d2ab0..1695cb77 100644 --- a/src/commondoc/image.lisp +++ b/src/commondoc/image.lisp @@ -3,6 +3,8 @@ (:import-from #:common-html.emitter #:define-emitter) (:import-from #:str) + (:import-from #:log) + (:import-from #:common-doc) (:import-from #:40ants-doc/commondoc/html #:with-html) (:import-from #:40ants-doc/commondoc/page @@ -12,7 +14,9 @@ (:import-from #:cl-ppcre #:do-register-groups) (:import-from #:40ants-doc/builder/vars - #:*current-asdf-system*)) + #:*current-asdf-system*) + (:import-from #:40ants-doc/commondoc/mapper + #:map-nodes)) (in-package 40ants-doc/commondoc/image) (defclass local-image (common-doc:image) @@ -54,7 +58,7 @@ :width width :height height))))) (t node)))) - (40ants-doc/commondoc/mapper:map-nodes document #'replacer))) + (map-nodes document #'replacer))) (defun extract-width-and-height (path) "Returns 3 values, real path, width and height. Width and height might be NIL. diff --git a/src/commondoc/mapper.lisp b/src/commondoc/mapper.lisp index 9ac59408..dbab1c13 100644 --- a/src/commondoc/mapper.lisp +++ b/src/commondoc/mapper.lisp @@ -1,7 +1,10 @@ (defpackage #:40ants-doc/commondoc/mapper (:use #:cl) (:import-from #:common-doc) + (:import-from #:common-doc.ops) (:import-from #:40ants-doc/commondoc/bullet) + (:import-from #:40ants-doc/object-package + #:object-package) (:export #:map-nodes #:node-supports-children @@ -37,7 +40,7 @@ (defun call-with-node-package (func) (let ((packages-stack nil)) (flet ((set-package (node) - (let ((package (or (40ants-doc/object-package::object-package node) + (let ((package (or (object-package node) *package*))) (push *package* packages-stack) (setf *package* package))) diff --git a/src/commondoc/markdown.lisp b/src/commondoc/markdown.lisp index d0385c22..e36d4d32 100644 --- a/src/commondoc/markdown.lisp +++ b/src/commondoc/markdown.lisp @@ -1,10 +1,16 @@ (uiop:define-package #:40ants-doc/commondoc/markdown (:use #:cl) - (:import-from #:commondoc-markdown) + (:import-from #:str) + (:import-from #:commondoc-markdown + #:markdown-link) (:import-from #:common-doc) + (:import-from #:common-doc.ops) + (:import-from #:common-doc.format) (:import-from #:40ants-doc/commondoc/xref) (:import-from #:40ants-doc/commondoc/mapper #:node-supports-children) + (:import-from #:40ants-doc/swank + #:read-locative-from-string) (:export #:parse-markdown)) (in-package 40ants-doc/commondoc/markdown) @@ -31,15 +37,15 @@ "Replaces unresolved markdown nodes with XREF objects." (flet ((replacer (node) (cond - ((typep node 'commondoc-markdown::markdown-link) + ((typep node 'markdown-link) (let* ((children (common-doc:children node))) (let* ((text (common-doc.ops:collect-all-text children)) - (symbol (40ants-doc/swank::read-locative-from-string text)) + (symbol (read-locative-from-string text)) (locative-name (commondoc-markdown:markdown-link-definition node)) (locative (when locative-name - (40ants-doc/swank::read-locative-from-string locative-name - :package (find-package "40ANTS-DOC/LOCATIVES"))))) + (read-locative-from-string locative-name + :package (find-package "40ANTS-DOC/LOCATIVES"))))) (40ants-doc/commondoc/xref:make-xref text :symbol symbol :locative locative)))) diff --git a/src/commondoc/page.lisp b/src/commondoc/page.lisp index 303c58fb..47fd8e0b 100644 --- a/src/commondoc/page.lisp +++ b/src/commondoc/page.lisp @@ -4,16 +4,20 @@ #:make-code #:make-text #:make-web-link) + (:import-from #:common-doc.ops) + (:import-from #:str) (:import-from #:common-html.emitter) + (:import-from #:40ants-doc/commondoc/xref) + (:import-from #:40ants-doc/locatives) + (:import-from #:40ants-doc/reference) + (:import-from #:common-html) (:import-from #:40ants-doc/commondoc/html #:with-html) (:import-from #:common-html.emitter #:define-emitter) - (:import-from #:40ants-doc/commondoc/bullet) (:import-from #:40ants-doc/commondoc/section #:documentation-section #:section-definition) - (:import-from #:40ants-doc/reference-api) (:import-from #:40ants-doc/commondoc/mapper #:current-path #:with-node-path) @@ -44,8 +48,6 @@ #:supports-dislocated-symbols-p) (:import-from #:40ants-doc/themes/api #:with-page-template) - (:import-from #:alexandria - #:when-let) (:import-from #:40ants-doc #:section-external-docs) (:export #:make-page diff --git a/src/commondoc/piece.lisp b/src/commondoc/piece.lisp index a9ceac3c..27e849ff 100644 --- a/src/commondoc/piece.lisp +++ b/src/commondoc/piece.lisp @@ -1,6 +1,5 @@ (uiop:define-package #:40ants-doc/commondoc/piece (:use #:cl) - (:import-from #:40ants-doc/utils) (:import-from #:40ants-doc/reference) (:import-from #:40ants-doc/object-package)) (in-package 40ants-doc/commondoc/piece) diff --git a/src/commondoc/reference.lisp b/src/commondoc/reference.lisp index ba09704a..a5085d52 100644 --- a/src/commondoc/reference.lisp +++ b/src/commondoc/reference.lisp @@ -15,7 +15,9 @@ (:import-from #:40ants-doc/commondoc/page #:page) (:import-from #:40ants-doc/reference - #:reference=)) + #:reference=) + (:import-from #:40ants-doc/commondoc/mapper + #:map-nodes)) (in-package 40ants-doc/commondoc/reference) @@ -52,7 +54,7 @@ :key #'car :test #'reference=))) node)) - (40ants-doc/commondoc/mapper:map-nodes node #'collector - :on-going-down #'track-page)) + (map-nodes node #'collector + :on-going-down #'track-page)) results) diff --git a/src/commondoc/section.lisp b/src/commondoc/section.lisp index f290ee59..296a8e86 100644 --- a/src/commondoc/section.lisp +++ b/src/commondoc/section.lisp @@ -2,6 +2,9 @@ (:use #:cl) (:import-from #:40ants-doc) (:import-from #:common-doc) + (:import-from #:common-doc.ops) + (:import-from #:common-doc.format) + (:import-from #:commondoc-markdown) (:import-from #:40ants-doc/commondoc/html #:with-html) (:import-from #:common-html.emitter @@ -25,6 +28,14 @@ #:reference-object) (:import-from #:40ants-doc/object-package #:object-package) + (:import-from #:40ants-doc/commondoc/builder + #:to-commondoc) + (:import-from #:40ants-doc/commondoc/mapper + #:map-nodes) + (:import-from #:40ants-doc/reference-api + #:canonical-reference) + (:import-from #:str + #:param-case) (:export #:documentation-section #:section-definition @@ -46,7 +57,7 @@ (defun make-section-body (section) (loop for entry in (40ants-doc:section-entries section) - collect (40ants-doc/commondoc/builder:to-commondoc entry))) + collect (to-commondoc entry))) (defun make-section-with-reference (title children reference) @@ -76,13 +87,13 @@ title-text))) (children (make-section-body section))) - (let* ((reference (40ants-doc/reference-api::canonical-reference section)) + (let* ((reference (canonical-reference section)) (html-fragment (40ants-doc/utils::html-safe-name (40ants-doc/reference::reference-to-anchor reference)))) (make-instance class-name :definition section - :doc-reference (40ants-doc/reference-api::canonical-reference + :doc-reference (canonical-reference section) :title title :reference html-fragment @@ -98,7 +109,7 @@ (40ants-doc::section-ignore-words definition))) -(defmethod 40ants-doc/commondoc/builder:to-commondoc ((obj 40ants-doc:section)) +(defmethod to-commondoc ((obj 40ants-doc:section)) (make-documentation-section obj)) @@ -150,8 +161,8 @@ (not (common-doc:reference node))) (let* ((title (common-doc:title node)) (text (common-doc.ops:collect-all-text title)) - (reference (str:param-case text))) + (reference (param-case text))) (setf (common-doc:reference node) reference))) node)) - (40ants-doc/commondoc/mapper:map-nodes document #'fill-fragments))) + (map-nodes document #'fill-fragments))) diff --git a/src/commondoc/toc.lisp b/src/commondoc/toc.lisp index 168a8bc0..7c11826c 100644 --- a/src/commondoc/toc.lisp +++ b/src/commondoc/toc.lisp @@ -1,15 +1,17 @@ (uiop:define-package #:40ants-doc/commondoc/toc (:use #:cl) - (:import-from #:40ants-doc/commondoc/section) (:import-from #:40ants-doc/utils #:make-relative-path) (:import-from #:40ants-doc/commondoc/page #:full-filename #:base-filename) (:import-from #:40ants-doc/page) + (:import-from #:common-doc) (:import-from #:40ants-doc/commondoc/format) (:import-from #:40ants-doc/rewrite) (:import-from #:40ants-doc/commondoc/changelog) + (:import-from #:40ants-doc/commondoc/mapper + #:map-nodes) (:export #:make-toc)) (in-package 40ants-doc/commondoc/toc) @@ -79,9 +81,9 @@ (setf inside-changelog nil)) (common-doc:section (pop current-sublist))))) - (40ants-doc/commondoc/mapper:map-nodes document #'collector - :on-going-down #'on-down - :on-going-up #'on-up)) + (map-nodes document #'collector + :on-going-down #'on-down + :on-going-up #'on-up)) (assert (= (length current-sublist) 1)) (flet ((remove-empty-sublists (node) @@ -91,8 +93,8 @@ unless (null (common-doc:children child)) collect child))) node)) - (40ants-doc/commondoc/mapper:map-nodes (car current-sublist) - #'remove-empty-sublists)))) + (map-nodes (car current-sublist) + #'remove-empty-sublists)))) (defmethod 40ants-doc/commondoc/page:make-page-toc ((obj 40ants-doc/commondoc/page:page)) diff --git a/src/commondoc/transcribe.lisp b/src/commondoc/transcribe.lisp index ca6cf136..d0697b15 100644 --- a/src/commondoc/transcribe.lisp +++ b/src/commondoc/transcribe.lisp @@ -1,5 +1,7 @@ (defpackage #:40ants-doc/commondoc/transcribe (:use #:cl) + (:import-from #:common-doc) + (:import-from #:common-doc.ops) (:import-from #:40ants-doc/transcribe) (:import-from #:40ants-doc/commondoc/mapper #:with-node-package)) diff --git a/src/commondoc/utils.lisp b/src/commondoc/utils.lisp index 0696c780..1e025d1c 100644 --- a/src/commondoc/utils.lisp +++ b/src/commondoc/utils.lisp @@ -6,6 +6,7 @@ (:import-from #:40ants-doc/docstring #:*whitespace-chars*) (:import-from #:str) + (:import-from #:common-doc) (:import-from #:40ants-doc/commondoc/mapper #:map-nodes) (:export)) diff --git a/src/commondoc/xref.lisp b/src/commondoc/xref.lisp index baaa3ac2..3a70f7cd 100644 --- a/src/commondoc/xref.lisp +++ b/src/commondoc/xref.lisp @@ -1,7 +1,8 @@ (uiop:define-package #:40ants-doc/commondoc/xref (:use #:cl) - (:import-from #:40ants-doc/commondoc/bullet) (:import-from #:common-doc) + (:import-from #:common-doc.ops) + (:import-from #:common-doc.format) (:import-from #:40ants-doc/commondoc/html #:with-html) (:import-from #:common-html.emitter @@ -10,11 +11,7 @@ #:read-locative #:left-word #:right-word) - (:import-from #:40ants-doc/swank) (:import-from #:cl-ppcre) - (:import-from #:40ants-doc/ignored-words - #:ignored-words - #:supports-ignored-words-p) (:import-from #:40ants-doc/utils #:maybe-downcase) (:import-from #:40ants-doc/commondoc/mapper diff --git a/src/core.lisp b/src/core.lisp index 65ea242d..dacf6068 100644 --- a/src/core.lisp +++ b/src/core.lisp @@ -3,7 +3,7 @@ (:use #:cl) (:nicknames #:40ants-doc/core) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/locatives) + (:import-from #:40ants-doc/locatives/base) (:import-from #:40ants-doc/object-package) (:import-from #:40ants-doc/docstring #:strip-docstring-indentation) diff --git a/src/external-index.lisp b/src/external-index.lisp index 70da63c2..2fc4908d 100644 --- a/src/external-index.lisp +++ b/src/external-index.lisp @@ -10,7 +10,9 @@ (:import-from #:40ants-doc/commondoc/page) (:import-from #:40ants-doc/rewrite) (:import-from #:str) - (:import-from #:jonathan)) + (:import-from #:jonathan) + (:import-from #:dexador + #:http-request-not-found)) (in-package 40ants-doc/external-index) @@ -18,7 +20,7 @@ (let ((json-url (url-join url "references.json")) (original-url url)) (handler-case (dex:get json-url) - (dexador:http-request-not-found () + (http-request-not-found () (dex:get original-url))))) diff --git a/src/github.lisp b/src/github.lisp index 2409f2a5..cd89514b 100644 --- a/src/github.lisp +++ b/src/github.lisp @@ -3,12 +3,16 @@ (:import-from #:40ants-doc #:defsection) (:import-from #:cl-fad) - (:import-from #:40ants-doc/locatives/base) (:import-from #:40ants-doc/source) (:import-from #:40ants-doc/reference) (:import-from #:40ants-doc/source-api) (:import-from #:cl-ppcre) (:import-from #:str) + (:import-from #:alexandria + #:starts-with-subseq) + (:import-from #:40ants-doc/reference-api + #:*source-uri-fn* + #:source-uri) (:export #:make-github-source-uri-fn)) (in-package 40ants-doc/github) @@ -38,8 +42,8 @@ idea to add section like the 40ANTS-DOC/DOC:@LINKS section to allow jumping between the repository and the gh-pages site." (make-github-source-uri-fn function) - (40ants-doc/reference-api:*source-uri-fn* variable) - (40ants-doc/reference-api:source-uri function)) + (*source-uri-fn* variable) + (source-uri function)) (defun asdf-system-github-uri (asdf-system) @@ -116,7 +120,7 @@ (defun git-version (git-dir) (let ((head-string (read-first-line (merge-pathnames (make-pathname :name "HEAD") git-dir)))) - (if (alexandria:starts-with-subseq "ref: " head-string) + (if (starts-with-subseq "ref: " head-string) (let ((ref (subseq head-string 5))) (values (read-first-line (merge-pathnames ref git-dir)) ref)) head-string))) diff --git a/src/highlight.lisp b/src/highlight.lisp index b12a44da..12782461 100644 --- a/src/highlight.lisp +++ b/src/highlight.lisp @@ -1,7 +1,7 @@ (defpackage #:40ants-doc/highlight (:use #:cl) (:import-from #:dexador) - (:import-from #:log4cl) + (:import-from #:log) (:import-from #:alexandria #:when-let #:write-string-into-file diff --git a/src/link.lisp b/src/link.lisp index 2c292aaa..6a8f3f5b 100644 --- a/src/link.lisp +++ b/src/link.lisp @@ -1,9 +1,6 @@ (uiop:define-package #:40ants-doc/link (:use #:cl) - (:import-from #:40ants-doc/reference) (:import-from #:named-readtables) - (:import-from #:ironclad) - (:import-from #:babel) (:import-from #:pythonic-string-reader) (:export #:*document-link-code*)) diff --git a/src/locatives/argument.lisp b/src/locatives/argument.lisp index 29fa3b2a..93882443 100644 --- a/src/locatives/argument.lisp +++ b/src/locatives/argument.lisp @@ -1,17 +1,9 @@ -(defpackage #:40ants-doc/locatives/argument +(uiop:define-package #:40ants-doc/locatives/argument (:use #:cl) (:import-from #:40ants-doc/locatives/base #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) - (:import-from #:40ants-doc/reference-api - #:canonical-reference) - (:import-from #:40ants-doc/args) - (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) (:import-from #:40ants-doc/locatives #:argument) (:import-from #:named-readtables) diff --git a/src/locatives/asdf-system.lisp b/src/locatives/asdf-system.lisp index 0bca41f0..bcdae1a2 100644 --- a/src/locatives/asdf-system.lisp +++ b/src/locatives/asdf-system.lisp @@ -4,14 +4,9 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) (:import-from #:common-doc #:make-paragraph #:make-unordered-list diff --git a/src/locatives/class.lisp b/src/locatives/class.lisp index b0a0b37a..59f5a0bf 100644 --- a/src/locatives/class.lisp +++ b/src/locatives/class.lisp @@ -4,18 +4,15 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) (:import-from #:40ants-doc/commondoc/bullet) (:import-from #:40ants-doc/commondoc/arglist) (:import-from #:40ants-doc/docstring) - (:import-from #:40ants-doc/commondoc/markdown)) + (:import-from #:40ants-doc/commondoc/markdown) + (:import-from #:40ants-doc/commondoc/builder + #:to-commondoc)) (in-package 40ants-doc/locatives/class) (define-locative-type class ()) @@ -42,7 +39,7 @@ (40ants-doc/reference:make-reference (class-name class) 'class))) -(defmethod 40ants-doc/commondoc/builder:to-commondoc ((class class)) +(defmethod to-commondoc ((class class)) (let* ((conditionp (subtypep class 'condition)) (symbol (class-name class)) (superclasses diff --git a/src/locatives/compiler-macro.lisp b/src/locatives/compiler-macro.lisp index a9c36872..b1934797 100644 --- a/src/locatives/compiler-macro.lisp +++ b/src/locatives/compiler-macro.lisp @@ -5,18 +5,17 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) + (:import-from #:swank-backend) (:import-from #:40ants-doc/source-api) (:import-from #:40ants-doc/commondoc/builder) (:import-from #:40ants-doc/commondoc/bullet) (:import-from #:40ants-doc/docstring) - (:import-from #:40ants-doc/commondoc/markdown)) + (:import-from #:40ants-doc/commondoc/markdown) + (:import-from #:40ants-doc/args + #:macro-arg-names)) (in-package 40ants-doc/locatives/compiler-macro) @@ -41,7 +40,7 @@ (40ants-doc/commondoc/bullet::make-bullet reference :arglist locative-args :children children - :dislocated-symbols (40ants-doc/args::macro-arg-names arglist)))) + :dislocated-symbols (macro-arg-names arglist)))) (defmethod locate-and-find-source (symbol (locative-type (eql 'compiler-macro)) diff --git a/src/locatives/constant.lisp b/src/locatives/constant.lisp index 4cfa5c79..512fcd53 100644 --- a/src/locatives/constant.lisp +++ b/src/locatives/constant.lisp @@ -5,14 +5,9 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) - (:import-from #:40ants-doc/source-api) (:import-from #:swank-backend) (:import-from #:40ants-doc/locatives/utils) (:import-from #:40ants-doc/locatives diff --git a/src/locatives/definers.lisp b/src/locatives/definers.lisp index cf910287..755331ca 100644 --- a/src/locatives/definers.lisp +++ b/src/locatives/definers.lisp @@ -4,8 +4,6 @@ (:import-from #:pythonic-string-reader) (:import-from #:40ants-doc/locatives/base) (:import-from #:40ants-doc/source-api) - (:import-from #:40ants-doc/args) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/commondoc/bullet) (:import-from #:40ants-doc/commondoc/builder) (:import-from #:40ants-doc/reference) diff --git a/src/locatives/function.lisp b/src/locatives/function.lisp index 8aca878d..d79a18f4 100644 --- a/src/locatives/function.lisp +++ b/src/locatives/function.lisp @@ -5,11 +5,8 @@ #:locate-object #:define-locative-type) (:import-from #:swank-backend) - (:import-from #:swank-mop) (:import-from #:40ants-doc/reference-api #:canonical-reference) - (:import-from #:40ants-doc/render/args) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/commondoc/builder) diff --git a/src/locatives/generic-function.lisp b/src/locatives/generic-function.lisp index 60cd7860..c91f388a 100644 --- a/src/locatives/generic-function.lisp +++ b/src/locatives/generic-function.lisp @@ -8,12 +8,15 @@ (:import-from #:swank-mop) (:import-from #:40ants-doc/reference-api #:canonical-reference) - (:import-from #:40ants-doc/render/args) - (:import-from #:40ants-doc/args) + (:import-from #:40ants-doc/args + #:function-arg-names) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/docstring) - (:import-from #:40ants-doc/commondoc/markdown)) + (:import-from #:40ants-doc/commondoc/markdown) + (:import-from #:40ants-doc/commondoc/builder + #:to-commondoc) + (:import-from #:40ants-doc/commondoc/bullet + #:make-bullet)) (in-package 40ants-doc/locatives/generic-function) @@ -33,7 +36,7 @@ -(defmethod 40ants-doc/commondoc/builder::to-commondoc ((obj generic-function)) +(defmethod to-commondoc ((obj generic-function)) (let* ((arglist (swank-backend:arglist obj)) (docstring (40ants-doc/docstring:get-docstring obj 'function)) ;; TODO: we should move text transfromation after it will be parsed @@ -41,7 +44,7 @@ (40ants-doc/commondoc/markdown:parse-markdown docstring))) (reference (canonical-reference obj))) - (40ants-doc/commondoc/bullet:make-bullet reference - :arglist arglist - :children children - :dislocated-symbols (40ants-doc/args::function-arg-names arglist)))) + (make-bullet reference + :arglist arglist + :children children + :dislocated-symbols (function-arg-names arglist)))) diff --git a/src/locatives/glossary.lisp b/src/locatives/glossary.lisp index 51212433..47200d38 100644 --- a/src/locatives/glossary.lisp +++ b/src/locatives/glossary.lisp @@ -2,14 +2,21 @@ (:use #:cl) ;; (:import-from #:40ants-doc/core) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/printer) (:import-from #:40ants-doc/locatives/base) (:import-from #:40ants-doc/locatives #:glossary-term) (:import-from #:40ants-doc/glossary) (:import-from #:40ants-doc/reference-api) (:import-from #:40ants-doc/source-api) - (:import-from #:40ants-doc/commondoc/markdown)) + (:import-from #:40ants-doc/commondoc/markdown) + (:import-from #:40ants-doc/commondoc/builder + #:to-commondoc) + (:import-from #:40ants-doc/commondoc/bullet + #:make-bullet) + (:import-from #:40ants-doc/docstring + #:strip-docstring-indentation) + (:import-from #:40ants-doc/utils + #:maybe-downcase)) (in-package 40ants-doc/locatives/glossary) @@ -26,25 +33,25 @@ (defun glossary-term-title-or-name (glossary-term) (check-type glossary-term 40ants-doc/glossary::glossary-term) (or (40ants-doc/glossary::glossary-term-title glossary-term) - (40ants-doc/utils::maybe-downcase + (maybe-downcase (prin1-to-string (40ants-doc/glossary::glossary-term-name glossary-term))))) -(defmethod 40ants-doc/commondoc/builder:to-commondoc ((glossary-term 40ants-doc/glossary::glossary-term)) +(defmethod to-commondoc ((glossary-term 40ants-doc/glossary::glossary-term)) (let* ((symbol (40ants-doc/glossary::glossary-term-name glossary-term)) (reference (40ants-doc/reference::canonical-reference (40ants-doc/reference::make-reference symbol '(glossary-term)))) (docstring (let ((docstring (40ants-doc/glossary::glossary-term-docstring glossary-term))) (when docstring - (40ants-doc/docstring:strip-docstring-indentation docstring)))) + (strip-docstring-indentation docstring)))) (children (when docstring (40ants-doc/commondoc/markdown:parse-markdown docstring)))) - (40ants-doc/commondoc/bullet:make-bullet reference - :name (glossary-term-title-or-name glossary-term) - :children children - :ignore-words symbol))) + (make-bullet reference + :name (glossary-term-title-or-name glossary-term) + :children children + :ignore-words symbol))) (defmethod 40ants-doc/reference-api:canonical-reference ((glossary-term 40ants-doc/glossary::glossary-term)) (40ants-doc/reference:make-reference (40ants-doc/glossary::glossary-term-name glossary-term) 'glossary-term)) diff --git a/src/locatives/include.lisp b/src/locatives/include.lisp index 1a1cd4d0..bd88a491 100644 --- a/src/locatives/include.lisp +++ b/src/locatives/include.lisp @@ -7,16 +7,13 @@ #:define-locative-type) (:import-from #:40ants-doc/locatives #:include) - (:import-from #:40ants-doc/render/args) - (:import-from #:40ants-doc/reference-api - #:canonical-reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) + (:import-from #:babel) + (:import-from #:common-doc) + (:import-from #:fare-utils) (:import-from #:named-readtables) (:import-from #:pythonic-string-reader) + (:import-from #:40ants-doc/commondoc/builder) (:import-from #:40ants-doc/core #:exportable-locative-type-p) (:import-from #:40ants-doc/source-api)) diff --git a/src/locatives/locative.lisp b/src/locatives/locative.lisp index 1f3fa1ca..1d0612a1 100644 --- a/src/locatives/locative.lisp +++ b/src/locatives/locative.lisp @@ -5,21 +5,19 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) (:import-from #:40ants-doc/args #:function-arg-names) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) (:import-from #:40ants-doc/locatives #:locative) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) (:import-from #:40ants-doc/commondoc/builder) (:import-from #:40ants-doc/commondoc/bullet) (:import-from #:40ants-doc/docstring) - (:import-from #:40ants-doc/commondoc/markdown)) + (:import-from #:40ants-doc/commondoc/markdown) + (:import-from #:40ants-doc/source-api + #:find-source)) (in-package 40ants-doc/locatives/locative) @@ -60,4 +58,4 @@ (defmethod locate-and-find-source (symbol (locative-type (eql 'locative)) locative-args) (declare (ignore locative-args)) - (40ants-doc/source-api:find-source (locative-lambda-list-method-for-symbol symbol))) + (find-source (locative-lambda-list-method-for-symbol symbol))) diff --git a/src/locatives/macro.lisp b/src/locatives/macro.lisp index 08c5edaf..cc57e5d1 100644 --- a/src/locatives/macro.lisp +++ b/src/locatives/macro.lisp @@ -4,21 +4,19 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) (:import-from #:40ants-doc/locatives #:macro) - (:import-from #:40ants-doc/page) (:import-from #:swank-backend) (:import-from #:40ants-doc/commondoc/builder) (:import-from #:40ants-doc/commondoc/bullet) (:import-from #:40ants-doc/docstring) - (:import-from #:40ants-doc/commondoc/markdown)) + (:import-from #:40ants-doc/commondoc/markdown) + (:import-from #:40ants-doc/source-api + #:find-source)) (in-package 40ants-doc/locatives/macro) @@ -49,4 +47,4 @@ (defmethod 40ants-doc/locatives/base:locate-and-find-source (symbol (locative-type (eql 'macro)) locative-args) (declare (ignore locative-args)) - (40ants-doc/source-api:find-source (macro-function symbol))) + (find-source (macro-function symbol))) diff --git a/src/locatives/method.lisp b/src/locatives/method.lisp index 75ee6a0f..0739432f 100644 --- a/src/locatives/method.lisp +++ b/src/locatives/method.lisp @@ -4,18 +4,22 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) - (:import-from #:swank-backend) + ;; NO LINT (:import-from #:swank-mop) (:import-from #:named-readtables) - (:import-from #:pythonic-string-reader)) + (:import-from #:pythonic-string-reader) + (:import-from #:40ants-doc/commondoc/builder + #:to-commondoc) + (:import-from #:40ants-doc/commondoc/bullet + #:make-bullet) + (:import-from #:40ants-doc/commondoc/markdown + #:parse-markdown) + (:import-from #:40ants-doc/docstring + #:get-docstring)) (in-package 40ants-doc/locatives/method) (named-readtables:in-readtable pythonic-string-reader:pythonic-string-syntax) @@ -68,20 +72,20 @@ (swank-mop:method-specializers method))) -(defmethod 40ants-doc/commondoc/builder:to-commondoc ((obj method)) +(defmethod to-commondoc ((obj method)) (let* ((arglist (rest (method-for-inspect-value obj))) - (docstring (40ants-doc/docstring:get-docstring obj t)) + (docstring (get-docstring obj t)) ;; TODO: we should move text transfromation after it will be parsed (children (when docstring - (40ants-doc/commondoc/markdown:parse-markdown docstring))) + (parse-markdown docstring))) (dislocated-symbols (40ants-doc/args::function-arg-names arglist)) (reference (canonical-reference obj))) - (40ants-doc/commondoc/bullet:make-bullet reference - :arglist arglist - :children children - :dislocated-symbols dislocated-symbols))) + (make-bullet reference + :arglist arglist + :children children + :dislocated-symbols dislocated-symbols))) ;;;; These were lifted from the fancy inspector contrib and then ;;;; tweaked. diff --git a/src/locatives/package.lisp b/src/locatives/package.lisp index 4301718e..ddc3b9de 100644 --- a/src/locatives/package.lisp +++ b/src/locatives/package.lisp @@ -4,16 +4,9 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) - (:import-from #:swank-backend) - (:import-from #:swank-mop) (:import-from #:named-readtables) (:import-from #:pythonic-string-reader) (:import-from #:40ants-doc/commondoc/bullet) diff --git a/src/locatives/restart.lisp b/src/locatives/restart.lisp index e1b21f86..9bc739a7 100644 --- a/src/locatives/restart.lisp +++ b/src/locatives/restart.lisp @@ -1,19 +1,5 @@ (uiop:define-package #:40ants-doc/locatives/restart (:use #:cl) - (:import-from #:40ants-doc/locatives/base - #:locate-error - #:locate-object - #:define-locative-type) - (:import-from #:40ants-doc/render/args) - (:import-from #:40ants-doc/reference-api - #:canonical-reference) - (:import-from #:40ants-doc/args) - (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) - (:import-from #:swank-backend) - (:import-from #:swank-mop) (:import-from #:named-readtables) (:import-from #:pythonic-string-reader) (:import-from #:40ants-doc/locatives/define-definer diff --git a/src/locatives/section.lisp b/src/locatives/section.lisp index a80c3d0c..7a830f9b 100644 --- a/src/locatives/section.lisp +++ b/src/locatives/section.lisp @@ -1,23 +1,27 @@ (defpackage #:40ants-doc/locatives/section (:use #:cl) - (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/reference-api) - (:import-from #:40ants-doc/source) - (:import-from #:40ants-doc/locatives/base) - (:import-from #:40ants-doc/builder/printer) - (:import-from #:40ants-doc/page) + (:import-from #:40ants-doc/reference + #:make-reference) + (:import-from #:40ants-doc/reference-api + #:canonical-reference) + (:import-from #:40ants-doc/locatives/base + #:define-locative-type + #:locate-object + #:locate-and-find-source) (:import-from #:40ants-doc/locatives #:section) (:import-from #:40ants-doc/core ;; #:section - )) + ) + (:import-from #:40ants-doc/source-api + #:find-source)) (in-package 40ants-doc/locatives/section) -(40ants-doc/locatives/base::define-locative-type section () +(define-locative-type section () "Refers to a section defined by 40ANTS-DOC:DEFSECTION.") -(defmethod 40ants-doc/locatives/base::locate-object (symbol (locative-type (eql 'section)) +(defmethod locate-object (symbol (locative-type (eql 'section)) locative-args) (declare (ignore locative-args)) (unless (typep (symbol-value symbol) @@ -25,9 +29,9 @@ (error "Section locative works only with objects defined by 40ANTS-DOC:DEFSECTION.")) (symbol-value symbol)) -(defmethod 40ants-doc/reference-api::canonical-reference ((section 40ants-doc/core::section)) - (40ants-doc/reference::make-reference (40ants-doc/core::section-name section) - 'section)) +(defmethod canonical-reference ((section 40ants-doc/core::section)) + (make-reference (40ants-doc/core::section-name section) + 'section)) -(defmethod 40ants-doc/source-api:find-source ((section 40ants-doc/core::section)) - (40ants-doc/locatives/base:locate-and-find-source (40ants-doc/core::section-name section) 'variable ())) +(defmethod find-source ((section 40ants-doc/core::section)) + (locate-and-find-source (40ants-doc/core::section-name section) 'variable ())) diff --git a/src/locatives/slots.lisp b/src/locatives/slots.lisp index a2be4208..20df7c05 100644 --- a/src/locatives/slots.lisp +++ b/src/locatives/slots.lisp @@ -5,16 +5,11 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) (:import-from #:swank-mop) - (:import-from #:40ants-doc/builder/printer) (:import-from #:40ants-doc/locatives #:accessor #:reader @@ -22,7 +17,13 @@ (:import-from #:40ants-doc/commondoc/bullet) (:import-from #:40ants-doc/commondoc/arglist #:make-arglist) - (:import-from #:40ants-doc/commondoc/markdown)) + (:import-from #:40ants-doc/commondoc/markdown) + (:import-from #:40ants-doc/commondoc/builder + #:reference-to-commondoc) + (:import-from #:40ants-doc/docstring + #:strip-docstring-indentation) + (:import-from #:40ants-doc/source-api + #:find-source)) (in-package 40ants-doc/locatives/slots) @@ -122,7 +123,7 @@ (docstring (unless (subtypep (find-class (first locative-args)) 'condition) (let ((docstring (swank-mop:slot-definition-documentation slot-def))) (when docstring - (40ants-doc/docstring:strip-docstring-indentation docstring))))) + (strip-docstring-indentation docstring))))) (children (when docstring (40ants-doc/commondoc/markdown:parse-markdown docstring)))) (40ants-doc/commondoc/bullet:make-bullet reference @@ -131,28 +132,28 @@ :ignore-words symbol))) -(defmethod 40ants-doc/commondoc/builder::reference-to-commondoc ((symbol symbol) (locative-type (eql 'reader)) locative-args) +(defmethod reference-to-commondoc ((symbol symbol) (locative-type (eql 'reader)) locative-args) (inner-reference-to-commondoc symbol locative-type locative-args)) -(defmethod 40ants-doc/commondoc/builder::reference-to-commondoc ((symbol symbol) (locative-type (eql 'writer)) locative-args) +(defmethod reference-to-commondoc ((symbol symbol) (locative-type (eql 'writer)) locative-args) (inner-reference-to-commondoc symbol locative-type locative-args)) -(defmethod 40ants-doc/commondoc/builder::reference-to-commondoc ((symbol symbol) (locative-type (eql 'accessor)) locative-args) +(defmethod reference-to-commondoc ((symbol symbol) (locative-type (eql 'accessor)) locative-args) (inner-reference-to-commondoc symbol locative-type locative-args)) (defmethod locate-and-find-source (symbol (locative-type (eql 'accessor)) locative-args) - (40ants-doc/source-api:find-source (find-method (symbol-function symbol) - '() (list (find-class (first locative-args)))))) + (find-source (find-method (symbol-function symbol) + '() (list (find-class (first locative-args)))))) (defmethod locate-and-find-source (symbol (locative-type (eql 'reader)) locative-args) - (40ants-doc/source-api:find-source (find-method (symbol-function symbol) - '() (list (find-class (first locative-args)))))) + (find-source (find-method (symbol-function symbol) + '() (list (find-class (first locative-args)))))) (defmethod locate-and-find-source (symbol (locative-type (eql 'writer)) locative-args) - (40ants-doc/source-api:find-source (find-method (symbol-function symbol) - '() (mapcar #'find-class - (list t (first locative-args)))))) + (find-source (find-method (symbol-function symbol) + '() (mapcar #'find-class + (list t (first locative-args)))))) diff --git a/src/locatives/stdout-of.lisp b/src/locatives/stdout-of.lisp index a462f4c1..ffbba846 100644 --- a/src/locatives/stdout-of.lisp +++ b/src/locatives/stdout-of.lisp @@ -3,6 +3,7 @@ (:import-from #:40ants-doc/locatives #:stdout-of) (:import-from #:named-readtables) + (:import-from #:common-doc) (:import-from #:pythonic-string-reader) (:import-from #:40ants-doc/locatives/base #:locate-object diff --git a/src/locatives/structure-accessor.lisp b/src/locatives/structure-accessor.lisp index 13687fc8..c707b855 100644 --- a/src/locatives/structure-accessor.lisp +++ b/src/locatives/structure-accessor.lisp @@ -5,15 +5,9 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) - (:import-from #:40ants-doc/builder/printer) (:import-from #:swank-backend) (:import-from #:40ants-doc/source-api) (:import-from #:40ants-doc/locatives @@ -21,7 +15,9 @@ (:import-from #:40ants-doc/locatives/utils) (:import-from #:40ants-doc/commondoc/builder) (:import-from #:40ants-doc/commondoc/bullet) - (:import-from #:40ants-doc/docstring)) + (:import-from #:40ants-doc/docstring) + (:import-from #:40ants-doc/commondoc/markdown + #:parse-markdown)) (in-package 40ants-doc/locatives/structure-accessor) @@ -46,7 +42,7 @@ symbol (cons locative-type locative-args)))) (docstring (40ants-doc/docstring:get-docstring symbol 'function)) (children (when docstring - (40ants-doc/commondoc/markdown:parse-markdown docstring)))) + (parse-markdown docstring)))) (40ants-doc/commondoc/bullet::make-bullet reference :arglist locative-args diff --git a/src/locatives/symbol-macro.lisp b/src/locatives/symbol-macro.lisp index 68e2d8fb..dea5f1bd 100644 --- a/src/locatives/symbol-macro.lisp +++ b/src/locatives/symbol-macro.lisp @@ -5,15 +5,9 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) - (:import-from #:40ants-doc/builder/printer) (:import-from #:swank-backend) (:import-from #:40ants-doc/source-api) (:import-from #:40ants-doc/locatives @@ -21,7 +15,9 @@ (:import-from #:40ants-doc/locatives/utils) (:import-from #:40ants-doc/commondoc/builder) (:import-from #:40ants-doc/commondoc/bullet) - (:import-from #:40ants-doc/docstring)) + (:import-from #:40ants-doc/docstring) + (:import-from #:40ants-doc/commondoc/markdown + #:parse-markdown)) (in-package 40ants-doc/locatives/symbol-macro) @@ -42,7 +38,7 @@ symbol (cons locative-type locative-args)))) (docstring (40ants-doc/docstring:get-docstring symbol :symbol-macro)) (children (when docstring - (40ants-doc/commondoc/markdown:parse-markdown docstring)))) + (parse-markdown docstring)))) (40ants-doc/commondoc/bullet::make-bullet reference :arglist locative-args diff --git a/src/locatives/type.lisp b/src/locatives/type.lisp index a5a08c0c..d24616f3 100644 --- a/src/locatives/type.lisp +++ b/src/locatives/type.lisp @@ -5,14 +5,7 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) - (:import-from #:40ants-doc/reference-api - #:canonical-reference) - (:import-from #:40ants-doc/args) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) (:import-from #:swank-backend) (:import-from #:40ants-doc/locatives/utils) (:import-from #:40ants-doc/commondoc/builder) diff --git a/src/locatives/variable.lisp b/src/locatives/variable.lisp index 5343ff5b..03733a54 100644 --- a/src/locatives/variable.lisp +++ b/src/locatives/variable.lisp @@ -5,19 +5,17 @@ #:locate-error #:locate-object #:define-locative-type) - (:import-from #:40ants-doc/render/args) (:import-from #:40ants-doc/reference-api #:canonical-reference) (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/builder/vars) (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/page) - (:import-from #:40ants-doc/source-api) (:import-from #:swank-backend) (:import-from #:40ants-doc/locatives/utils) (:import-from #:40ants-doc/commondoc/builder) (:import-from #:40ants-doc/commondoc/bullet) - (:import-from #:40ants-doc/docstring)) + (:import-from #:40ants-doc/docstring) + (:import-from #:40ants-doc/commondoc/markdown + #:parse-markdown)) (in-package 40ants-doc/locatives/variable) @@ -44,7 +42,7 @@ (t (prin1-to-string value))))) (children (when docstring - (40ants-doc/commondoc/markdown:parse-markdown docstring)))) + (parse-markdown docstring)))) (40ants-doc/commondoc/bullet:make-bullet reference :arglist arglist diff --git a/src/object-package-impl.lisp b/src/object-package-impl.lisp index 4b929d76..bd82f18f 100644 --- a/src/object-package-impl.lisp +++ b/src/object-package-impl.lisp @@ -4,7 +4,7 @@ #:object-package) (:import-from #:swank) (:import-from #:closer-mop - #:method-generic-function + ;; NO-LINT #:generic-function-name) (:import-from #:40ants-doc/utils)) (in-package 40ants-doc/object-package-impl) diff --git a/src/page.lisp b/src/page.lisp index ceecd436..32d980ae 100644 --- a/src/page.lisp +++ b/src/page.lisp @@ -4,16 +4,13 @@ #:section-title #:section-name) (:import-from #:40ants-doc/object-package) - (:import-from #:40ants-doc/reference) - (:import-from #:40ants-doc/link) - (:import-from #:40ants-doc/builder/printer) - (:import-from #:40ants-doc/builder/vars) - (:import-from #:40ants-doc/locatives/dislocated) (:import-from #:40ants-doc/commondoc/builder) ;; TODO: solve circular dependency :( ;; (:import-from #:40ants-doc/commondoc/page) (:import-from #:40ants-doc/commondoc/format #:ensure-format-class-name) + (:import-from #:str + #:title-case) (:export #:make-page #:ensure-page #:page-format @@ -89,8 +86,8 @@ (first-section (first sections)) (real-title (or title (section-title first-section) - (str:title-case (symbol-name - (section-name first-section))))) + (title-case (symbol-name + (section-name first-section))))) (base-filename (or base-filename (make-base-filename sections)))) (make-instance 'page diff --git a/src/reference.lisp b/src/reference.lisp index 47043050..38b18a80 100644 --- a/src/reference.lisp +++ b/src/reference.lisp @@ -3,8 +3,8 @@ (:import-from #:40ants-doc/reference-api #:canonical-reference) (:import-from #:40ants-doc/source-api) + (:import-from #:40ants-doc/locatives) (:import-from #:40ants-doc/locatives/base) - (:import-from #:40ants-doc/locatives/dislocated) (:import-from #:40ants-doc/object-package) (:export #:resolve diff --git a/src/render/args.lisp b/src/render/args.lisp index 3027d0ab..6f259122 100644 --- a/src/render/args.lisp +++ b/src/render/args.lisp @@ -1,7 +1,6 @@ (defpackage #:40ants-doc/render/args (:use #:cl) - (:import-from #:40ants-doc/utils) - (:import-from #:40ants-doc/builder/printer)) + (:import-from #:40ants-doc/utils)) (in-package 40ants-doc/render/args) diff --git a/src/rewrite.lisp b/src/rewrite.lisp index 8d82f459..80dde358 100644 --- a/src/rewrite.lisp +++ b/src/rewrite.lisp @@ -1,5 +1,9 @@ (defpackage #:40ants-doc/rewrite - (:use #:cl)) + (:use #:cl) + (:import-from #:cl-ppcre + #:regex-replace) + (:import-from #:str + #:ends-with-p)) (in-package 40ants-doc/rewrite) @@ -12,7 +16,7 @@ https://40ants.com/doc/some-lib/changelog.html " (if *clean-urls* - (cl-ppcre:regex-replace "index\\.html$" url "") + (regex-replace "index\\.html$" url "") url)) @@ -28,9 +32,9 @@ " (cond ((and *clean-urls* - (str:ends-with-p ".html" file) - (not (str:ends-with-p "index.html" file))) - (cl-ppcre:regex-replace "\\.html" - file - "/index.html")) + (ends-with-p ".html" file) + (not (ends-with-p "index.html" file))) + (regex-replace "\\.html" + file + "/index.html")) (t file))) diff --git a/src/search.lisp b/src/search.lisp index 20e78aea..b95554cf 100644 --- a/src/search.lisp +++ b/src/search.lisp @@ -1,11 +1,30 @@ -(defpackage #:40ants-doc/search +(uiop:define-package #:40ants-doc/search (:use #:cl) (:import-from #:40ants-doc/commondoc/mapper #:map-nodes) (:import-from #:40ants-doc/commondoc/section) (:import-from #:40ants-doc/commondoc/page) + (:import-from #:40ants-doc/page) + (:import-from #:40ants-doc/utils) + (:import-from #:40ants-doc/locatives) + (:import-from #:common-html) (:import-from #:stem) - (:import-from #:jonathan)) + (:import-from #:str) + (:import-from #:jonathan) + (:import-from #:40ants-doc/commondoc/bullet + #:bullet) + (:import-from #:40ants-doc/commondoc/format + #:with-format) + (:import-from #:40ants-doc/commondoc/piece + #:doc-reference) + (:import-from #:40ants-doc/reference + #:reference-locative + #:reference-object) + (:import-from #:40ants-doc/locatives/base + #:locative-type) + (:import-from #:common-doc) + (:import-from #:common-doc.ops + #:collect-all-text)) (in-package 40ants-doc/search) @@ -46,7 +65,7 @@ (defun generate-search-index (document page) - (40ants-doc/commondoc/format:with-format (:html) + (with-format (:html) (let ((docnames nil) (filenames nil) (objects (make-hash-table :test 'equal)) @@ -83,12 +102,12 @@ :omit-nulls t) do (pushnew document-idx (gethash (stem:stem word) terms))))) - (40ants-doc/commondoc/bullet::bullet + (bullet (when current-page - (let* ((reference (40ants-doc/commondoc/piece::doc-reference node)) - (object (40ants-doc/reference:reference-object reference)) - (locative (40ants-doc/reference:reference-locative reference)) - (locative-type (40ants-doc/locatives/base:locative-type locative)) + (let* ((reference (doc-reference node)) + (object (reference-object reference)) + (locative (reference-locative reference)) + (locative-type (locative-type locative)) (package (typecase object (symbol (symbol-package object)) (t nil))) @@ -118,7 +137,7 @@ (list 'common-html:html nil)) (setf current-page node) (incf document-idx) - (push (common-doc.ops:collect-all-text + (push (collect-all-text (common-doc:title (first-section node))) titles) diff --git a/src/themes/api.lisp b/src/themes/api.lisp index f2043476..793c4db2 100644 --- a/src/themes/api.lisp +++ b/src/themes/api.lisp @@ -2,6 +2,8 @@ (:use #:cl) (:import-from #:40ants-doc/highlight #:download-highlight-js) + (:import-from #:alexandria + #:once-only) (:export #:render-css #:render-page #:render-html-head @@ -21,7 +23,7 @@ (defvar *theme*) (defmacro with-theme ((theme) &body body) - (alexandria:once-only (theme) + (once-only (theme) `(let ((*theme* (typecase ,theme (symbol (make-instance ,theme)) (t ,theme)))) diff --git a/src/themes/default.lisp b/src/themes/default.lisp index e44d0c2e..6c47b534 100644 --- a/src/themes/default.lisp +++ b/src/themes/default.lisp @@ -1,5 +1,6 @@ (uiop:define-package #:40ants-doc/themes/default (:use #:cl) + (:import-from #:common-html.emitter) (:import-from #:40ants-doc/themes/api #:render-css) (:import-from #:lass) diff --git a/src/transcribe.lisp b/src/transcribe.lisp index d283bd27..80e92a1d 100644 --- a/src/transcribe.lisp +++ b/src/transcribe.lisp @@ -27,6 +27,9 @@ ;; (:import-from #:40ants-doc/page) (:import-from #:swank) (:import-from #:slynk) + (:import-from #:alexandria + #:with-gensyms + #:once-only) (:export #:transcribe #:*syntaxes* @@ -505,7 +508,7 @@ (assert nil)))) (defmacro with-load-environment ((stream) &body body) - (alexandria:once-only (stream) + (once-only (stream) `(let* ((*readtable* *readtable*) (*package* *package*) (*load-pathname* (handler-case (pathname ,stream) @@ -793,7 +796,7 @@ value value-capture))))))) (defmacro with-transcription-syntax (() &body body) - (alexandria:with-gensyms (package) + (with-gensyms (package) `(let ((,package *package*)) (with-standard-io-syntax (let ((*package* ,package)