diff --git a/cookiecutter.json b/cookiecutter.json index 198aada..3bb1a52 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -16,5 +16,6 @@ "specialization": "none", "supervisor": "none", "album_no": "none", - "beeminder_support": "no" + "beeminder_support": "no", + "contribution_declaration": "yes" } diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh index b280885..3e64221 100755 --- a/hooks/post_gen_project.sh +++ b/hooks/post_gen_project.sh @@ -139,6 +139,10 @@ if [ "{{ cookiecutter.beeminder_support }}" = "yes" ]; then cp -r _optional_files/_beeminder_support/* . fi +if [ "{{ cookiecutter.contribution_declaration }}" = "yes" ]; then + cp -r _optional_files/_contribution_declaration/* . +fi + rm -rf _latex-templates _optional_files if [ -e .git ]; then diff --git a/test/configs/amu.yml b/test/configs/amu.yml index 2b6630a..a505a06 100644 --- a/test/configs/amu.yml +++ b/test/configs/amu.yml @@ -9,3 +9,4 @@ default_context: specialization: 'sztuczna inteligencja' supervisor: 'prof. dr hab. Jan Nowak' album_no: '123456' + contribution_declaration: 'no' diff --git a/{{cookiecutter.paper_repo_name}}/.cookiecutter.yml b/{{cookiecutter.paper_repo_name}}/.cookiecutter.yml index 2a55a16..0239563 100644 --- a/{{cookiecutter.paper_repo_name}}/.cookiecutter.yml +++ b/{{cookiecutter.paper_repo_name}}/.cookiecutter.yml @@ -17,3 +17,4 @@ default_context: supervisor: '{{ cookiecutter.supervisor }}' album_no: '{{ cookiecutter.album_no }}' beeminder_support: '{{ cookiecutter.beeminder_support }}' + contribution_declaration: '{{ cookiecutter.contribution_declaration }}' diff --git a/{{cookiecutter.paper_repo_name}}/Makefile b/{{cookiecutter.paper_repo_name}}/Makefile index 933fe56..8c68b88 100644 --- a/{{cookiecutter.paper_repo_name}}/Makefile +++ b/{{cookiecutter.paper_repo_name}}/Makefile @@ -38,9 +38,17 @@ SCOREFILES=$(shell perl extract-score-files.pl $(CONTENT_TEX_SOURCES)) clean_latex_stuff=rm -rf *.aux *.nav *.toc *.log *.out *.blg *.bbl autozoil-log.txt autozoil.xml the-appendix.pdf supplement.zip $(PAPER_ID).pdf $(PAPER_ID).zip arxiv-$(PAPER_ID).pdf arxiv-$(PAPER_ID).tar.gz abstract.txt sentences.txt stats.txt $(EXTRA_PDFS) helpers/$(PAPER_ID)-contribution-declaration.tex helpers/$(PAPER_ID)-contribution-declaration.pdf helpers/*.aux helpers/*.bbl helpers/*.bcf helpers/*.blg helpers/*.log helpers/*.run.xml ifeq ($(HAS_SUPPLEMENT),yes) +{% if cookiecutter.contribution_declaration == 'yes' %} all: $(PAPER_ID).pdf abstract.txt supplement.zip stats.txt sentences.txt helpers/$(PAPER_ID)-contribution-declaration.pdf +{% else %} +all: $(PAPER_ID).pdf abstract.txt supplement.zip stats.txt sentences.txt +{% endif %} else +{% if cookiecutter.contribution_declaration == 'yes' %} all: $(PAPER_ID).pdf abstract.txt stats.txt sentences.txt helpers/$(PAPER_ID)-contribution-declaration.pdf +{% else %} +all: $(PAPER_ID).pdf abstract.txt stats.txt sentences.txt +{% endif %} endif source-pack: $(PAPER_ID).zip @@ -109,7 +117,7 @@ titlepage.pdf: titlepage.tex xelatex $< endif - +{% if cookiecutter.contribution_declaration == 'yes' %} helpers/$(PAPER_ID)-contribution-declaration.pdf: helpers/$(PAPER_ID)-contribution-declaration.tex bibliography.bib (cd helpers && pdflatex $(PAPER_ID)-contribution-declaration.tex) (cd helpers && biber $(PAPER_ID)-contribution-declaration) @@ -117,7 +125,7 @@ helpers/$(PAPER_ID)-contribution-declaration.pdf: helpers/$(PAPER_ID)-contributi helpers/$(PAPER_ID)-contribution-declaration.tex: contributions.yaml helpers/contribution-declaration.tex.tmpl helpers/generate-contribution-declaration.py (cd helpers && python3 generate-contribution-declaration.py) < $< > $@ - +{% endif %} clean: $(clean_latex_stuff) diff --git a/{{cookiecutter.paper_repo_name}}/contributions.yaml b/{{cookiecutter.paper_repo_name}}/_optional_files/_contribution_declaration/contributions.yaml similarity index 100% rename from {{cookiecutter.paper_repo_name}}/contributions.yaml rename to {{cookiecutter.paper_repo_name}}/_optional_files/_contribution_declaration/contributions.yaml