2020-12-21 10:41:07 +00:00
|
|
|
INPUT_DATA_DIR = ../Tests-Data
|
|
|
|
BIBLIO_FILE = $(INPUT_DATA_DIR)/BIBLIO_CSL-Tests.json
|
|
|
|
INPUT_FILE = $(INPUT_DATA_DIR)/CSL-Tests.md
|
2020-12-21 17:01:50 +00:00
|
|
|
STYLESHEETS_DIR = ..
|
2020-12-21 10:41:07 +00:00
|
|
|
VALIDATION_FILE_SUFFIX = _CSL-Validation.html
|
|
|
|
OUTPUT_FILE_SUFFIX = _CSL-Tests.html
|
|
|
|
CSL_FILE_SUFFIX = .csl
|
2021-02-03 00:25:23 +00:00
|
|
|
ifdef JOURNAL
|
2021-04-16 22:14:08 +01:00
|
|
|
THIS_STYLE_DIR = $(STYLESHEETS_DIR)/$(JOURNAL)
|
2021-02-03 00:25:23 +00:00
|
|
|
DOC_FILE = $(STYLESHEETS_DIR)/$(JOURNAL)/GUIDE_$(JOURNAL)
|
|
|
|
VALIDATION_PROV_FILE = $(PROV_PREFIX)$(JOURNAL)$(VALIDATION_FILE_SUFFIX)
|
|
|
|
CSL_FILE = $(THIS_STYLE_DIR)/$(JOURNAL)$(CSL_FILE_SUFFIX)
|
|
|
|
VALIDATION_FILE = $(THIS_STYLE_DIR)/$(JOURNAL)$(VALIDATION_FILE_SUFFIX)
|
|
|
|
OUTPUT_FILE = $(THIS_STYLE_DIR)/$(JOURNAL)$(OUTPUT_FILE_SUFFIX)
|
|
|
|
FILTERS_FILE_FIRST = $(THIS_STYLE_DIR)/$(JOURNAL)_filters-first.txt
|
|
|
|
FILTERS_LIST_FIRST != ./get-filters.sh $(FILTERS_FILE_FIRST)
|
|
|
|
FILTERS_FILE_LAST = $(THIS_STYLE_DIR)/$(JOURNAL)_filters-last.txt
|
|
|
|
else
|
|
|
|
DOC_DIR = ../Documentation
|
|
|
|
DOC_FILE = $(DOC_DIR)/GUIDE_CSL-Clio
|
|
|
|
endif
|
2020-12-21 10:41:07 +00:00
|
|
|
FILTERS_LIST_LAST != ./get-filters.sh $(FILTERS_FILE_LAST)
|
2021-01-21 20:09:13 +00:00
|
|
|
DOC_DIR = ../Documentation
|
|
|
|
DOC_FILE = $(DOC_DIR)/GUIDE_CSL-Clio
|
2020-12-21 10:41:07 +00:00
|
|
|
PANDOC_OPTIONS = -s \
|
|
|
|
$(FILTERS_LIST_FIRST) \
|
|
|
|
-C \
|
|
|
|
--bibliography=$(BIBLIO_FILE) \
|
|
|
|
--csl=$(CSL_FILE) \
|
2021-02-09 21:09:09 +00:00
|
|
|
-M lang=fr \
|
2020-12-21 10:41:07 +00:00
|
|
|
$(FILTERS_LIST_LAST)
|
|
|
|
PROV_PREFIX = PROV_
|
|
|
|
HTML-VIEWER = palemoon
|
2021-03-05 21:51:01 +00:00
|
|
|
COMMON_DOC_OPTIONS=-s \
|
|
|
|
--filter pandoc-crossref \
|
|
|
|
-L license-dans-metadonnees.lua \
|
2021-03-07 22:05:17 +00:00
|
|
|
--top-level-division=chapter \
|
2021-03-05 21:51:01 +00:00
|
|
|
$(DOC_FILE).md \
|
|
|
|
--resource-path=.:$(DOC_DIR)
|
2020-12-21 10:41:07 +00:00
|
|
|
|
|
|
|
test : $(CSL_FILE) \
|
|
|
|
$(VALIDATION_FILE) \
|
|
|
|
$(BIBLIO_FILE) \
|
|
|
|
$(INPUT_FILE)
|
|
|
|
pandoc $(PANDOC_OPTIONS) \
|
|
|
|
$(INPUT_FILE) \
|
|
|
|
-o $(OUTPUT_FILE)
|
|
|
|
echo "Résultat de la comparaison"
|
|
|
|
echo "============="
|
|
|
|
diff -s -C 0 \
|
|
|
|
$(OUTPUT_FILE) \
|
|
|
|
$(VALIDATION_FILE)
|
|
|
|
echo "============="
|
|
|
|
|
2021-01-19 21:34:26 +00:00
|
|
|
test-compact: test
|
|
|
|
dwdiff -3 $(OUTPUT_FILE) $(VALIDATION_FILE) | sort | uniq
|
|
|
|
|
|
|
|
|
2020-12-21 10:41:07 +00:00
|
|
|
validation-prov: $(VALIDATION_PROV_FILE)
|
|
|
|
$(HTML-VIEWER) $(VALIDATION_PROV_FILE)
|
|
|
|
|
|
|
|
$(VALIDATION_PROV_FILE): $(BIBLIO_FILE) $(CSL_FILE) $(INPUT_FILE)
|
|
|
|
pandoc $(PANDOC_OPTIONS) \
|
|
|
|
$(INPUT_FILE) \
|
|
|
|
-o $(VALIDATION_PROV_FILE)
|
|
|
|
|
2020-12-24 11:38:51 +00:00
|
|
|
validation-docx: $(VALIDATION_DOCX_FILE)
|
|
|
|
|
|
|
|
$(VALIDATION_DOCX_FILE): $(BIBLIO_FILE) $(CSL_FILE) $(INPUT_FILE)
|
|
|
|
pandoc $(PANDOC_OPTIONS) \
|
|
|
|
$(INPUT_FILE) \
|
|
|
|
-o $(VALIDATION_DOCX_FILE)
|
|
|
|
|
2020-12-21 10:41:07 +00:00
|
|
|
$(INPUT_FILE): $(BIBLIO_FILE)
|
|
|
|
./generer-md-pour-citeproc.sh $(BIBLIO_FILE) $(INPUT_FILE)
|
|
|
|
|
|
|
|
install: $(VALIDATION_PROV_FILE)
|
|
|
|
mv $(VALIDATION_PROV_FILE) $(VALIDATION_FILE)
|
|
|
|
|
|
|
|
clean:
|
2020-12-21 17:01:50 +00:00
|
|
|
rm $(STYLESHEETS_DIR)/*/*$(OUTPUT_FILE_SUFFIX)
|
2021-02-03 00:25:23 +00:00
|
|
|
|
2021-04-04 22:32:37 +01:00
|
|
|
doc: docA4 docDiapo
|
|
|
|
|
|
|
|
docA4: $(DOC_FILE).md TEMPLATE_Guide-CSL-Clio.latex
|
2021-03-05 21:51:01 +00:00
|
|
|
pandoc $(COMMON_DOC_OPTIONS) -o $(DOC_FILE)_A4.pdf --pdf-engine=lualatex --top-level-division=chapter --template=TEMPLATE_Guide-CSL-Clio.latex
|
2021-04-04 22:32:37 +01:00
|
|
|
|
|
|
|
docDiapo: $(DOC_FILE).md TEMPLATE_Guide-CSL-Clio.context
|
2021-03-05 22:20:57 +00:00
|
|
|
pandoc $(COMMON_DOC_OPTIONS) -o $(DOC_FILE)_Diapo.tex -t context --template=TEMPLATE_Guide-CSL-Clio.context && \
|
2021-03-07 17:56:55 +00:00
|
|
|
cd $(DOC_DIR) && \
|
|
|
|
context --noconsole --errors $(DOC_FILE)_Diapo.tex
|