diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..662681f8a --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +VERSION := $(shell cat shard.yml | grep "^version" | cut -d\ -f2) +.PHONY: doc + +doc: bin/gi-crystal + @echo "Generating documentation for Gtk4.cr version $(VERSION)..." + ./bin/gi-crystal + # We do this to avoid crystal doc generate links to generated files + echo " " >> LICENSE + crystal doc -s -p --project-name="GTK4.cr" --project-version="$(VERSION)" \ + lib/gi-crystal/src/gi-crystal.cr \ + lib/gi-crystal/src/auto/gtk-4.0/gtk.cr + # Put LICENSE file back + git checkout LICENSE + +bin/gi-crystal: + shards install diff --git a/README.md b/README.md index 2ed44e1ef..bf5c7f4c5 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,7 @@ API docs can be found at https://hugopl.github.io/gtk4.cr/ To generate the documentation clone this repository then do: ``` -shards install -./bin/gi-crystal -./bin/make-docs +$ make doc ``` The documentation will be found at `docs/index.html`. diff --git a/bin/make-docs b/bin/make-docs deleted file mode 100755 index c60af9a54..000000000 --- a/bin/make-docs +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env sh - -VERSION=$(cat shard.yml | grep "^version" | cut -d\ -f2) - -echo "Generating documentation for Gtk4.cr version $VERSION..." - -# We do this to avoid crystal doc generate links to generated files -echo " " >> LICENSE -crystal doc -s -p --project-name="GTK4.cr" --project-version="$VERSION" \ -lib/gi-crystal/src/gi-crystal.cr \ -lib/gi-crystal/src/auto/gtk-4.0/gtk.cr - -# Put LICENSE file back -git checkout LICENSE