Skip to content

Commit c59009e

Browse files
authored
Merge pull request #38 from ryukinix/auto-docs
docs: add make docs
2 parents 780738a + 7595e8d commit c59009e

File tree

7 files changed

+51
-6
lines changed

7 files changed

+51
-6
lines changed

.github/workflows/docs.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Docs
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
build-and-publish:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
token: ${{ secrets.GITHUB_TOKEN }}
14+
15+
- name: Build docs using docker
16+
run: make docker-docs
17+
18+
- name: Publish docs to gh-pages
19+
run: make docs-publish

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.fasl
22
system-index.txt
33
lisp-inference
4+
docs/

Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,29 @@ check:
1818
server:
1919
@$(SBCL_CMD) run-server.lisp
2020

21+
docs-worktree:
22+
@if [ ! -d docs ]; then \
23+
git worktree add docs gh-pages -f; \
24+
fi
25+
26+
docs: docs-worktree
27+
@$(SBCL_CMD) run-docs.lisp
28+
29+
docs-publish:
30+
cd docs/ && git add . && git commit -m "Auto-generated commit from make docs-publish" && git push || true
31+
2132
docker-build:
2233
docker build -t $(DOCKER_IMG) .
2334

2435
docker-shell: docker-build
2536
docker run --rm -it --entrypoint=/bin/bash $(DOCKER_IMG)
2637

27-
2838
docker-run: docker-build
2939
docker run --rm -it --network=host $(DOCKER_IMG)
3040

41+
docker-docs: docker-build docs-worktree
42+
docker run --rm -t -v $(PWD)/docs:/root/.roswell/local-projects/local/lisp-inference/docs --entrypoint=ros $(DOCKER_IMG) run -l run-docs.lisp
43+
3144
docker-check: docker-build
3245
docker run --rm -t --entrypoint=ros $(DOCKER_IMG) run -l run-test.lisp
3346

@@ -38,4 +51,4 @@ docker-publish: docker-build
3851
deploy: docker-publish
3952
ssh starfox bash /home/lerax/Deploy/logic.sh
4053

41-
.PHONY: check docker-build
54+
.PHONY: check docker-build docs

lisp-inference.asd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
:description "An Inference Engine using Propositional Calculus"
99
:author "Manoel Vilela <[email protected]>"
1010
:license "BSD"
11-
:version "0.2.0"
11+
:version "0.4.0"
12+
:homepage "https://github.com/ryukinix/lisp-inference"
1213
:serial t
1314
:pathname "src"
1415
:components ((:file "package")
@@ -26,7 +27,8 @@
2627
:description "An web interface for Lisp Inference Truth Table"
2728
:author "Manoel Vilela <[email protected]>"
2829
:license "BSD"
29-
:version "0.2.0"
30+
:version "0.4.0"
31+
:homepage "https://github.com/ryukinix/lisp-inference"
3032
:serial t
3133
:depends-on (:lisp-inference
3234
:40ants-routes ;; implicit dependency of reblocks
@@ -42,7 +44,8 @@
4244
:description "Lisp Inference Tests"
4345
:author "Manoel Vilela <[email protected]>"
4446
:license "BSD"
45-
:version "0.2.0"
47+
:version "0.4.0"
48+
:homepage "https://github.com/ryukinix/lisp-inference"
4649
:serial t
4750
:pathname "t"
4851
:depends-on (:lisp-inference :rove)

run-docs.lisp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(load "fix-quicklisp")
2+
;; auto generate docs with staple
3+
(ql:quickload '(:staple :lisp-inference :lisp-inference/tests :lisp-inference/web) :silent t)
4+
5+
(staple:generate :lisp-inference :if-exists :overwrite)
6+
(format t "Docs generated at docs/ directory.~%")
7+
(sb-ext:exit :code 0)

src/pratt.lisp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373

7474
;; entrypoint
7575
(defun parse-logic (input)
76+
"PARSE-LOGIC receive a INPUT as string and use a pratt parser to convert in infix notation"
7677
(setf *tokens* (tokenize input)
7778
*pos* 0)
7879
(parse-expression))

web/webapp.lisp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
(defvar *port* (find-port:find-port))
3131
(defvar *notes*
3232
'("Please, don't be evil. Use less than 10 variables."
33+
"Use spaces around operators. Use 'p ^ q' instead 'p^q'."
3334
"Yes, [+] it's a XOR. Mathematically: p ⊕ q."
3435
"(=> ->) and (<=> <->) are aliases."))
3536

@@ -125,7 +126,7 @@ history.pushState(null, '', url);
125126
(:br)
126127
(:span "Documentation: "
127128
(:a :href
128-
"https://lerax.me/lisp-inference" "lerax.me/lisp-inference"))))
129+
"https://manoel.dev/lisp-inference" "manoel.dev/lisp-inference"))))
129130

130131
(defun render-note (string)
131132
(reblocks/html:with-html ()

0 commit comments

Comments
 (0)