forked from unixdigest/phpthewrongway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (68 loc) · 5.65 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FILENAME = index
OUTPUT_DIR = public_html/
HTML_CSS = /css/html.css
# pygments, kate, monochrome, espresso, haddock, tango, zenburn
HTML_CODE_STYLE = zenburn
# Language stuff
# English
TOP_FILE_EN = inc/logo_and_date_en.txt
TEMPLATE_EN = inc/default_en.html5
FINAL_OUTPUT_EN = $(OUTPUT_DIR)$(FILENAME)
LAST_UPDATED_STR_EN = Last updated:
DATE_FORMAT_EN = +%Y-%m-%d
# Danish
TOP_FILE_DA = inc/logo_and_date_da.txt
TEMPLATE_DA = inc/default_da.html5
FINAL_OUTPUT_DA = $(OUTPUT_DIR)da/$(FILENAME)
LAST_UPDATED_STR_DA = Sidst opdateret:
DATE_FORMAT_DA = +%d\/%m-%Y
# Spanish
TOP_FILE_ES = inc/logo_and_date_es.txt
TEMPLATE_ES = inc/default_es.html5
FINAL_OUTPUT_ES = $(OUTPUT_DIR)es/$(FILENAME)
LAST_UPDATED_STR_ES = Última actualización:
DATE_FORMAT_ES = +%Y-%m-%d
# Portuguese
TOP_FILE_PT_BR = inc/logo_and_date_pt_br.txt
TEMPLATE_PT_BR = inc/default_pt_br.html5
FINAL_OUTPUT_PT_BR = $(OUTPUT_DIR)pt_br/$(FILENAME)
LAST_UPDATED_STR_PT_BR = Última atualização:
DATE_FORMAT_PT_BR = +%Y-%m-%d
# Russian
TOP_FILE_RU = inc/logo_and_date_ru.txt
TEMPLATE_RU = inc/default_ru.html5
FINAL_OUTPUT_RU = $(OUTPUT_DIR)ru/$(FILENAME)
LAST_UPDATED_STR_RU = Последнее обновление:
DATE_FORMAT_RU = +%Y-%m-%d
# Persian (Farsi)
TOP_FILE_FA = inc/logo_and_date_fa.txt
TEMPLATE_FA = inc/default_fa.html5
HTML_CSS_RTL = ../css/html-rtl.css
FINAL_OUTPUT_FA = $(OUTPUT_DIR)fa/$(FILENAME)
LAST_UPDATED_STR_FA = آخرین بروزرسانی:
DATE_FORMAT_FA = +%d-%m-%Y
# Setup for Pandoc
html-da:
mkdir -p $(OUTPUT_DIR)da
pandoc -s --highlight-style $(HTML_CODE_STYLE) -S -w html5 --template $(TEMPLATE_DA) --toc -c $(HTML_CSS) -o $(FINAL_OUTPUT_DA).html $(TOP_FILE_DA) sections/da/welcome.md sections/da/the_danger_of_extremism.md sections/da/always_use_a_framework.md sections/da/always_use_a_design_pattern.md sections/da/always_use_oop.md sections/da/being_afraid_of_other_peoples_code.md sections/da/follow_the_php_fig_standards.md sections/da/neglecting_security.md sections/da/faq.md sections/da/recommended_reading.md sections/da/contribute.md
grep -rl "##DATEFIELD##" $(FINAL_OUTPUT_DA).html | xargs sed -i "s/##DATEFIELD##/$(LAST_UPDATED_STR_DA) `date '$(DATE_FORMAT_DA)'`/"
html-en:
pandoc -s --highlight-style $(HTML_CODE_STYLE) -S -w html5 --template $(TEMPLATE_EN) --toc -c $(HTML_CSS) -o $(FINAL_OUTPUT_EN).html $(TOP_FILE_EN) sections/en/welcome.md sections/en/the_danger_of_extremism.md sections/en/always_use_a_framework.md sections/en/always_use_a_design_pattern.md sections/en/always_use_oop.md sections/en/being_afraid_of_other_peoples_code.md sections/en/follow_the_php_fig_standards.md sections/en/neglecting_security.md sections/en/faq.md sections/en/recommended_reading.md sections/en/contribute.md
grep -rl "##DATEFIELD##" $(FINAL_OUTPUT_EN).html | xargs sed -i "s/##DATEFIELD##/$(LAST_UPDATED_STR_EN) `date '$(DATE_FORMAT_EN)'`/"
html-es:
mkdir -p $(OUTPUT_DIR)es
pandoc -s --highlight-style $(HTML_CODE_STYLE) -S -w html5 --template $(TEMPLATE_ES) --toc -c $(HTML_CSS) -o $(FINAL_OUTPUT_ES).html $(TOP_FILE_ES) sections/es/welcome.md sections/es/the_danger_of_extremism.md sections/es/always_use_a_framework.md sections/es/always_use_a_design_pattern.md sections/es/always_use_oop.md sections/es/being_afraid_of_other_peoples_code.md sections/es/follow_the_php_fig_standards.md sections/es/neglecting_security.md sections/es/faq.md sections/es/recommended_reading.md sections/es/contribute.md
grep -rl "##DATEFIELD##" $(FINAL_OUTPUT_ES).html | xargs sed -i "s/##DATEFIELD##/$(LAST_UPDATED_STR_ES) `date '$(DATE_FORMAT_ES)'`/"
html-pt_br:
mkdir -p $(OUTPUT_DIR)pt_br
pandoc -s --highlight-style $(HTML_CODE_STYLE) -S -w html5 --template $(TEMPLATE_PT_BR) --toc -c $(HTML_CSS) -o $(FINAL_OUTPUT_PT_BR).html $(TOP_FILE_PT_BR) sections/pt_br/welcome.md sections/pt_br/the_danger_of_extremism.md sections/pt_br/always_use_a_framework.md sections/pt_br/always_use_a_design_pattern.md sections/pt_br/always_use_oop.md sections/pt_br/being_afraid_of_other_peoples_code.md sections/pt_br/follow_the_php_fig_standards.md sections/pt_br/neglecting_security.md sections/pt_br/faq.md sections/pt_br/recommended_reading.md sections/pt_br/contribute.md
grep -rl "##DATEFIELD##" $(FINAL_OUTPUT_PT_BR).html | xargs sed -i "s/##DATEFIELD##/$(LAST_UPDATED_STR_PT_BR) `date '$(DATE_FORMAT_PT_BR)'`/"
html-ru:
mkdir -p $(OUTPUT_DIR)ru
pandoc -s --highlight-style $(HTML_CODE_STYLE) -S -w html5 --template $(TEMPLATE_RU) --toc -c $(HTML_CSS) -o $(FINAL_OUTPUT_RU).html $(TOP_FILE_RU) sections/ru/welcome.md sections/ru/the_danger_of_extremism.md sections/ru/always_use_a_framework.md sections/ru/always_use_a_design_pattern.md sections/ru/always_use_oop.md sections/ru/being_afraid_of_other_peoples_code.md sections/ru/follow_the_php_fig_standards.md sections/ru/neglecting_security.md sections/ru/faq.md sections/ru/recommended_reading.md sections/ru/contribute.md
grep -rl "##DATEFIELD##" $(FINAL_OUTPUT_RU).html | xargs sed -i "s/##DATEFIELD##/$(LAST_UPDATED_STR_RU) `date '$(DATE_FORMAT_RU)'`/"
html-fa:
mkdir -p $(OUTPUT_DIR)fa
pandoc -s --highlight-style $(HTML_CODE_STYLE) -S -w html5 --template $(TEMPLATE_FA) --toc -c $(HTML_CSS_RTL) -o $(FINAL_OUTPUT_FA).html $(TOP_FILE_FA) sections/fa/welcome.md sections/fa/the_danger_of_extremism.md sections/fa/always_use_a_framework.md sections/fa/always_use_a_design_pattern.md sections/fa/always_use_oop.md sections/fa/being_afraid_of_other_peoples_code.md sections/fa/follow_the_php_fig_standards.md sections/fa/neglecting_security.md sections/fa/faq.md sections/fa/recommended_reading.md sections/fa/contribute.md
grep -rl "##DATEFIELD##" $(FINAL_OUTPUT_FA).html | xargs sed -i "s/##DATEFIELD##/$(LAST_UPDATED_STR_FA) `date '$(DATE_FORMAT_FA)'`/"
all: html-da html-en html-es html-fa html-pt_br html-ru