diff options
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | pandoc-fix.patch | 338 |
3 files changed, 10 insertions, 353 deletions
@@ -1,7 +1,7 @@ pkgbase = zettlr pkgdesc = A markdown editor for writing academic texts and taking notes - pkgver = 1.8.4 - pkgrel = 4 + pkgver = 1.8.5 + pkgrel = 1 url = https://www.zettlr.com install = install arch = x86_64 @@ -14,13 +14,11 @@ pkgbase = zettlr optdepends = texlive-bin: For Latex support optdepends = ttf-lato: Display output in a more comfortable way options = !strip - source = zettlr-1.8.4.tar.gz::https://github.com/Zettlr/Zettlr/archive/v1.8.4.tar.gz - source = pandoc-fix.patch - source = locales-4-1.8.4.zip::https://github.com/citation-style-language/locales/archive/ecb8e70233e9a68e8b1dda4586061be8f8611a38.zip - source = chicago-author-date-1.8.4-4.csl::https://github.com/citation-style-language/styles/raw/a7899732910f5e69aae7799bf4e61505716c211b/chicago-author-date.csl - source = zh-TW-1.8.4-4.json::https://raw.githubusercontent.com/Brli/zettlr-zh-TW/60ef7ec4cb8ba0a6da924d89c60d6d39d1c8b729/zh-TW.json - sha256sums = da3ba36a98587e258bdb09700343b7a067ee4659aaef6b5021b16dd5b9d00400 - sha256sums = 488f3c308e0cbdcc626d95798e07fa3489ea28a631e9fbdacb50e6fcf35c5d4c + source = zettlr-1.8.5.tar.gz::https://github.com/Zettlr/Zettlr/archive/v1.8.5.tar.gz + source = locales-1-1.8.5.zip::https://github.com/citation-style-language/locales/archive/ecb8e70233e9a68e8b1dda4586061be8f8611a38.zip + source = chicago-author-date-1.8.5-1.csl::https://github.com/citation-style-language/styles/raw/a7899732910f5e69aae7799bf4e61505716c211b/chicago-author-date.csl + source = zh-TW-1.8.5-1.json::https://raw.githubusercontent.com/Brli/zettlr-zh-TW/60ef7ec4cb8ba0a6da924d89c60d6d39d1c8b729/zh-TW.json + sha256sums = 59a89ea4c86cf64920b540c0734566dbf737f08c6f48256fc8de124f65aebade sha256sums = 24503a6cd5b3651a7003353811ae82d3ed707ec8ff932d341668c2ad377434b6 sha256sums = 2b7cd6c1c9be4add8c660fb9c6ca54f1b6c3c4f49d6ed9fa39c9f9b10fcca6f4 sha256sums = 9aef5eec4876aa180fa55cf3bc213a5cf68ab96567bc4021ba58a32fa0fa9f94 @@ -1,8 +1,8 @@ # Maintainer: BrLi <brli at chakralinux dot org> pkgname=zettlr -pkgver=1.8.4 -pkgrel=4 +pkgver=1.8.5 +pkgrel=1 pkgdesc="A markdown editor for writing academic texts and taking notes" arch=('x86_64') url='https://www.zettlr.com' @@ -18,14 +18,12 @@ _zh_tw_commit=60ef7ec4cb8ba0a6da924d89c60d6d39d1c8b729 # matches 1.8.4 options=(!strip) install=install source=("$pkgname-$pkgver.tar.gz::https://github.com/Zettlr/Zettlr/archive/v$pkgver.tar.gz" - 'pandoc-fix.patch' # citation style "locales-$pkgrel-$pkgver.zip::https://github.com/citation-style-language/locales/archive/$_csl_locale_commit.zip" "chicago-author-date-$pkgver-$pkgrel.csl::https://github.com/citation-style-language/styles/raw/$_csl_style_commit/chicago-author-date.csl" # Chinese(Taiwan) translation "zh-TW-$pkgver-$pkgrel.json::https://raw.githubusercontent.com/Brli/zettlr-zh-TW/$_zh_tw_commit/zh-TW.json") -sha256sums=('da3ba36a98587e258bdb09700343b7a067ee4659aaef6b5021b16dd5b9d00400' - '488f3c308e0cbdcc626d95798e07fa3489ea28a631e9fbdacb50e6fcf35c5d4c' +sha256sums=('59a89ea4c86cf64920b540c0734566dbf737f08c6f48256fc8de124f65aebade' '24503a6cd5b3651a7003353811ae82d3ed707ec8ff932d341668c2ad377434b6' '2b7cd6c1c9be4add8c660fb9c6ca54f1b6c3c4f49d6ed9fa39c9f9b10fcca6f4' '9aef5eec4876aa180fa55cf3bc213a5cf68ab96567bc4021ba58a32fa0fa9f94') @@ -43,7 +41,6 @@ prepare() { cp "$srcdir/chicago-author-date-$pkgver-$pkgrel.csl" source/app/service-providers/assets/csl-styles/chicago-author-date.csl # fake Pandoc - patch -Np1 -i "$srcdir/pandoc-fix.patch" ln -sf /dev/null resources/pandoc } diff --git a/pandoc-fix.patch b/pandoc-fix.patch deleted file mode 100644 index 4f44ef94e673..000000000000 --- a/pandoc-fix.patch +++ /dev/null @@ -1,338 +0,0 @@ -From d7a70345f468911ab024b06f030def5427588a4f Mon Sep 17 00:00:00 2001 -From: BrLi <brli@chakralinux.org> -Date: Fri, 25 Dec 2020 12:29:56 +0800 -Subject: [PATCH 1/7] paramatrized bibliography, fold cslstyle if-else - statement into property - ---- - CHANGELOG.md | 6 ++++++ - source/app/service-providers/config-provider.js | 2 +- - source/main/modules/export/run-pandoc.js | 11 ++++------- - source/renderer/dialog/preferences.js | 2 +- - 4 files changed, 12 insertions(+), 9 deletions(-) - -diff --git a/CHANGELOG.md b/CHANGELOG.md -index 8d637001..6ba35b40 100644 ---- a/CHANGELOG.md -+++ b/CHANGELOG.md -@@ -1,3 +1,9 @@ -+# 1.8.5 -+ -+## Pandoc Command update -+ -+**In order to use the new command, make sure to "reset" it once, or (if it contains customisations) replace `--bibliography "$bibliography$" $cslstyle$` with `$bibliography$ $cslstyle$`.** -+ - # 1.8.4 - - ## Deprecating 32 bit builds -diff --git a/source/app/service-providers/config-provider.js b/source/app/service-providers/config-provider.js -index ad5799fd..42ea83d3 100644 ---- a/source/app/service-providers/config-provider.js -+++ b/source/app/service-providers/config-provider.js -@@ -118,7 +118,7 @@ module.exports = class ConfigProvider extends EventEmitter { - 'pandoc': '', - 'xelatex': '', - // The pandoc command to be run on export -- 'pandocCommand': 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ --citeproc --bibliography "$bibliography$" $cslstyle$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"', -+ 'pandocCommand': 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ --citeproc $bibliography$ $cslstyle$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"', - 'export': { - 'dir': 'temp', // Can either be "temp" or "cwd" (current working directory) - 'stripIDs': false, // Strip ZKN IDs such as @ID:<id> -diff --git a/source/main/modules/export/run-pandoc.js b/source/main/modules/export/run-pandoc.js -index 3874aa07..28dbadee 100644 ---- a/source/main/modules/export/run-pandoc.js -+++ b/source/main/modules/export/run-pandoc.js -@@ -47,11 +47,8 @@ module.exports = async function (options) { - throw new Error(trans('system.error.no_xelatex_message'), trans('system.error.no_xelatex_title')) - } - -- // Add a custom CSL style if applicable -- let cslstyle = '' -- if (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) { -- cslstyle = `--csl "${options.cslStyle}"` -- } -+ // Add bibliography if exists -+ let bibliography = global.config.get('export.cslLibrary') - - // Pandoc flags to be passed to the compiler - let pandocFlags = { -@@ -59,8 +56,8 @@ module.exports = async function (options) { - 'infile': options.sourceFile, - 'toc': (options.pdf.toc && options.format === 'pdf') ? '--toc' : '', - 'tocdepth': (options.pdf.tocDepth) ? '--toc-depth=' + options.pdf.tocDepth : '', -- 'bibliography': global.config.get('export.cslLibrary'), -- 'cslstyle': cslstyle, -+ 'bibliography': (global.config.get('export.cslLibrary')) ? `--bibliography "${bibliography}"` : '', -+ 'cslstyle': (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) ? `--csl + "${options.cslStyle}"` : '', - 'outfile': options.targetFile, - 'outflag': '-t ' + ((options.format === 'pdf') ? 'latex' : options.format), - 'format': options.format, -diff --git a/source/renderer/dialog/preferences.js b/source/renderer/dialog/preferences.js -index 15630b68..cce2a90c 100644 ---- a/source/renderer/dialog/preferences.js -+++ b/source/renderer/dialog/preferences.js -@@ -190,7 +190,7 @@ class PreferencesDialog extends ZettlrDialog { - - // Reset the pandoc command - $('#reset-pandoc-command').on('click', (e) => { -- document.getElementById('pandocCommand').value = 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ --citeproc --bibliography "$bibliography$" $cslstyle$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"' -+ document.getElementById('pandocCommand').value = 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ --citeproc $bibliography$ $cslstyle$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"' - }) - - const reportTestResult = (resultTranslationKey) => { - -From 7ed897e2d3f95f43a22defab71b9b380ea759ce0 Mon Sep 17 00:00:00 2001 -From: BrLi <brli@chakralinux.org> -Date: Fri, 25 Dec 2020 13:48:25 +0800 -Subject: [PATCH 2/7] remove typo + in command - ---- - source/main/modules/export/run-pandoc.js | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source/main/modules/export/run-pandoc.js b/source/main/modules/export/run-pandoc.js -index 28dbadee..a2b2f10e 100644 ---- a/source/main/modules/export/run-pandoc.js -+++ b/source/main/modules/export/run-pandoc.js -@@ -57,7 +57,7 @@ module.exports = async function (options) { - 'toc': (options.pdf.toc && options.format === 'pdf') ? '--toc' : '', - 'tocdepth': (options.pdf.tocDepth) ? '--toc-depth=' + options.pdf.tocDepth : '', - 'bibliography': (global.config.get('export.cslLibrary')) ? `--bibliography "${bibliography}"` : '', -- 'cslstyle': (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) ? `--csl + "${options.cslStyle}"` : '', -+ 'cslstyle': (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) ? `--citeproc --csl "${options.cslStyle}"` : '', - 'outfile': options.targetFile, - 'outflag': '-t ' + ((options.format === 'pdf') ? 'latex' : options.format), - 'format': options.format, - -From 238056421cf0d28926fa4901e1857e860fa35dd2 Mon Sep 17 00:00:00 2001 -From: BrLi <brli@chakralinux.org> -Date: Fri, 25 Dec 2020 14:03:21 +0800 -Subject: [PATCH 3/7] move --citeproc into cslstyle variable - ---- - source/app/service-providers/config-provider.js | 2 +- - source/renderer/dialog/preferences.js | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/source/app/service-providers/config-provider.js b/source/app/service-providers/config-provider.js -index 42ea83d3..049c9188 100644 ---- a/source/app/service-providers/config-provider.js -+++ b/source/app/service-providers/config-provider.js -@@ -118,7 +118,7 @@ module.exports = class ConfigProvider extends EventEmitter { - 'pandoc': '', - 'xelatex': '', - // The pandoc command to be run on export -- 'pandocCommand': 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ --citeproc $bibliography$ $cslstyle$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"', -+ 'pandocCommand': 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $cslstyle$ $bibliography$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"', - 'export': { - 'dir': 'temp', // Can either be "temp" or "cwd" (current working directory) - 'stripIDs': false, // Strip ZKN IDs such as @ID:<id> -diff --git a/source/renderer/dialog/preferences.js b/source/renderer/dialog/preferences.js -index cce2a90c..a2ba8ba3 100644 ---- a/source/renderer/dialog/preferences.js -+++ b/source/renderer/dialog/preferences.js -@@ -190,7 +190,7 @@ class PreferencesDialog extends ZettlrDialog { - - // Reset the pandoc command - $('#reset-pandoc-command').on('click', (e) => { -- document.getElementById('pandocCommand').value = 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ --citeproc $bibliography$ $cslstyle$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"' -+ document.getElementById('pandocCommand').value = 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $cslstyle$ $bibliography$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"' - }) - - const reportTestResult = (resultTranslationKey) => { - -From 40ba77f1539de8421438c1d61d4c1069866b405d Mon Sep 17 00:00:00 2001 -From: BrLi <brli@chakralinux.org> -Date: Fri, 25 Dec 2020 14:09:29 +0800 -Subject: [PATCH 4/7] isolate --citeproc parameter - ---- - source/app/service-providers/config-provider.js | 2 +- - source/main/modules/export/run-pandoc.js | 3 ++- - source/renderer/dialog/preferences.js | 2 +- - 3 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/source/app/service-providers/config-provider.js b/source/app/service-providers/config-provider.js -index 049c9188..bbb4d40d 100644 ---- a/source/app/service-providers/config-provider.js -+++ b/source/app/service-providers/config-provider.js -@@ -118,7 +118,7 @@ module.exports = class ConfigProvider extends EventEmitter { - 'pandoc': '', - 'xelatex': '', - // The pandoc command to be run on export -- 'pandocCommand': 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $cslstyle$ $bibliography$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"', -+ 'pandocCommand': 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $citeproc$ $cslstyle$ $bibliography$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"', - 'export': { - 'dir': 'temp', // Can either be "temp" or "cwd" (current working directory) - 'stripIDs': false, // Strip ZKN IDs such as @ID:<id> -diff --git a/source/main/modules/export/run-pandoc.js b/source/main/modules/export/run-pandoc.js -index a2b2f10e..2ae386ef 100644 ---- a/source/main/modules/export/run-pandoc.js -+++ b/source/main/modules/export/run-pandoc.js -@@ -56,8 +56,9 @@ module.exports = async function (options) { - 'infile': options.sourceFile, - 'toc': (options.pdf.toc && options.format === 'pdf') ? '--toc' : '', - 'tocdepth': (options.pdf.tocDepth) ? '--toc-depth=' + options.pdf.tocDepth : '', -+ 'citeproc': (bibliography && isFile(options.cslStyle)) ? '--citeproc' : '', - 'bibliography': (global.config.get('export.cslLibrary')) ? `--bibliography "${bibliography}"` : '', -- 'cslstyle': (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) ? `--citeproc --csl "${options.cslStyle}"` : '', -+ 'cslstyle': (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) ? `--csl "${options.cslStyle}"` : '', - 'outfile': options.targetFile, - 'outflag': '-t ' + ((options.format === 'pdf') ? 'latex' : options.format), - 'format': options.format, -diff --git a/source/renderer/dialog/preferences.js b/source/renderer/dialog/preferences.js -index a2ba8ba3..cc5b6448 100644 ---- a/source/renderer/dialog/preferences.js -+++ b/source/renderer/dialog/preferences.js -@@ -190,7 +190,7 @@ class PreferencesDialog extends ZettlrDialog { - - // Reset the pandoc command - $('#reset-pandoc-command').on('click', (e) => { -- document.getElementById('pandocCommand').value = 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $cslstyle$ $bibliography$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"' -+ document.getElementById('pandocCommand').value = 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $citeproc$ $cslstyle$ $bibliography$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"' - }) - - const reportTestResult = (resultTranslationKey) => { - -From f448a058b74cfff679f00a4dfcd70ae426959845 Mon Sep 17 00:00:00 2001 -From: BrLi <brli@chakralinux.org> -Date: Fri, 25 Dec 2020 16:46:24 +0800 -Subject: [PATCH 5/7] move --citeproc to $bibliography$ - ---- - source/app/service-providers/config-provider.js | 2 +- - source/main/modules/export/run-pandoc.js | 3 +-- - source/renderer/dialog/preferences.js | 2 +- - 3 files changed, 3 insertions(+), 4 deletions(-) - -diff --git a/source/app/service-providers/config-provider.js b/source/app/service-providers/config-provider.js -index bbb4d40d..672c9cfb 100644 ---- a/source/app/service-providers/config-provider.js -+++ b/source/app/service-providers/config-provider.js -@@ -118,7 +118,7 @@ module.exports = class ConfigProvider extends EventEmitter { - 'pandoc': '', - 'xelatex': '', - // The pandoc command to be run on export -- 'pandocCommand': 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $citeproc$ $cslstyle$ $bibliography$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"', -+ 'pandocCommand': 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $bibliography$ $cslstyle$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"', - 'export': { - 'dir': 'temp', // Can either be "temp" or "cwd" (current working directory) - 'stripIDs': false, // Strip ZKN IDs such as @ID:<id> -diff --git a/source/main/modules/export/run-pandoc.js b/source/main/modules/export/run-pandoc.js -index 2ae386ef..af3b9817 100644 ---- a/source/main/modules/export/run-pandoc.js -+++ b/source/main/modules/export/run-pandoc.js -@@ -56,8 +56,7 @@ module.exports = async function (options) { - 'infile': options.sourceFile, - 'toc': (options.pdf.toc && options.format === 'pdf') ? '--toc' : '', - 'tocdepth': (options.pdf.tocDepth) ? '--toc-depth=' + options.pdf.tocDepth : '', -- 'citeproc': (bibliography && isFile(options.cslStyle)) ? '--citeproc' : '', -- 'bibliography': (global.config.get('export.cslLibrary')) ? `--bibliography "${bibliography}"` : '', -+ 'bibliography': (global.config.get('export.cslLibrary')) ? `--citeproc --bibliography "${bibliography}"` : '', - 'cslstyle': (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) ? `--csl "${options.cslStyle}"` : '', - 'outfile': options.targetFile, - 'outflag': '-t ' + ((options.format === 'pdf') ? 'latex' : options.format), -diff --git a/source/renderer/dialog/preferences.js b/source/renderer/dialog/preferences.js -index cc5b6448..65a9957f 100644 ---- a/source/renderer/dialog/preferences.js -+++ b/source/renderer/dialog/preferences.js -@@ -190,7 +190,7 @@ class PreferencesDialog extends ZettlrDialog { - - // Reset the pandoc command - $('#reset-pandoc-command').on('click', (e) => { -- document.getElementById('pandocCommand').value = 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $citeproc$ $cslstyle$ $bibliography$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"' -+ document.getElementById('pandocCommand').value = 'pandoc "$infile$" -f markdown $outflag$ $tpl$ $toc$ $tocdepth$ $bibliography$ $cslstyle$ $standalone$ --pdf-engine=xelatex --mathjax -o "$outfile$"' - }) - - const reportTestResult = (resultTranslationKey) => { - -From fc9e4ee487f67d131596c92b506ee062788631f4 Mon Sep 17 00:00:00 2001 -From: BrLi <brli@chakralinux.org> -Date: Fri, 25 Dec 2020 17:47:42 +0800 -Subject: [PATCH 6/7] remove explicit declare of bibliography, use global - variable instead - ---- - CHANGELOG.md | 2 +- - source/main/modules/export/run-pandoc.js | 5 +---- - 2 files changed, 2 insertions(+), 5 deletions(-) - -diff --git a/CHANGELOG.md b/CHANGELOG.md -index 6ba35b40..86bf1fc2 100644 ---- a/CHANGELOG.md -+++ b/CHANGELOG.md -@@ -2,7 +2,7 @@ - - ## Pandoc Command update - --**In order to use the new command, make sure to "reset" it once, or (if it contains customisations) replace `--bibliography "$bibliography$" $cslstyle$` with `$bibliography$ $cslstyle$`.** -+**In order to use the new command, make sure to "reset" it once, or (if it contains customisations) replace `--citeproc --bibliography "$bibliography$" $cslstyle$` with `$bibliography$ $cslstyle$`.** - - # 1.8.4 - -diff --git a/source/main/modules/export/run-pandoc.js b/source/main/modules/export/run-pandoc.js -index af3b9817..f5f9e692 100644 ---- a/source/main/modules/export/run-pandoc.js -+++ b/source/main/modules/export/run-pandoc.js -@@ -47,16 +47,13 @@ module.exports = async function (options) { - throw new Error(trans('system.error.no_xelatex_message'), trans('system.error.no_xelatex_title')) - } - -- // Add bibliography if exists -- let bibliography = global.config.get('export.cslLibrary') -- - // Pandoc flags to be passed to the compiler - let pandocFlags = { - 'tpl': (options.template) ? `--template="${options.template}"` : '', - 'infile': options.sourceFile, - 'toc': (options.pdf.toc && options.format === 'pdf') ? '--toc' : '', - 'tocdepth': (options.pdf.tocDepth) ? '--toc-depth=' + options.pdf.tocDepth : '', -- 'bibliography': (global.config.get('export.cslLibrary')) ? `--citeproc --bibliography "${bibliography}"` : '', -+ 'bibliography': (global.config.get('export.cslLibrary')) ? `--citeproc --bibliography "${global.config.get('export.cslLibrary')}"` : '', - 'cslstyle': (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) ? `--csl "${options.cslStyle}"` : '', - 'outfile': options.targetFile, - 'outflag': '-t ' + ((options.format === 'pdf') ? 'latex' : options.format), - -From 994ec0b4ce01381b50cac05e8108374ff21aeff3 Mon Sep 17 00:00:00 2001 -From: BrLi <brli@chakralinux.org> -Date: Sat, 26 Dec 2020 06:56:27 +0800 -Subject: [PATCH 7/7] separate cslstyle and bibliography as per maintainer - instruction - ---- - source/main/modules/export/run-pandoc.js | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/source/main/modules/export/run-pandoc.js b/source/main/modules/export/run-pandoc.js -index f5f9e692..2402da71 100644 ---- a/source/main/modules/export/run-pandoc.js -+++ b/source/main/modules/export/run-pandoc.js -@@ -47,14 +47,26 @@ module.exports = async function (options) { - throw new Error(trans('system.error.no_xelatex_message'), trans('system.error.no_xelatex_title')) - } - -+ // Include CSL library if exist -+ let bibliography = '' -+ if (global.config.get('export.cslLibrary')) { -+ bibliography = `--citeproc --bibliography "${global.config.get('export.cslLibrary')}"` -+ } -+ -+ // Add a custom CSL style if applicable -+ let cslstyle = '' -+ if (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) { -+ cslstyle = `--csl "${options.cslStyle}"` -+ } -+ - // Pandoc flags to be passed to the compiler - let pandocFlags = { - 'tpl': (options.template) ? `--template="${options.template}"` : '', - 'infile': options.sourceFile, - 'toc': (options.pdf.toc && options.format === 'pdf') ? '--toc' : '', - 'tocdepth': (options.pdf.tocDepth) ? '--toc-depth=' + options.pdf.tocDepth : '', -- 'bibliography': (global.config.get('export.cslLibrary')) ? `--citeproc --bibliography "${global.config.get('export.cslLibrary')}"` : '', -- 'cslstyle': (options.hasOwnProperty('cslStyle') && isFile(options.cslStyle)) ? `--csl "${options.cslStyle}"` : '', -+ 'bibliography': bibliography, -+ 'cslstyle': cslstyle, - 'outfile': options.targetFile, - 'outflag': '-t ' + ((options.format === 'pdf') ? 'latex' : options.format), - 'format': options.format, |