<commit_before>SOURCE=./source
TMP_BOOK=./book
DEST=./dist
IGNORE=.git
EXT_LICENSE=./_license
EXT_CONFIG=./_config

default: main
	-@echo "=================="
	-@echo "  Build Success!  "
	-@echo "=================="

init:
	-rm -rf dist

pre-build:
	cp -r $(SOURCE) $(TMP_BOOK)
	rm -rf $(TMP_BOOK)/$(IGNORE)

    # create book.json
	gitbook-ext jsonmerge $(SOURCE)/book.json $(EXT_CONFIG)/book.json > $(TMP_BOOK)/book.json

build:
	gitbook build $(TMP_BOOK) $(DEST)/book
	gitbook-ext minify --verbose $(DEST)/book

package:
	cp $(TMP_BOOK)/book.json $(DEST)/book
	cp -rf $(EXT_LICENSE) $(DEST)/book/_license
	cd dist && zip -vr ./book.zip ./book/ 

	# post package
	md5 -q $(DEST)/book.zip > $(DEST)/md5

finish: 	
	# clean up
	rm -rf $(TMP_BOOK)
	
main: init pre-build build package finish
	

deploy:
	git push origin gh-pages

update-source:
	git submodule update --remote $(SOURCE)

serve:
	@echo "serve on ~> http://localhost:8000"
	cd $(DEST)/book && python -m SimpleHTTPServer 8000
	
.PHONY: default main init pre-build build package finish
<commit_msg>specify the source config file<commit_after>SOURCE=./source
SOURCE_CONFIG_FILE=$(SOURCE)/book.json
TMP_BOOK=./book
DEST=./dist
IGNORE=.git
EXT_LICENSE=./_license
EXT_CONFIG=./_config

default: main
	-@echo "=================="
	-@echo "  Build Success!  "
	-@echo "=================="

init:
	-rm -rf dist

pre-build:
	cp -r $(SOURCE) $(TMP_BOOK)
	rm -rf $(TMP_BOOK)/$(IGNORE)

    # create book.json
	gitbook-ext jsonmerge $(SOURCE_CONFIG_FILE) $(EXT_CONFIG)/book.json > $(TMP_BOOK)/book.json

build:
	gitbook build $(TMP_BOOK) $(DEST)/book
	gitbook-ext minify --verbose $(DEST)/book

package:
	cp $(TMP_BOOK)/book.json $(DEST)/book
	cp -rf $(EXT_LICENSE) $(DEST)/book/_license
	cd dist && zip -vr ./book.zip ./book/ 

	# post package
	md5 -q $(DEST)/book.zip > $(DEST)/md5

finish: 	
	# clean up
	rm -rf $(TMP_BOOK)
	
main: init pre-build build package finish
	

deploy:
	git push origin gh-pages

update-source:
	git submodule update --remote $(SOURCE)

serve:
	@echo "serve on ~> http://localhost:8000"
	cd $(DEST)/book && python -m SimpleHTTPServer 8000
	
.PHONY: default main init pre-build build package finish

{'fraction_non_alphanumeric': 0.18640955004591367, 'fraction_numerical': 0.009182736455463728, 'mean_word_length': 3.8207964601769913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2413261', 'n_tokens_mistral': 845, 'n_tokens_neox': 816, 'n_words': 211}