add ability to split md into code snippets, check with cpplint

This commit is contained in:
Thibault Kruse
2016-04-24 22:19:50 +02:00
parent 3b93c16fbd
commit 41cf08cc4d
4 changed files with 6651 additions and 1 deletions

View File

@@ -17,9 +17,9 @@ all: \
check-markdown \
check-references \
check-notabs \
cpplint-all \
check-badchars
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
@@ -77,6 +77,29 @@ check-badchars: $(SOURCEPATH) $(BUILD_DIR) Makefile
cat ../CppCoreGuidelines.md | nl -ba | grep -P '||”|“|¸||…|¦' > $(BUILD_DIR)/CppCoreGuidelines.md.badchars || true
if [ -s $(BUILD_DIR)/CppCoreGuidelines.md.badchars ]; then echo 'Warning: Undesired chars (–’‘“”¸…¦) found:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.badchars; false; fi;
#### Cpplint
.PHONY: cpplint-all
cpplint-all: $(BUILD_DIR)/codeblocks $(BUILD_DIR)/Makefile python/Makefile.in
cd $(BUILD_DIR)/codeblocks; $(MAKE) cpplint-all -k
#### generic makefile for sourceblocks (need to be evaluated after c++ file generation)
$(BUILD_DIR)/Makefile: python/Makefile.in
cp python/Makefile.in $(BUILD_DIR)/codeblocks/Makefile
#### split md file into plain text and code
$(BUILD_DIR)/codeblocks: splitfile
$(BUILD_DIR)/plain.txt: splitfile
.PHONY: splitfile
splitfile: $(SOURCEPATH) ./python/md-split.py
python ./python/md-split.py $(SOURCEPATH) $(BUILD_DIR)/plain.txt $(BUILD_DIR)/codeblocks
#### install npm modules
# install/update npm dependencies defined in file package.json
# requires npm (nodejs package manager)