Makefile 825 B

1234567891011121314151617181920212223
  1. INPUTS = index.md concepts.md reference.md security.md migration.md whats_new.md
  2. all: $(INPUTS:.md=.html)
  3. tmp_menu.html: $(INPUTS)
  4. echo '<div id="index">' > $@
  5. (echo '<h2>Documentation index</h2>'; \
  6. for file in $^; do echo -n '1. ['; sed -n '1 s!^# Nanopb: !! p' $$file; \
  7. echo -n "]("; echo $$file | sed 's/.md/.html)/' ; done;) | \
  8. pandoc -f markdown -t html5 >> $@
  9. echo '</div>' >> $@
  10. %.html: %.md tmp_menu.html
  11. sed '1 s!#!%!' $< | \
  12. pandoc -s -f markdown -t html5 -c lsr.css --toc --toc-depth=4 \
  13. --variable 'header-includes=<link href="favicon.ico" type="image/x-icon" rel="shortcut icon" />' \
  14. --indented-code-classes=c \
  15. -o $@
  16. sed -i '/<nav/e cat feedback.html' $@
  17. sed -i 's/doc_page_name_placeholder/$</' $@
  18. sed -i 's!<nav[^>]*>!\0<b>Contents:</b>!' $@
  19. sed -i '/<nav/e cat tmp_menu.html' $@