Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed URLs in the search index file when CLEAN-URLS argument is given. #40

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@
"strategy": {
"fail-fast": false,
"matrix": {
"quicklisp": [
"quicklisp",
"ultralisp"
],
"lisp": [
"sbcl-bin",
"abcl-bin",
"clasp",
"lispworks",
"mkcl",
"ecl"
],
"exclude": [
{
"quicklisp": "quicklisp",
Expand All @@ -51,6 +39,18 @@
"quicklisp": "quicklisp",
"lisp": "ecl"
}
],
"quicklisp": [
"quicklisp",
"ultralisp"
],
"lisp": [
"sbcl-bin",
"abcl-bin",
"clasp",
"lispworks",
"mkcl",
"ecl"
]
}
},
Expand All @@ -67,7 +67,7 @@
},
{
"name": "Setup Common Lisp Environment",
"uses": "40ants/setup-lisp@v2",
"uses": "40ants/setup-lisp@v3",
"with": {
"asdf-system": "40ants-doc-full"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"name": "Setup Common Lisp Environment",
"uses": "40ants/setup-lisp@v2",
"uses": "40ants/setup-lisp@v3",
"with": {
"asdf-system": "40ants-doc-full"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"name": "Setup Common Lisp Environment",
"uses": "40ants/setup-lisp@v2",
"uses": "40ants/setup-lisp@v3",
"with": {
"asdf-system": "40ants-doc"
}
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "RELEASE",
"on": {
"push": {
"branches": [
"master"
]
}
},
"jobs": {
"autotag": {
"permissions": {
"contents": "write"
},
"runs-on": "ubuntu-latest",
"env": {
"OS": "ubuntu-latest"
},
"steps": [
{
"name": "Checkout Code",
"uses": "actions/checkout@v3"
},
{
"name": "Create release tag",
"uses": "butlerlogic/action-autotag@8bc1ad456dcdee34e8c6ffbce991cc31793578c2",
"with": {
"root": "ChangeLog.md",
"regex_pattern": "^## (?<version>\\d+\\.\\d+\\.\\d+.*?)( |\\n).*$",
"tag_prefix": "v"
},
"env": {
"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
}
}
]
}
}
}
6 changes: 3 additions & 3 deletions full/builder.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
(40ants-doc-full/builder/vars::*base-dir* base-dir)
(40ants-doc-full/builder/vars::*base-url* base-url)
(40ants-doc-full/builder/printer::*full-package-names* full-package-names))

(handler-bind ((warning (lambda (c)
(declare (ignore c))
(incf num-warnings))))
Expand Down Expand Up @@ -391,8 +391,8 @@
:highlight-theme highlight-theme)

(let* ((page (40ants-doc-full/commondoc/page:make-page nil "search/index"
:title "Search Page"
:format :html))
:title "Search Page"
:format :html))
(filename (make-full-filename page)))
(ensure-directories-exist filename)
(uiop:with-output-file (common-html.emitter::*output-stream*
Expand Down
19 changes: 13 additions & 6 deletions full/search.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
(:import-from #:40ants-doc-full/commondoc/mapper
#:map-nodes)
(:import-from #:40ants-doc-full/commondoc/section)
(:import-from #:40ants-doc-full/commondoc/page)
(:import-from #:40ants-doc-full/commondoc/page
#:full-filename)
(:import-from #:40ants-doc-full/page)
(:import-from #:40ants-doc-full/utils)
(:import-from #:40ants-doc-full/utils
#:make-clean-uri)
(:import-from #:40ants-doc/locatives)
(:import-from #:common-html)
(:import-from #:stem)
Expand All @@ -24,7 +26,9 @@
#:locative-type)
(:import-from #:common-doc)
(:import-from #:common-doc.ops
#:collect-all-text))
#:collect-all-text)
(:import-from #:40ants-doc-full/rewrite
#:*clean-urls*))
(in-package #:40ants-doc-full/search)


Expand Down Expand Up @@ -149,9 +153,12 @@
(push (40ants-doc-full/utils:make-relative-path (40ants-doc-full/page:base-filename page)
(40ants-doc-full/page:base-filename node))
docnames)
(push (40ants-doc-full/commondoc/page:full-filename node
:from page)
filenames))))
(let ((path (full-filename node
:from page)))
(push (if *clean-urls*
(make-clean-uri path)
path)
filenames)))))
node)
(go-up (node)
(typecase node
Expand Down
4 changes: 3 additions & 1 deletion full/themes/default.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#:make-relative-path)
(:import-from #:40ants-doc-full/rewrite)
(:import-from #:40ants-doc-full/commondoc/changelog)
(:import-from #:alexandria
#:read-file-into-string)
(:export #:default-theme))
(in-package #:40ants-doc-full/themes/default)

Expand Down Expand Up @@ -282,7 +284,7 @@
:margin-bottom 1em)))

(.rss-icon
:background ,(alexandria:read-file-into-string
:background ,(read-file-into-string
(asdf:system-relative-pathname :40ants-doc
"static/rss-icon.base64"))
:width 1em
Expand Down
11 changes: 10 additions & 1 deletion full/utils.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
(:import-from #:40ants-doc-full/builder/vars)
(:import-from #:alexandria)
(:import-from #:cl-ppcre)
(:import-from #:str)
(:import-from #:str
#:ensure-suffix
#:replace-all)
(:import-from #:40ants-doc/docstring
#:whitespacep
#:blankp)
Expand Down Expand Up @@ -691,6 +693,13 @@
(format s "~{~A~^/~}" rest-to-parts)))))))


(defun make-clean-uri (path)
(ensure-suffix "/"
(replace-all "/index.html"
"/"
path)))


(defgeneric maybe-downcase (obj)
(:method ((string string))
(if (and 40ants-doc-full/builder/vars::*downcase-uppercase-code*
Expand Down
4 changes: 2 additions & 2 deletions qlfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
("quicklisp" .
(:class qlot/source/dist:source-dist
:initargs (:distribution "http://beta.quicklisp.org/dist/quicklisp.txt" :%version :latest)
:version "2023-02-15"))
:version "2023-10-21"))
("ultralisp" .
(:class qlot/source/dist:source-dist
:initargs (:distribution "http://dist.ultralisp.org" :%version :latest)
:version "20230417162000"))
:version "20240124120001"))
3 changes: 3 additions & 0 deletions src/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@
"*DOCUMENT-MARK-UP-SIGNATURES*"
"*DOCUMENT-NORMALIZE-PACKAGES*"
"*DOCUMENT-DOWNCASE-UPPERCASE-CODE*"
"CLEAN-URLS"
;; These objects are not documented yet:
"40ANTS-DOC/COMMONDOC/XREF:XREF"))
(0.15.3 2024-01-24
"* Fixed URLs in the search index file when CLEAN-URLS argument is given. This should prevent redirection to index.html file from search page - now index.html will be stripped from the path.")
(0.15.2 2023-11-28
"* Fixed stack exhausting when trying to collect dependencies for some ASDF systems.")
(0.15.1 2023-08-05
Expand Down
9 changes: 8 additions & 1 deletion src/ci.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#:defworkflow)
(:import-from #:40ants-ci/jobs/linter)
(:import-from #:40ants-ci/jobs/run-tests)
(:import-from #:40ants-ci/jobs/docs))
(:import-from #:40ants-ci/jobs/docs)
(:import-from #:40ants-ci/jobs/autotag
#:autotag))
(in-package #:40ants-doc/ci)


Expand All @@ -26,6 +28,11 @@
"ecl") )


(defworkflow release
:on-push-to "master"
:jobs ((autotag)))


(defworkflow linter
:on-push-to "master"
:on-pull-request t
Expand Down
Loading