Add Love2D API generation flag option to make docs target
This commit is contained in:
parent
0e0121825d
commit
f0c512575e
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
/result
|
||||
/lua*.html
|
||||
/build
|
||||
/src/fennel-ls/docs/generated/love2d.fnl
|
||||
|
||||
2
Makefile
2
Makefile
@ -30,7 +30,7 @@ repl:
|
||||
$(FENNEL) $(FENNELFLAGS)
|
||||
|
||||
docs:
|
||||
$(FENNEL) $(FENNELFLAGS) tools/get-docs.fnl
|
||||
$(FENNEL) $(FENNELFLAGS) tools/get-docs.fnl $(GET_DOCS_FLAGS)
|
||||
|
||||
rm-docs:
|
||||
rm -rf src/fennel-ls/docs/
|
||||
|
||||
@ -21,6 +21,17 @@ $ make rm-docs
|
||||
$ make docs
|
||||
```
|
||||
|
||||
## Including LÖVE documentation
|
||||
Due to license incompatibility between fennel-ls and the official LÖVE
|
||||
documentation, this repository cannot include the LÖVE documentation by
|
||||
default. It must be generated manually.
|
||||
|
||||
This can be done by passing a flag to the `docs` target.
|
||||
|
||||
```sh
|
||||
$ make docs GET_DOCS_FLAGS=--generate-love2d
|
||||
```
|
||||
|
||||
## Vendored Dependencies
|
||||
The vendored dependencies are very easy to solve. You delete the dependency
|
||||
files by running `make rm-deps`.
|
||||
|
||||
@ -27,9 +27,9 @@
|
||||
(fn main []
|
||||
(sh :mkdir :-p :build/)
|
||||
(sh :mkdir :-p :src/fennel-ls/docs/generated/)
|
||||
(let [{:convert lua-manual} (require :tools.get-docs.lua-manual)
|
||||
{:convert tic80-manual} (require :tools.get-docs.tic80)
|
||||
{:convert download-and-convert-love2d-manual!} (require :tools.get-docs.love2d)]
|
||||
(let [generate-love2d-docs? (case arg [:--generate-love2d] true _ false)
|
||||
{:convert lua-manual} (require :tools.get-docs.lua-manual)
|
||||
{:convert tic80-manual} (require :tools.get-docs.tic80)]
|
||||
(derive-docs-from-url "https://www.lua.org/manual/5.1/manual.html"
|
||||
:lua51.fnl lua-manual)
|
||||
(derive-docs-from-url "https://www.lua.org/manual/5.2/manual.html"
|
||||
@ -39,8 +39,11 @@
|
||||
(derive-docs-from-url "https://www.lua.org/manual/5.4/manual.html"
|
||||
:lua54.fnl lua-manual)
|
||||
(derive-docs-from-url "https://tic80.com/learn" :tic80.fnl tic80-manual)
|
||||
(write-doc-file! :love2d.fnl
|
||||
"https://github.com/love2d-community/love-api/"
|
||||
(download-and-convert-love2d-manual!))))
|
||||
(when generate-love2d-docs?
|
||||
(let [{:convert download-and-convert-love2d-manual!} (require :tools.get-docs.love2d)]
|
||||
(print "generating Love2D docs...")
|
||||
(write-doc-file! :love2d.fnl
|
||||
"https://github.com/love2d-community/love-api/"
|
||||
(download-and-convert-love2d-manual!))))))
|
||||
|
||||
(main)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user