From baed3fcdf83e4860c92bbb982cc82d92b34edda4 Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Mon, 18 May 2020 23:24:13 +0200 Subject: [PATCH 01/10] #38 basic pandoc workflow --- .gitignore | 1 + .gitlab-ci.yml | 12 ++++++++++++ .vscode/tasks.json | 13 ++++++++++++- main.tex | 4 ++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a4ad97d..7b8b3d8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ temp/ ## main build output main.pdf +chapter/out.tex ## IDE and Editor files .idea/** diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df7d0b7..30d72cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,18 @@ latexmk: - ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` - mv main.pdf main@$ci_commit_sha_short.pdf +#pandoc_latexmk: +# image: pandoc/latex +# stage: build +# artifacts: +# paths: +# - main*.pdf +# expire_in: 2d +# script: +# - pandoc --filter pandoc-crossref --filter pandoc-citeproc -M cref=true --top-level-division=chapter --bibliography library/library.bib --biblatex -o chapter/out.tex chapter/*.md +# - latexmk main.tex +# - ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` +# - mv main.pdf main@$ci_commit_sha_short.pdf hunspell_chapters: image: tmaier/hunspell:latest diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 09f8121..ab79652 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -11,12 +11,23 @@ "kind": "build", "isDefault": true }, - "dependsOn": "clean" + "dependsOrder": "sequence", + "dependsOn": ["clean"] }, { "label": "clean", "type": "shell", "command": "latexmk -C" + }, + { + "label": "pandoc", + "type": "shell", + "command": [ + "pandoc --filter pandoc-crossref --filter pandoc-citeproc ", + "-M cref=true --top-level-division=chapter ", + "--bibliography library/library.bib --biblatex ", + "-o chapter/out.tex chapter/*.md" + ] } ] } \ No newline at end of file diff --git a/main.tex b/main.tex index 28543b7..bdb090c 100644 --- a/main.tex +++ b/main.tex @@ -63,6 +63,10 @@ % \input{chapter/myfile} % \newpage + % when using pandoc workflow instead, uncomment the following + % \input{chapter/out.tex} + % \newpage + %%%%%%%%%%%%% %% closing %% %%%%%%%%%%%%% From e08076120497a4c3579650ee59dbf623037d018d Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Mon, 18 May 2020 23:25:02 +0200 Subject: [PATCH 02/10] #38 test config --- .gitlab-ci.yml | 30 +++++++++++++++--------------- chapter/01_text.md | 2 ++ main.tex | 4 ++-- 3 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 chapter/01_text.md diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30d72cb..e4f6789 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,31 +2,31 @@ stages: - test - build -latexmk: - image: bnord01/docker-latex-pygments:latest - stage: build - artifacts: - paths: - - main*.pdf - expire_in: 2d - script: - - latexmk main.tex - - ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` - - mv main.pdf main@$ci_commit_sha_short.pdf - -#pandoc_latexmk: -# image: pandoc/latex +#latexmk: +# image: bnord01/docker-latex-pygments:latest # stage: build # artifacts: # paths: # - main*.pdf # expire_in: 2d # script: -# - pandoc --filter pandoc-crossref --filter pandoc-citeproc -M cref=true --top-level-division=chapter --bibliography library/library.bib --biblatex -o chapter/out.tex chapter/*.md # - latexmk main.tex # - ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` # - mv main.pdf main@$ci_commit_sha_short.pdf +pandoc_latexmk: + image: pandoc/latex + stage: build + artifacts: + paths: + - main*.pdf + expire_in: 2d + script: + - pandoc --filter pandoc-crossref --filter pandoc-citeproc -M cref=true --top-level-division=chapter --bibliography library/library.bib --biblatex -o chapter/out.tex chapter/*.md + - latexmk main.tex + - ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` + - mv main.pdf main@$ci_commit_sha_short.pdf + hunspell_chapters: image: tmaier/hunspell:latest stage: test diff --git a/chapter/01_text.md b/chapter/01_text.md new file mode 100644 index 0000000..574e473 --- /dev/null +++ b/chapter/01_text.md @@ -0,0 +1,2 @@ +# Sample File +This is a simple sample file for the pandoc workflow. \ No newline at end of file diff --git a/main.tex b/main.tex index bdb090c..626d430 100644 --- a/main.tex +++ b/main.tex @@ -64,8 +64,8 @@ % \newpage % when using pandoc workflow instead, uncomment the following - % \input{chapter/out.tex} - % \newpage + \input{chapter/out.tex} + \newpage %%%%%%%%%%%%% %% closing %% From a6035c5d23fd1a7c21effe87ed8f1b5bd5a258fc Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Mon, 18 May 2020 23:29:19 +0200 Subject: [PATCH 03/10] #38 switched docker image for pandoc-crossref --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4f6789..f85abcc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ stages: # - mv main.pdf main@$ci_commit_sha_short.pdf pandoc_latexmk: - image: pandoc/latex + image: leolabs/pandoc-latex stage: build artifacts: paths: From 6ef2f3e909844437649fe4292d2c563e75086c82 Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Mon, 18 May 2020 23:36:38 +0200 Subject: [PATCH 04/10] #38 change docker image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f85abcc..efec2bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ stages: # - mv main.pdf main@$ci_commit_sha_short.pdf pandoc_latexmk: - image: leolabs/pandoc-latex + image: thomasweise/docker-pandoc stage: build artifacts: paths: From 2391418a561b2ad513408b10543bcf1fb7ce4fb4 Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Tue, 19 May 2020 00:43:46 +0200 Subject: [PATCH 05/10] #38 changed docker image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index efec2bc..ff70167 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ stages: # - mv main.pdf main@$ci_commit_sha_short.pdf pandoc_latexmk: - image: thomasweise/docker-pandoc + image: fastexitlane/pandoc-latex stage: build artifacts: paths: From db64fc7beb8f3b9d24e77274749b298aa6f29b4a Mon Sep 17 00:00:00 2001 From: Dominik Date: Tue, 19 May 2020 19:35:09 +0200 Subject: [PATCH 06/10] #38 moved to own docker image --- .gitlab-ci.yml | 4 ++-- .vscode/tasks.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff70167..2449a5e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - build #latexmk: -# image: bnord01/docker-latex-pygments:latest +# image: fastexitlane/pandoc-latex:latest # stage: build # artifacts: # paths: @@ -15,7 +15,7 @@ stages: # - mv main.pdf main@$ci_commit_sha_short.pdf pandoc_latexmk: - image: fastexitlane/pandoc-latex + image: fastexitlane/pandoc-latex:latest stage: build artifacts: paths: diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ab79652..74a3776 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,7 +12,7 @@ "isDefault": true }, "dependsOrder": "sequence", - "dependsOn": ["clean"] + "dependsOn": ["clean", "pandoc"] }, { "label": "clean", From 2b7d977e70c63ed4e5120068263de27a843235e4 Mon Sep 17 00:00:00 2001 From: Dominik Date: Tue, 19 May 2020 21:43:15 +0200 Subject: [PATCH 07/10] #38 cleaned up mwe --- .gitlab-ci.yml | 28 ++++++++++++++-------------- chapter/01_text.md | 2 -- main.tex | 4 ++-- 3 files changed, 16 insertions(+), 18 deletions(-) delete mode 100644 chapter/01_text.md diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2449a5e..09616cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,19 +2,7 @@ stages: - test - build -#latexmk: -# image: fastexitlane/pandoc-latex:latest -# stage: build -# artifacts: -# paths: -# - main*.pdf -# expire_in: 2d -# script: -# - latexmk main.tex -# - ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` -# - mv main.pdf main@$ci_commit_sha_short.pdf - -pandoc_latexmk: +latexmk: image: fastexitlane/pandoc-latex:latest stage: build artifacts: @@ -22,11 +10,23 @@ pandoc_latexmk: - main*.pdf expire_in: 2d script: - - pandoc --filter pandoc-crossref --filter pandoc-citeproc -M cref=true --top-level-division=chapter --bibliography library/library.bib --biblatex -o chapter/out.tex chapter/*.md - latexmk main.tex - ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` - mv main.pdf main@$ci_commit_sha_short.pdf +# pandoc_latexmk: +# image: fastexitlane/pandoc-latex:latest +# stage: build +# artifacts: +# paths: +# - main*.pdf +# expire_in: 2d +# script: +# - pandoc --filter pandoc-crossref --filter pandoc-citeproc -M cref=true --top-level-division=chapter --bibliography library/library.bib --biblatex -o chapter/out.tex chapter/*.md +# - latexmk main.tex +# - ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` +# - mv main.pdf main@$ci_commit_sha_short.pdf + hunspell_chapters: image: tmaier/hunspell:latest stage: test diff --git a/chapter/01_text.md b/chapter/01_text.md deleted file mode 100644 index 574e473..0000000 --- a/chapter/01_text.md +++ /dev/null @@ -1,2 +0,0 @@ -# Sample File -This is a simple sample file for the pandoc workflow. \ No newline at end of file diff --git a/main.tex b/main.tex index 626d430..bdb090c 100644 --- a/main.tex +++ b/main.tex @@ -64,8 +64,8 @@ % \newpage % when using pandoc workflow instead, uncomment the following - \input{chapter/out.tex} - \newpage + % \input{chapter/out.tex} + % \newpage %%%%%%%%%%%%% %% closing %% From 8b9f45d92e256988552c512ccb51fd745fe8aeb4 Mon Sep 17 00:00:00 2001 From: Dominik Date: Tue, 19 May 2020 21:43:28 +0200 Subject: [PATCH 08/10] #38 added basic snippets for markdown --- .vscode/markdown.code-snippets | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .vscode/markdown.code-snippets diff --git a/.vscode/markdown.code-snippets b/.vscode/markdown.code-snippets new file mode 100644 index 0000000..2255b7d --- /dev/null +++ b/.vscode/markdown.code-snippets @@ -0,0 +1,25 @@ +{ + "online im Internet": { + "scope": "markdown", + "prefix": "oii", + "body": "online im Internet" + }, + + "autocite": { + "scope": "markdown", + "prefix": "ac", + "body": "[vgl. @${1:bibentry}, ${2:page}]" + }, + + "label": { + "scope": "markdown", + "prefix": "lbl", + "body": "{#${1:type}:${2:id}}" + }, + + "reference": { + "scope": "markdown", + "prefix": "ref", + "body": "[@$1]" + } +} \ No newline at end of file From d3d2927ebc651311a25e7350659838f45142af64 Mon Sep 17 00:00:00 2001 From: Dominik Date: Tue, 19 May 2020 21:43:52 +0200 Subject: [PATCH 09/10] #38 cleaned up MWE --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 74a3776..ab79652 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,7 +12,7 @@ "isDefault": true }, "dependsOrder": "sequence", - "dependsOn": ["clean", "pandoc"] + "dependsOn": ["clean"] }, { "label": "clean", From 00a7c4b399913b5e631fe4515aacf5ae66d2984a Mon Sep 17 00:00:00 2001 From: Dominik Date: Tue, 19 May 2020 21:55:06 +0200 Subject: [PATCH 10/10] #38 added conditional to cleanup statement --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ab79652..d6c252c 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -17,7 +17,7 @@ { "label": "clean", "type": "shell", - "command": "latexmk -C" + "command": "latexmk -C; if [ -f chapter/out.tex ]; then rm chapter/out.tex; fi" }, { "label": "pandoc",