bf35372cb6bf1d575068f8721ee181a4390bbdee
Makefile
... | ... | @@ -0,0 +1,28 @@ |
1 | +# Makefile to retrieve and convert pmwiki pages |
|
2 | +# |
|
3 | + |
|
4 | +DIRECTIVES := ':cell:\|:cellnr:\|:head:\|:redirect\|:source:\|:source\|:sourceend:\|:tableend:\|:toc:' |
|
5 | +NON_NETWORK_PAGES := $(shell ls wiki.d/* | grep -v Network\.) |
|
6 | +PM_SAFE_PAGES := $(shell grep -vl "$(DIRECTIVES)" $(NON_NETWORK_PAGES)) |
|
7 | +MD_SAFE_PAGES := $(patsubst wiki.d/%,%.md,$(PM_SAFE_PAGES)) |
|
8 | +MD_GROUPED_PAGES := $(subst .,/,$(MD_SAFE_PAGES)) |
|
9 | + |
|
10 | +WIKI := http://markferry.net/pmwiki/pmwiki.php |
|
11 | +MARKDOWNS := $(patsubst %.moin,%.md,$(DOCS)) |
|
12 | +PMDOWN := ruby ~/src/pmdown/rb/convert_pm2md.rb |
|
13 | + |
|
14 | +# Construct a curl argument list to retrieve all URLs over a single connection |
|
15 | +# and output each to a .raw file |
|
16 | +CURL_ALL := $(shell echo $(NAMES) | sed -e "s%\S\+%\'$(WIKI)/&?action=markdown\' -o &.md%g") |
|
17 | + |
|
18 | +.PHONY: FORCE help |
|
19 | + |
|
20 | +default: help |
|
21 | +help: |
|
22 | + echo grep -vl "$(DIRECTIVES)" $(NON_NETWORK_PAGES) |
|
23 | + |
|
24 | +%.md: FORCE |
|
25 | + mkdir -p $(dir $@) |
|
26 | + curl "$(WIKI)?n=$(subst /,.,$(basename $@))&action=markdown" -o $@ |
|
27 | + |
|
28 | +all: $(MD_GROUPED_PAGES) |
convert.sh
... | ... | @@ -1,3 +0,0 @@ |
1 | -# Sh |
|
2 | - |
|
3 | -The page "convert.sh" doesn't exist. |
|
... | ... | \ No newline at end of file |