blob: fc49ee2ef1ae8b3a198a4abcb9117e2b6d65eac7 [file] [log] [blame]
# This contains targets to build the website and add the documentation generated from the Cassandra source.
# The add-doc command build the document from the cassandra sources pointed by the CASSANDRA_DIR environment variable
# and copy it in doc/<version>/. The add-latest-doc does the same but also create/modify the doc/latest symlink so it
# points to the doc it just created (so to use to replace the "current" documentation).
# Note that the add-doc and add-latest-doc are not called automatically from other targets and needs to be called
# manually. That's because there is many cases where you want to just update the website, without reconstructing the
# documentation. Note however that the doc target do rebuild the website.
$(error You should set the CASSANDRA_DIR environment variable to the git source dir, checkout on the proper branch)
.build-doc: .check-env
# Not declaring DOC_VERSION at top-level cause it calls ant and that's stupidly slow
$(eval DOC_VERSION=$(shell echo `cd $(CASSANDRA_DOC_DIR)/..; ant echo-base-version | grep '\[echo\]' | awk '{print $$2}'`))
$(eval DOC_DIR="doc/$(DOC_VERSION)")
# Nodetool docs are autogenerated, but that needs nodetool to be built
@cd $(CASSANDRA_DIR); ant jar
@cd $(CASSANDRA_DOC_DIR); make website
@if [ -d $(DOC_DIR) ]; then rm -rf $(DOC_DIR); fi
@cp -r $(CASSANDRA_DOC_DIR)/build/html $(DOC_DIR)
@ln -s -f -T $(DOC_VERSION) "doc/latest"
@bundle exec jekyll build
@bundle exec jekyll clean
@bundle exec jekyll serve
add-doc: .build-doc build
add-latest-doc: .build-doc .latest-doc-link build