diff options
author | 2018-01-04 12:53:07 +0000 | |
---|---|---|
committer | 2018-01-04 12:53:07 +0000 | |
commit | 58221f55db5675c6107d19679c46a216ed072aca (patch) | |
tree | f4f86c8ecd35538da492524dec549566daf40809 /Makefile.doc | |
parent | 0600f8c058f39c7afec9f915657e06f158d21c47 (diff) | |
download | coredns-58221f55db5675c6107d19679c46a216ed072aca.tar.gz coredns-58221f55db5675c6107d19679c46a216ed072aca.tar.zst coredns-58221f55db5675c6107d19679c46a216ed072aca.zip |
Manual pages (#1346)
* Add manual pages
Generate manual pages from the README and extend README with Name and
Description sections.
The generation requires 'ronn' which may not be available. Just check in
all generated manual pages.
Diffstat (limited to 'Makefile.doc')
-rw-r--r-- | Makefile.doc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Makefile.doc b/Makefile.doc new file mode 100644 index 000000000..5ab6bbf3d --- /dev/null +++ b/Makefile.doc @@ -0,0 +1,30 @@ +ORG:=organization=CoreDNS +RONN:=ronn -r +PLUGINS:=$(wildcard plugin/*/README.md) +READMES:=$(subst plugin/,,$(PLUGINS)) +READMES:=$(subst /README.md,,$(READMES)) +PLUGINS:=$(subst plugin/,corendns-,$(PLUGINS)) +PLUGINS:=$(subst /README.md,(7),$(PLUGINS)) + +all: man/coredns.1 plugins + +man/coredns.1: coredns.1.md + sed -e 's/^\(#.*\)/\U\1/' $< > $@.md + sed -i -e "s/@@PLUGINS@@/$(PLUGINS)/" $@.md + $(RONN) --$(ORG) --manual='CoreDNS' $@.md + rm $@.md + +.PHONY: plugins +plugins: + for README in $(READMES); do \ + $(MAKE) -f Makefile.doc man/coredns-$$README.7; \ + done + +man/coredns-%.7: plugin/%/README.md + sed -e 's/^\(#.*\)/\U\1/' $< > $@.md + $(RONN) --$(ORG) --manual='CoreDNS plugins' $@.md + rm $@.md + +PHONY: clean +clean: + rm -f man/* |