1
0
Fork 0

Inore links that pass the border of books.

This commit is contained in:
Wilfried Goesgens 2016-05-24 11:10:43 +02:00
parent fe1229b67d
commit b322e88672
1 changed files with 33 additions and 27 deletions

View File

@ -1,3 +1,5 @@
ALLBOOKS=HTTP AQL Users
all: build-books
.PHONY:
@ -53,10 +55,13 @@ ppbook-precheck-bad-code-sections:
ppbook-check-html-link:
@echo "##### checking for invalid HTML links in $(NAME)"
@if test "`egrep -r '\[.*\]\(.*\)' ppbooks/$(NAME) |grep '\.md:' |grep html |grep -v http://|grep -v https:// |grep -v header.css |wc -l`" -gt 0; then \
@echo "$(ALLBOOKS)" |sed -e 's; ;\n;g' |sed -e 's;^;/;' -e 's;$$;/;' > /tmp/books.regex
@egrep -r '\[.*\]\(.*\)' ppbooks/$(NAME)|grep '\.md:'| grep 'html'| grep -v 'http://' | grep -v 'https://' | grep -v 'header.css' | grep -v -f /tmp/books.regex > /tmp/relative_html_links.txt ||true
@if test "`cat /tmp/relative_html_links.txt |wc -l`" -gt 0; then \
echo "Found links to .html files inside of the document! use <foo>.md instead!"; \
echo; \
egrep -r '\[.*\]\(.*\)' ppbooks/$(NAME) | grep '\.md:' | grep html |grep -v http://|grep -v https:// |grep -v header.css ; \
cat /tmp/relative_html_links.txt; \
exit 1; \
fi
@ -257,16 +262,17 @@ build-books-keep-md:
make build-book NAME=$(NAME)
build-books:
make clean-intermediate NAME=Users
make clean-intermediate NAME=AQL
make clean-intermediate NAME=HTTP
make build-books-keep-md NAME=Users
make build-books-keep-md NAME=AQL
make build-books-keep-md NAME=HTTP
for book in $(ALLBOOKS); do \
make clean-intermediate NAME=$${book}; \
done
#make ppbook-check-html-link NAME=Users
#make ppbook-check-html-link NAME=AQL
#make ppbook-check-html-link NAME=HTTP
for book in $(ALLBOOKS); do \
make build-books-keep-md NAME=$${book}; \
done
for book in $(ALLBOOKS); do \
make ppbook-check-html-link NAME=$${book}; \
done
make check-docublocks
echo '<head><meta http-equiv="refresh" content="0; url=Users/"></head><body></body>' > books/index.html