├── docs ├── robots.txt ├── images │ └── greek-ship.png ├── site_libs │ ├── bootstrap │ │ └── bootstrap-icons.woff │ ├── quarto-contrib │ │ └── fontawesome6-0.1.0 │ │ │ ├── 1e21o67 │ │ │ ├── fa-solid-900.ttf │ │ │ ├── fa-brands-400.ttf │ │ │ ├── fa-brands-400.woff2 │ │ │ ├── fa-regular-400.ttf │ │ │ ├── fa-solid-900.woff2 │ │ │ ├── fa-regular-400.woff2 │ │ │ ├── fa-v4compatibility.ttf │ │ │ └── fa-v4compatibility.woff2 │ │ │ └── latex-fontsize.css │ ├── quarto-html │ │ ├── tippy.css │ │ ├── quarto-syntax-highlighting-dark.css │ │ ├── quarto-syntax-highlighting.css │ │ ├── anchor.min.js │ │ ├── popper.min.js │ │ └── tippy.umd.min.js │ ├── clipboard │ │ └── clipboard.min.js │ ├── quarto-nav │ │ └── quarto-nav.js │ └── quarto-search │ │ └── fuse.min.js ├── sitemap.xml └── changelog.html ├── images └── greek-ship.png ├── img ├── 2023-03-18-22-02-26.png ├── 2023-03-18-22-24-10.png ├── 2023-03-18-22-32-06.png ├── 2023-03-19-23-41-52.png └── windows_logo.svg ├── _extensions └── citetools │ ├── citeproc.lua │ ├── _extension.yaml │ ├── citetools.yaml │ ├── citation-backlinks.lua │ ├── multiple-bibliographies.lua │ ├── section-bibliographies.lua │ ├── multibib.lua │ └── citefield.lua ├── changelog.md ├── .gitignore ├── Makefile ├── .editorconfig ├── .github └── workflows │ ├── quarto-publish.yml │ └── ci.yaml ├── refs ├── references.bib ├── secondary.json └── primary.json ├── docs_qmd ├── _multibib-in-scrivener.qmd ├── 05-about.qmd ├── 04-citation-backlinks.qmd ├── 02-multibib.qmd ├── _all-bibtex-fields-to-csl-yaml.qmd ├── 01-basics.qmd └── 03-cite-field.qmd ├── LICENSE ├── input.qmd ├── include-files.lua ├── _quarto.yml ├── README.md └── index.qmd /docs/robots.txt: -------------------------------------------------------------------------------- 1 | Sitemap: https://bcdavasconcelos.github.io/citetools/sitemap.xml 2 | -------------------------------------------------------------------------------- /images/greek-ship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/images/greek-ship.png -------------------------------------------------------------------------------- /docs/images/greek-ship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/images/greek-ship.png -------------------------------------------------------------------------------- /img/2023-03-18-22-02-26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/img/2023-03-18-22-02-26.png -------------------------------------------------------------------------------- /img/2023-03-18-22-24-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/img/2023-03-18-22-24-10.png -------------------------------------------------------------------------------- /img/2023-03-18-22-32-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/img/2023-03-18-22-32-06.png -------------------------------------------------------------------------------- /img/2023-03-19-23-41-52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/img/2023-03-19-23-41-52.png -------------------------------------------------------------------------------- /docs/site_libs/bootstrap/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/bootstrap/bootstrap-icons.woff -------------------------------------------------------------------------------- /_extensions/citetools/citeproc.lua: -------------------------------------------------------------------------------- 1 | -- Lua filter that behaves like `--citeproc` 2 | function Pandoc (doc) 3 | return pandoc.utils.citeproc(doc) 4 | end 5 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-solid-900.ttf -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-brands-400.ttf -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-brands-400.woff2 -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-regular-400.ttf -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-solid-900.woff2 -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-regular-400.woff2 -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-v4compatibility.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-v4compatibility.ttf -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-v4compatibility.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcdavasconcelos/citetools/HEAD/docs/site_libs/quarto-contrib/fontawesome6-0.1.0/1e21o67/fa-v4compatibility.woff2 -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | citetools 2 | ======== 3 | 4 | v1.0.1 5 | ------ 6 | 7 | Released 2023-04-02. 8 | - Added `title-field-emphasis` option (default: `true`). 9 | 10 | v1.0.0 11 | ------ 12 | 13 | Released 2023-03-18. 14 | 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.luarc.json 2 | .gitignore 3 | .DS_Store 4 | *~ 5 | .ruby-version 6 | Core.bib 7 | .Rproj.user 8 | /.quarto/ 9 | _extensions/include-code-files 10 | _extensions/quarto-ext 11 | .quarto/ 12 | .quarto/idx/ 13 | .idea 14 | .quarto 15 | .vscode 16 | -------------------------------------------------------------------------------- /_extensions/citetools/_extension.yaml: -------------------------------------------------------------------------------- 1 | name: citetools 2 | author: Albert Krewinkel & Bernardo CDA Vasconcelos 3 | version: 1.0.4 4 | contributes: 5 | filters: 6 | - citeproc.lua 7 | - multiple-bibliographies.lua 8 | # - section-bibliographies.lua 9 | - citefield.lua 10 | - citation-backlinks.lua 11 | format: 12 | common: 13 | verbosity: ERROR 14 | citeproc: false 15 | link-citations: true 16 | validate-yaml: false 17 | -------------------------------------------------------------------------------- /img/windows_logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_extensions/citetools/citetools.yaml: -------------------------------------------------------------------------------- 1 | verbosity: ERROR 2 | citeproc: false 3 | filters: 4 | - citeproc 5 | - ${.}/_extensions/bcdavasconcelos/citetools/multiple-bibliographies.lua 6 | - ${.}/_extensions/bcdavasconcelos/citetools/citefield.lua 7 | - ${.}/_extensions/bcdavasconcelos/citetools/citation-backlinks.lua 8 | # - ${.}/_extensions/bcdavasconcelos/citetools/section-bibliographies.lua 9 | metadata: 10 | link-citations: true 11 | link-fields: true 12 | # link-bibliography: true 13 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-contrib/fontawesome6-0.1.0/latex-fontsize.css: -------------------------------------------------------------------------------- 1 | .fa-tiny { 2 | font-size: 0.5em; 3 | } 4 | .fa-scriptsize { 5 | font-size: 0.7em; 6 | } 7 | .fa-footnotesize { 8 | font-size: 0.8em; 9 | } 10 | .fa-small { 11 | font-size: 0.9em; 12 | } 13 | .fa-normalsize { 14 | font-size: 1em; 15 | } 16 | .fa-large { 17 | font-size: 1.2em; 18 | } 19 | .fa-Large { 20 | font-size: 1.5em; 21 | } 22 | .fa-LARGE { 23 | font-size: 1.75em; 24 | } 25 | .fa-huge { 26 | font-size: 2em; 27 | } 28 | .fa-Huge { 29 | font-size: 2.5em; 30 | } 31 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Name of the filter file, *with* `.lua` file extension. 2 | FILTER_FILE := $(wildcard *.lua) 3 | 4 | # Allow to use a different pandoc binary, e.g. when testing. 5 | PANDOC ?= pandoc 6 | # Allow to adjust the diff command if necessary 7 | DIFF = diff 8 | 9 | # Use special expected output file if it exists. 10 | expected_output = test/expected.$(PANDOC_VERSION).txt 11 | ifeq ($(wildcard $(expected_output)),) 12 | expected_output = test/expected.txt 13 | endif 14 | 15 | test: test/input.md $(FILTER_FILE) 16 | @$(PANDOC) -d test/test.yaml \ 17 | | $(DIFF) $(expected_output) - 18 | 19 | .PHONY: test 20 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = false 11 | insert_final_newline = true 12 | 13 | [Makefile] 14 | indent_style = tab 15 | 16 | [*.lua] 17 | indent_style = space 18 | indent_size = 2 19 | # Code should stay below 80 characters per line. 20 | # max_line_length = 80 21 | 22 | [*.md] 23 | # Text with 60 to 66 characters per line is said to be the easiest 24 | # to read. 25 | # max_line_length = 66 26 | -------------------------------------------------------------------------------- /.github/workflows/quarto-publish.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: main 4 | 5 | name: Render and Publish 6 | 7 | jobs: 8 | build-deploy: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Check out repository 12 | uses: actions/checkout@v2 13 | 14 | - name: Set up Quarto 15 | uses: quarto-dev/quarto-actions/setup@v2 16 | with: 17 | # To install LaTeX to build PDF book 18 | tinytex: true 19 | # uncomment below and fill to pin a version 20 | # version: 0.9.600 21 | 22 | # add software dependencies here 23 | 24 | - name: Publish to GitHub Pages (and render) 25 | uses: quarto-dev/quarto-actions/publish@v2 26 | with: 27 | target: gh-pages 28 | env: 29 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this secret is always available for github actions 30 | -------------------------------------------------------------------------------- /refs/references.bib: -------------------------------------------------------------------------------- 1 | @book{Doe2000, 2 | title = "A long journey", 3 | author = "Jane E. Doe", 4 | year = 2000, 5 | note = "Reprint of~\citet{Doe1990}", 6 | } 7 | 8 | @book{Doe1990, 9 | title = "A long journey", 10 | author = "Jane E. Doe", 11 | year = 1990, 12 | note = "Reprint of~\citet{Doe1980}", 13 | } 14 | 15 | @book{Doe1980, 16 | title = "A long journey", 17 | author = "Jane E. Doe", 18 | year = 1980, 19 | } 20 | 21 | @article{Smith2001, 22 | title = "Thoughts", 23 | author = "Al Smith", 24 | year = 2001, 25 | journal = "Varia", 26 | volume = 1, 27 | pages = "1--15", 28 | } 29 | 30 | @article{Smith2003, 31 | title = "More Thoughts", 32 | author = "Al Smith", 33 | year = 2003, 34 | journal = "Varia", 35 | volume = 12, 36 | pages = "35--55", 37 | } 38 | 39 | @article{Smith2005, 40 | title = "Afterthoughts", 41 | author = "Al Smith", 42 | year = 2005, 43 | journal = "Varia", 44 | volume = 15, 45 | pages = "25--33", 46 | } -------------------------------------------------------------------------------- /docs_qmd/_multibib-in-scrivener.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Multiple Bibliographies in Scrivener 3 | --- 4 | 5 | In Scrivener, you can add multiple bibliographies to your project using the strategy below. Once this is done, the only task to add new bibliography files to your project will be to paste the path to one of the files in the metadata of your document. This is a very simple task, and it can be done in a few seconds. 6 | 7 | ![](/2023-03-19-23-41-52.png) 8 | 9 | 10 | 1. First of all, create a new meta data field called `path`. 11 | 2. Create a Section Type called `Multibib`. 12 | 3. Create a new Section in your project, and set its Section Type to `Multibib`. 13 | 4. Paste the path to the bibliography file in the `path` metadata field. 14 | 5. In the Compile formats Section Layout, add the following code to the `Title Sufix` of the `Multibib` Section: 15 | 16 | ```markdown 17 | {.appendix} 18 | 19 | --- 20 | bibliography_multibib<$linkID>: "<$custom:Path>" 21 | --- 22 | 23 | ::: {#refs_multibib<$linkID>} 24 | ::: 25 | 26 | ``` 27 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | # Run on all pull requests that change code. 5 | pull_request: 6 | paths-ignore: 7 | - 'README.md' 8 | - LICENSE 9 | - .editorconfig 10 | # Run every time a code change is pushed. 11 | push: 12 | paths-ignore: 13 | - 'README.md' 14 | - LICENSE 15 | - .editorconfig 16 | # Test each week if things still work. This way we will catch 17 | # incompatible pandoc changes in a timely manner. 18 | schedule: 19 | # At 3:27am each Tuesday 20 | - cron: '27 3 * * 2' 21 | 22 | jobs: 23 | test: 24 | runs-on: ubuntu-latest 25 | strategy: 26 | fail-fast: true 27 | matrix: 28 | pandoc: 29 | - edge 30 | - latest 31 | - 2.11 32 | 33 | container: 34 | image: pandoc/core:${{ matrix.pandoc }} 35 | 36 | steps: 37 | - name: Checkout 38 | uses: actions/checkout@v3 39 | 40 | - name: Install dependencies 41 | run: apk add make 42 | 43 | - name: Test 44 | run: make test PANDOC_VERSION=${{ matrix.pandoc }} 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Bernardo C.D.A. Vasconcelos 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs_qmd/05-about.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: About 3 | --- 4 | 5 | Logo image generated [Dall-E](https://labs.openai.com/e/wtQnvyvhZqwROpParcviKBWk) using `Enso-like round black and white painting with ancient greek war-ship with man tied to the mast` as prompt. 6 | 7 | License 8 | ------------------------------------------------------------------ 9 | Filters published under the MIT license by Albert Krewinkel ([tarleb](https://github.com/tarleb)). 10 | 11 | - [multibib](https://github.com/pandoc-ext/multibib) 12 | - [multiple-bibliographies](https://github.com/pandoc/lua-filters/tree/master/multiple-bibliographies) 13 | - [citation-backlinks](https://github.com/bcdavasconcelos/citation-backlinks) 14 | - [section-bibliographies](https://github.com/pandoc-ext/section-bibliographies) 15 | 16 | Filters published under the MIT license by Albert Krewinkel ([tarleb](https://github.com/tarleb)) & Bernardo Vasconcelos ([bcdavasconcelos](https://github.com/bcdavasconcelos)). 17 | 18 | - [citefield](https://github.com/bcdavasconcelos/citefield) 19 | 20 | All Pandoc Lua filters in this extension are published under the MIT license, see file `LICENSE` for details. 21 | 22 | The Cite Tools Documentation is under a Creative Commons Attribution-NonCommercial 4.0 International License.
23 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/tippy.css: -------------------------------------------------------------------------------- 1 | .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} -------------------------------------------------------------------------------- /docs/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https://bcdavasconcelos.github.io/citetools/docs_qmd/02-multibib.html 5 | 2023-04-05T20:44:57.214Z 6 | 7 | 8 | https://bcdavasconcelos.github.io/citetools/docs_qmd/01-basics.html 9 | 2023-04-14T01:37:05.637Z 10 | 11 | 12 | https://bcdavasconcelos.github.io/citetools/docs_qmd/05-about.html 13 | 2023-04-05T20:44:58.359Z 14 | 15 | 16 | https://bcdavasconcelos.github.io/citetools/docs_qmd/03-cite-field.html 17 | 2023-04-05T20:45:00.025Z 18 | 19 | 20 | https://bcdavasconcelos.github.io/citetools/docs_qmd/04-citation-backlinks.html 21 | 2023-04-05T20:45:01.204Z 22 | 23 | 24 | https://bcdavasconcelos.github.io/citetools/changelog.html 25 | 2023-04-05T20:45:01.622Z 26 | 27 | 28 | https://bcdavasconcelos.github.io/citetools/index.html 29 | 2023-04-10T17:45:23.930Z 30 | 31 | 32 | https://bcdavasconcelos.github.io/citetools/input.html 33 | 2023-04-05T20:45:02.899Z 34 | 35 | 36 | -------------------------------------------------------------------------------- /refs/secondary.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "author": [ 3 | { 4 | "family": "Aristotelis" 5 | } 6 | ], 7 | "id": "DATheiler", 8 | "issued": { 9 | "date-parts": [ 10 | [ 11 | 1995 12 | ] 13 | ] 14 | }, 15 | "publisher": "Felix Meiner", 16 | "publisher-place": "Hamburg", 17 | "title": "De anima", 18 | "translator": [ 19 | { 20 | "family": "Seidl", 21 | "given": "H." 22 | }, 23 | { 24 | "family": "Theiler", 25 | "given": "W." 26 | } 27 | ], 28 | "type": "book" 29 | }, 30 | { 31 | "author": [ 32 | { 33 | "family": "Aristotele" 34 | } 35 | ], 36 | "id": "ENNatali", 37 | "issued": { 38 | "date-parts": [ 39 | [ 40 | 1999 41 | ] 42 | ] 43 | }, 44 | "publisher": "Laterza", 45 | "publisher-place": "Roma", 46 | "title": "Etica nicomachea", 47 | "translator": [ 48 | { 49 | "family": "Natali", 50 | "given": "Carlo" 51 | } 52 | ], 53 | "type": "book" 54 | }, 55 | { 56 | "author": [ 57 | { 58 | "family": "Aristoteles" 59 | } 60 | ], 61 | "id": "DACorcilius", 62 | "issued": { 63 | "date-parts": [ 64 | [2017] 65 | ] 66 | }, 67 | "number-of-pages": "358", 68 | "publisher": "Felix Meiner", 69 | "publisher-place": "Hamburg", 70 | "title": "Über die Seele. De anima", 71 | "title-short": "", 72 | "translator": [ 73 | { 74 | "family": "Corcilius", 75 | "given": "Klaus" 76 | } 77 | ], 78 | "type": "book" 79 | }, { 80 | "author": [ 81 | { 82 | "family": "Aubenque", 83 | "given": "Pierre" 84 | } 85 | ], 86 | "container-title": "Aristote et les problèmes de méthode", 87 | "editor": [ 88 | { 89 | "family": "Mansion", 90 | "given": "S." 91 | } 92 | ], 93 | "id": "Aubenque1961a", 94 | "issued": { 95 | "date-parts": [ 96 | [ 97 | 1961 98 | ] 99 | ] 100 | }, 101 | "publisher": "Publications Universitaires", 102 | "publisher-place": "Louvain", 103 | "title": "Sur la notion aristotélicienne d’aporie", 104 | "type": "chapter" 105 | } 106 | ] 107 | -------------------------------------------------------------------------------- /input.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Example of Citetools in action 3 | author: Bernardo César Diniz Athayde Vasconcelos 4 | filters: 5 | - citetools 6 | bibliography_primary: refs/primary.json 7 | bibliography_secondary: refs/secondary.json 8 | #csl: https://raw.githubusercontent.com/bcdavasconcelos/ABNT-Phi/main/abnt-phi-sc.csl 9 | link-fields: true # default 10 | title-field-emphasis: true # default 11 | verbosity: ERROR 12 | --- 13 | 14 | # Introduction {.unnumbered} 15 | 16 | This very concise sample ilustrates the use of `multiple-bibliographies` to separate primary (`refs/primary.json`) and secondary (`refs/secondary.json`) sources for the document; the use of `citation-backlinks` to turn the bibliography into an index of citations with links back to the text; and the use of `citefield` to print in the body of the text useful information from the bibliographic references. 17 | 18 | *Optionally*, `section-bibliographies` can be used to separate the bibliography into sections. For this, you must uncomment the apropriate line in the `_extension.yaml` file. 19 | 20 | 21 | 22 | # The Works of Aristotle 23 | 24 | This is an example of complex use of bibliographic references. We are relying on the bibliography to print in the text the correct names of the authors, editors, and translators & title of the works. 25 | 26 | ```markdown 27 | The works of [@AristOp]{.author} were first edited by 28 | [@AristOp]{.editor} in [@AristOp]{.issued}. 29 | ``` 30 | The works of [@AristOp]{.author} were first edited by 31 | [@AristOp]{.editor.} in [@AristOp]{.issued}. 32 | 33 | ```markdown 34 | Later, the [@DA]{.title} was edited by [@DABiehl1896]{.editor} 35 | in [@DABiehl1896]{.issued} [repr. in [@DATheiler]{.translator}'s 36 | [@DATheiler]{.issued} translation]; by [@DAForster]{.editor} in 37 | [@DAForster]{.issued} [repr. in [@DACorcilius]{.translator}'s 38 | [@DACorcilius]{.issued} translation]; and by [@DARoss]{.editor} 39 | in [@DARoss]{.issued}. 40 | ``` 41 | 42 | Later, the [@DA]{.title} was edited by [@DABiehl1896]{.editor} in [@DABiehl1896]{.issued} [repr. in [@DATheiler]{.translator.}'s [@DATheiler]{.issued} translation]; by [@DAForster]{.editor} in [@DAForster]{.issued} [repr. in [@DACorcilius]{.translator}'s [@DACorcilius]{.issued} translation]; and by [@DARoss]{.editor} in [@DARoss]{.issued}. 43 | 44 | 45 | # Primary Sources {.appendix} 46 | 47 | ::: {#refs_primary} 48 | ::: 49 | 50 | 51 | # Secondary Sources {.appendix} 52 | 53 | ::: {#refs_secondary} 54 | ::: 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs_qmd/04-citation-backlinks.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Citation Backlinks 3 | code-annotations: hover 4 | --- 5 | 6 | In the vanilla Pandoc Citeproc, you can use `link-citations` to control whether citations in the body of the text should be clickable links to the reference in the bibliography (*e.g.* [@EN]{.title-short}). This is a very useful feature, especially when you want to quickly check the source of a citation without having to scroll through the whole text. 7 | 8 | 9 | ::: {.callout-tip appearance="simple"} 10 | The `citetools` extension will take this one step further and add, in a crescent ordinal fashion `[1, 2, 3, 4]`^[In other output formats, such as PDF, the reader will see the page number instead of a crescent ordinal number.], a backlink to each citation an entry has received in the document. 11 | ::: 12 | 13 | This allows the reader to easily arrive at sections of the text where the same reference was discussed, quickly seeing with the array of backlinks, how many times each reference was used in the text (_see reference at the bottom of the text_). 14 | 15 | ## How to avoid an excess of undesired links 16 | 17 | In `citetools` there are options to avoid undesired linking and anomalies caused by citing individual fields, such as repeated links to the same entry in a single phrase or section. 18 | 19 | ### Turning off links in individual citations 20 | 21 | First, there is the option to force a citation to not be a link by adding a simple `dot` at the end of the `.csl_field`. 22 | 23 | | Default | Link-suppresion | 24 | |-----------------|:----------------:| 25 | | `[@EN]{.title}` | `[@EN]{.title.}` | 26 | | [@EN]{.title} | [@EN]{.title.} | 27 | 28 | ### Global options 29 | 30 | Then, there is also the global `link-fields` option, which allows the user to turn off links in citations that target individual fields. It can be used in conjunction with other options that target the bibliography, such as `link-citations` and `link-bibliography`. 31 | 32 | ```yaml 33 | link-citations: true # <1> 34 | link-fields: true # <2> 35 | link-bibliography: true # <3> 36 | lang: en-ZA # <4> 37 | ``` 38 | 1. Hyperlink citations to the corresponding bibliography entries. Defaults to false. 39 | 2. Hyperlink citations that target specific CSL fields to the corresponding entries in the bibliography. If `link-citations` is true, this defaults to true. 40 | 3. Hyperlink DOIs, PMCIDs, PMID, and URLs in bibliographies. Defaults to true. 41 | 4. Affects the bibliography tags. Defaults to en-US. 42 | 43 | ## References {.appendix} 44 | 45 | ::: {#refs_primary} 46 | ::: 47 | -------------------------------------------------------------------------------- /_extensions/citetools/citation-backlinks.lua: -------------------------------------------------------------------------------- 1 | -- Todo: even with link-citations and link-fields turned off, citation-backlinks still adds a single backlink to each reference in the final bibliography div. 2 | 3 | --- citation-backlinks.lua – adds citation backlinks to the bibliography 4 | --- 5 | --- Copyright: © 2023 John MacFarlane and Albert Krewinkel and Bernardo Vasconcelos 6 | --- License: MIT – see LICENSE for details 7 | 8 | -- Makes sure users know if their pandoc version is too old for this 9 | -- filter. 10 | PANDOC_VERSION:must_be_at_least '2.17' 11 | 12 | -- cites is a table mapping citation item identifiers 13 | -- to an array of cite identifiers 14 | local cites = {} 15 | 16 | -- counter for cite identifiers 17 | local cite_number = 1 18 | 19 | local function with_label(s, el) 20 | if FORMAT == "latex" then 21 | -- return {pandoc.RawInline("latex", "\\pagelabel{" .. s .. "}"), el} 22 | return {pandoc.RawInline("latex", "\\label{" .. s .. "}"), el} 23 | end 24 | if FORMAT == "typst" then 25 | return {el, pandoc.RawInline("typst", " #label(\"" .. s .. "\")")} 26 | end 27 | if FORMAT == "docx" or FORMAT == "html" then 28 | return {el} 29 | end 30 | end 31 | 32 | function Cite(el) 33 | local cite_id = "cite_" .. cite_number 34 | cite_number = cite_number + 1 35 | for _,citation in ipairs(el.citations) do 36 | if cites[citation.id] then 37 | table.insert(cites[citation.id], cite_id) 38 | else 39 | cites[citation.id] = {cite_id} 40 | end 41 | end 42 | if FORMAT == "typst" then 43 | return pandoc.Span(with_label(cite_id, el)) 44 | else 45 | return pandoc.Span(with_label(cite_id, el), pandoc.Attr(cite_id)) 46 | end 47 | end 48 | 49 | function append_inline(blocks, inlines) 50 | local last = blocks[#blocks] 51 | if last.t == 'Para' or last.t == 'Plain' then 52 | -- append to last block 53 | last.content:extend(inlines) 54 | else 55 | -- append as additional block 56 | blocks[#blocks + 1] = pandoc.Plain(inlines) 57 | end 58 | return blocks 59 | end 60 | 61 | function Div(el) 62 | local citation_id = el.identifier:match("ref%-(.+)") 63 | local tex_return_link = pandoc.RawInline("latex", "\\Acrobatmenu{GoBack}{$\\hookleftarrow$}") 64 | 65 | if citation_id then 66 | local backlinks = pandoc.Inlines{pandoc.Space(), pandoc.Str("[")} 67 | if FORMAT == "latex" then 68 | -- quarto.doc.include_text("in-header", [[ \newcommand\pagelabel{\phantomsection\label} ]]) 69 | table.insert(backlinks, tex_return_link) 70 | end 71 | 72 | for i,cite_id in ipairs(cites[citation_id] or {}) do 73 | local marker = pandoc.Str(i) 74 | if FORMAT == "latex" then 75 | marker = pandoc.RawInline("latex", "\\pageref{" .. cite_id .. "}") 76 | end 77 | if #backlinks > 2 then 78 | table.insert(backlinks, pandoc.Str(",")) 79 | table.insert(backlinks, pandoc.Space()) 80 | end 81 | table.insert(backlinks, pandoc.Link(marker, "#"..cite_id)) 82 | end 83 | if #backlinks > 2 then 84 | append_inline(el.content, backlinks .. {pandoc.Str("]")}) 85 | end 86 | return el 87 | end 88 | end 89 | -------------------------------------------------------------------------------- /docs_qmd/02-multibib.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Multiple Bibliographies 3 | --- 4 | 5 | 6 | In many areas of research, the ability to split the bibliography into sections is *conditio sine qua non* for publishing.^[In Citetools, we are using a [modified version](https://github.com/bcdavasconcelos/citetools/blob/7ac1c6fd8c1d39db56ac5a41c037853cd76ac301/_extensions/citetools/multiple-bibliographies.lua#L66) of the [multiple-bibliographies](https://github.com/pandoc/lua-filters/tree/master/multiple-bibliographies) filter instead of the similar [multibib](https://github.com/pandoc-ext/multibib) one.] In the humanities, for example, it is common to have a bibliography for primary sources and another for secondary sources. In philosophy, even, they can be very nuanced with sections dedicated to original sources, translations, commentaries, and so on. 7 | 8 | ::: {.callout-tip collapse="false"} 9 | ## Installation 10 | 11 | In case you have not done it yet, install the extension using the following command: 12 | 13 | ```bash 14 | quarto install extension bcdavasconcelos/citetools 15 | ``` 16 | 17 | Or download it at [Github](bcdavasconcelos/citetools). 18 | ::: 19 | 20 | ## How to setup multiple bibliographies 21 | 22 | If you are using Quarto, chances are you have a project folder. In this case, add bibliography files to the project folder (it is advisible adding them to a `refs` folder to prevent cluter in the root folder). Then, add the path to the files to the YAML metadata of your document in this way: 23 | 24 | ```yaml 25 | bibliography_primary: refs/primary.json 26 | bibliography_secondary: refs/secondary.json 27 | ``` 28 | 29 | The path should be relative to the project's root folder. The name of the bibliography should (but doesn't *have to*) be the same as the name of the file, without the extension. 30 | 31 | Then, finally, place the bibliographies placeholders in the document where you want the bibliographies to appear. 32 | 33 | ``` markdown 34 | # Primary Sources 35 | 36 | ::: {#refs_primary} 37 | ::: 38 | 39 | # Secondary Sources 40 | 41 | ::: {#refs_secondary} 42 | ::: 43 | ``` 44 | 45 | Each `refs_bib_name` `div` should have a matching entry `bibliography_bib_name` in the metadata. They will be filled with the citations from the respective bibliography files. 46 | 47 | ::: {.callout-important collapse="false"} 48 | ## Div names 49 | if you have a bibliography named `bibliography_primary`, the placeholder **must** be named `refs-primary` or `refs_primary`. That is, the name of the placeholder must match the name of the `bibliography_` entry (without the prefix) *otherwise nothing will print*. 50 | 51 | 52 | Also, please note that if the placeholder doesn't make its way into the document, the references in that file will not be printed. 53 | ::: 54 | 55 | 56 | ## Working example 57 | 58 | To ensure sure ids match, it can be a good strategy placing the bibliography file close to the div placeholder. 59 | 60 | ```markdown 61 | --- 62 | title: Multiple Bibliographies 63 | --- 64 | 65 | [@EN] [@Aubenque1961a] 66 | 67 | 68 | ## Primary Sources 69 | 70 | --- 71 | bibliography_primary: refs/primary.json 72 | --- 73 | 74 | ::: {#refs_primary} 75 | ::: 76 | 77 | ## Secondary Sources 78 | 79 | --- 80 | bibliography_secondary: refs/secondary.json 81 | --- 82 | 83 | ::: {#refs_secondary} 84 | ::: 85 | ``` 86 | 87 | With this, you should have a working document with multiple bibliographies that would render in the following way: 88 | 89 | 90 | [@EN] [@Aubenque1961a] 91 | 92 | ### Primary Sources {.appendix} 93 | ::: {#refs_primary} 94 | ::: 95 | ### Secondary Sources {.appendix} 96 | ::: {#refs_secondary} 97 | ::: 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/quarto-syntax-highlighting-dark.css: -------------------------------------------------------------------------------- 1 | /* quarto syntax highlight colors */ 2 | :root { 3 | --quarto-hl-al-color: #f07178; 4 | --quarto-hl-an-color: #d4d0ab; 5 | --quarto-hl-at-color: #00e0e0; 6 | --quarto-hl-bn-color: #d4d0ab; 7 | --quarto-hl-bu-color: #abe338; 8 | --quarto-hl-ch-color: #abe338; 9 | --quarto-hl-co-color: #f8f8f2; 10 | --quarto-hl-cv-color: #ffd700; 11 | --quarto-hl-cn-color: #ffd700; 12 | --quarto-hl-cf-color: #ffa07a; 13 | --quarto-hl-dt-color: #ffa07a; 14 | --quarto-hl-dv-color: #d4d0ab; 15 | --quarto-hl-do-color: #f8f8f2; 16 | --quarto-hl-er-color: #f07178; 17 | --quarto-hl-ex-color: #00e0e0; 18 | --quarto-hl-fl-color: #d4d0ab; 19 | --quarto-hl-fu-color: #ffa07a; 20 | --quarto-hl-im-color: #abe338; 21 | --quarto-hl-in-color: #d4d0ab; 22 | --quarto-hl-kw-color: #ffa07a; 23 | --quarto-hl-op-color: #ffa07a; 24 | --quarto-hl-ot-color: #00e0e0; 25 | --quarto-hl-pp-color: #dcc6e0; 26 | --quarto-hl-re-color: #00e0e0; 27 | --quarto-hl-sc-color: #abe338; 28 | --quarto-hl-ss-color: #abe338; 29 | --quarto-hl-st-color: #abe338; 30 | --quarto-hl-va-color: #00e0e0; 31 | --quarto-hl-vs-color: #abe338; 32 | --quarto-hl-wa-color: #dcc6e0; 33 | } 34 | 35 | /* other quarto variables */ 36 | :root { 37 | --quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 38 | } 39 | 40 | code span.al { 41 | background-color: #2a0f15; 42 | font-weight: bold; 43 | color: #f07178; 44 | } 45 | 46 | code span.an { 47 | color: #d4d0ab; 48 | } 49 | 50 | code span.at { 51 | color: #00e0e0; 52 | } 53 | 54 | code span.bn { 55 | color: #d4d0ab; 56 | } 57 | 58 | code span.bu { 59 | color: #abe338; 60 | } 61 | 62 | code span.ch { 63 | color: #abe338; 64 | } 65 | 66 | code span.co { 67 | font-style: italic; 68 | color: #f8f8f2; 69 | } 70 | 71 | code span.cv { 72 | color: #ffd700; 73 | } 74 | 75 | code span.cn { 76 | color: #ffd700; 77 | } 78 | 79 | code span.cf { 80 | font-weight: bold; 81 | color: #ffa07a; 82 | } 83 | 84 | code span.dt { 85 | color: #ffa07a; 86 | } 87 | 88 | code span.dv { 89 | color: #d4d0ab; 90 | } 91 | 92 | code span.do { 93 | color: #f8f8f2; 94 | } 95 | 96 | code span.er { 97 | color: #f07178; 98 | text-decoration: underline; 99 | } 100 | 101 | code span.ex { 102 | font-weight: bold; 103 | color: #00e0e0; 104 | } 105 | 106 | code span.fl { 107 | color: #d4d0ab; 108 | } 109 | 110 | code span.fu { 111 | color: #ffa07a; 112 | } 113 | 114 | code span.im { 115 | color: #abe338; 116 | } 117 | 118 | code span.in { 119 | color: #d4d0ab; 120 | } 121 | 122 | code span.kw { 123 | font-weight: bold; 124 | color: #ffa07a; 125 | } 126 | 127 | pre > code.sourceCode > span { 128 | color: #f8f8f2; 129 | } 130 | 131 | code span { 132 | color: #f8f8f2; 133 | } 134 | 135 | code.sourceCode > span { 136 | color: #f8f8f2; 137 | } 138 | 139 | div.sourceCode, 140 | div.sourceCode pre.sourceCode { 141 | color: #f8f8f2; 142 | } 143 | 144 | code span.op { 145 | color: #ffa07a; 146 | } 147 | 148 | code span.ot { 149 | color: #00e0e0; 150 | } 151 | 152 | code span.pp { 153 | color: #dcc6e0; 154 | } 155 | 156 | code span.re { 157 | background-color: #f8f8f2; 158 | color: #00e0e0; 159 | } 160 | 161 | code span.sc { 162 | color: #abe338; 163 | } 164 | 165 | code span.ss { 166 | color: #abe338; 167 | } 168 | 169 | code span.st { 170 | color: #abe338; 171 | } 172 | 173 | code span.va { 174 | color: #00e0e0; 175 | } 176 | 177 | code span.vs { 178 | color: #abe338; 179 | } 180 | 181 | code span.wa { 182 | color: #dcc6e0; 183 | } 184 | 185 | .prevent-inlining { 186 | content: "Creative Commons License BCDAV, 2023 76 | 77 | format: # from https://github.com/sta210-s22/website/blob/main/_quarto.yml 78 | html: 79 | theme: # Slate e 80 | # Pulse: Rocho (muito bonito) | Spacelab: menos brilhante e mais opaco | Materia: azul claro pouco (material?) | yeti: github like | United: laranja brilhante | 81 | light: [Pulse] # Cerulean, Cosmo, Flatly, Journal, Litera, Lumen, Lux, Materia, Minty, Morph, Pulse, Sandstone, Simplex, Sketchy, Spacelab, United, Yeti, Zephyr 82 | dark: [Cyborg] # Cyborg, Darkly, Quartz, Slate, Solar,Superhero, Vapor 83 | # mainfont: "Atkinson Hyperlegible" 84 | header-includes: | 85 | 97 | code-copy: true 98 | code-overflow: scroll # scroll, wrap, auto 99 | toc: true 100 | reference-location: document # `block`, `section`, `margin`, `document` 101 | 102 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/quarto-syntax-highlighting.css: -------------------------------------------------------------------------------- 1 | /* quarto syntax highlight colors */ 2 | :root { 3 | --quarto-hl-ot-color: #003B4F; 4 | --quarto-hl-at-color: #657422; 5 | --quarto-hl-ss-color: #20794D; 6 | --quarto-hl-an-color: #5E5E5E; 7 | --quarto-hl-fu-color: #4758AB; 8 | --quarto-hl-st-color: #20794D; 9 | --quarto-hl-cf-color: #003B4F; 10 | --quarto-hl-op-color: #5E5E5E; 11 | --quarto-hl-er-color: #AD0000; 12 | --quarto-hl-bn-color: #AD0000; 13 | --quarto-hl-al-color: #AD0000; 14 | --quarto-hl-va-color: #111111; 15 | --quarto-hl-bu-color: inherit; 16 | --quarto-hl-ex-color: inherit; 17 | --quarto-hl-pp-color: #AD0000; 18 | --quarto-hl-in-color: #5E5E5E; 19 | --quarto-hl-vs-color: #20794D; 20 | --quarto-hl-wa-color: #5E5E5E; 21 | --quarto-hl-do-color: #5E5E5E; 22 | --quarto-hl-im-color: #00769E; 23 | --quarto-hl-ch-color: #20794D; 24 | --quarto-hl-dt-color: #AD0000; 25 | --quarto-hl-fl-color: #AD0000; 26 | --quarto-hl-co-color: #5E5E5E; 27 | --quarto-hl-cv-color: #5E5E5E; 28 | --quarto-hl-cn-color: #8f5902; 29 | --quarto-hl-sc-color: #5E5E5E; 30 | --quarto-hl-dv-color: #AD0000; 31 | --quarto-hl-kw-color: #003B4F; 32 | } 33 | 34 | /* other quarto variables */ 35 | :root { 36 | --quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 37 | } 38 | 39 | pre > code.sourceCode > span { 40 | color: #003B4F; 41 | } 42 | 43 | code span { 44 | color: #003B4F; 45 | } 46 | 47 | code.sourceCode > span { 48 | color: #003B4F; 49 | } 50 | 51 | div.sourceCode, 52 | div.sourceCode pre.sourceCode { 53 | color: #003B4F; 54 | } 55 | 56 | code span.ot { 57 | color: #003B4F; 58 | font-style: inherit; 59 | } 60 | 61 | code span.at { 62 | color: #657422; 63 | font-style: inherit; 64 | } 65 | 66 | code span.ss { 67 | color: #20794D; 68 | font-style: inherit; 69 | } 70 | 71 | code span.an { 72 | color: #5E5E5E; 73 | font-style: inherit; 74 | } 75 | 76 | code span.fu { 77 | color: #4758AB; 78 | font-style: inherit; 79 | } 80 | 81 | code span.st { 82 | color: #20794D; 83 | font-style: inherit; 84 | } 85 | 86 | code span.cf { 87 | color: #003B4F; 88 | font-style: inherit; 89 | } 90 | 91 | code span.op { 92 | color: #5E5E5E; 93 | font-style: inherit; 94 | } 95 | 96 | code span.er { 97 | color: #AD0000; 98 | font-style: inherit; 99 | } 100 | 101 | code span.bn { 102 | color: #AD0000; 103 | font-style: inherit; 104 | } 105 | 106 | code span.al { 107 | color: #AD0000; 108 | font-style: inherit; 109 | } 110 | 111 | code span.va { 112 | color: #111111; 113 | font-style: inherit; 114 | } 115 | 116 | code span.bu { 117 | font-style: inherit; 118 | } 119 | 120 | code span.ex { 121 | font-style: inherit; 122 | } 123 | 124 | code span.pp { 125 | color: #AD0000; 126 | font-style: inherit; 127 | } 128 | 129 | code span.in { 130 | color: #5E5E5E; 131 | font-style: inherit; 132 | } 133 | 134 | code span.vs { 135 | color: #20794D; 136 | font-style: inherit; 137 | } 138 | 139 | code span.wa { 140 | color: #5E5E5E; 141 | font-style: italic; 142 | } 143 | 144 | code span.do { 145 | color: #5E5E5E; 146 | font-style: italic; 147 | } 148 | 149 | code span.im { 150 | color: #00769E; 151 | font-style: inherit; 152 | } 153 | 154 | code span.ch { 155 | color: #20794D; 156 | font-style: inherit; 157 | } 158 | 159 | code span.dt { 160 | color: #AD0000; 161 | font-style: inherit; 162 | } 163 | 164 | code span.fl { 165 | color: #AD0000; 166 | font-style: inherit; 167 | } 168 | 169 | code span.co { 170 | color: #5E5E5E; 171 | font-style: inherit; 172 | } 173 | 174 | code span.cv { 175 | color: #5E5E5E; 176 | font-style: italic; 177 | } 178 | 179 | code span.cn { 180 | color: #8f5902; 181 | font-style: inherit; 182 | } 183 | 184 | code span.sc { 185 | color: #5E5E5E; 186 | font-style: inherit; 187 | } 188 | 189 | code span.dv { 190 | color: #AD0000; 191 | font-style: inherit; 192 | } 193 | 194 | code span.kw { 195 | color: #003B4F; 196 | font-style: inherit; 197 | } 198 | 199 | .prevent-inlining { 200 | content: " 5 | 6 | 7 |
8 | 9 | [![Render and Publish](https://github.com/bcdavasconcelos/citetools/actions/workflows/quarto-publish.yml/badge.svg)](https://github.com/bcdavasconcelos/citetools/actions/workflows/quarto-publish.yml) 10 | 11 | 12 | 13 | This extension introduces advanced bibliography features to Pandoc and Quarto's Citeproc environment. It bundles several Lua filters ([*vide infra*](#license)) to address complex bibliography demands while keeping the output consistent across all formats (`LaTeX`, `DOCX`, `HTML`, and so on). 14 | 15 | ## Features 16 | 17 | 18 | More specifically, this bunddle seeks to address in the simplest of ways possible the following demands: 19 | 20 | **1. Multiple bibliographies** 21 | 22 | The need for multiple bibliographies (or bibliographies with multiple sections, such as `primary sources` and `secondary sources`). 23 | 24 | ![](img/2023-03-18-22-02-26.png) 25 | 26 | **2. Cite fields** 27 | 28 | The need to evoke arbitrary information from the references, such as `author`, `editor`, or `translator` names and `title` / `original-title` of works. 29 | 30 | ![](img/2023-03-18-22-24-10.png) 31 | 32 |
33 | `@AristOp` in `csljson` 34 | 35 | ```json 36 | { 37 | "author": [ 38 | { 39 | "family": "Aristotle" 40 | } 41 | ], 42 | "editor": [ 43 | { 44 | "family": "Bekker", 45 | "given": "Immanuel" 46 | } 47 | ], 48 | "id": "AristOp", 49 | "issued": { 50 | "date-parts": [ 51 | [ 52 | 1831 53 | ] 54 | ] 55 | }, 56 | "number-of-volumes": "4", 57 | "publisher": "Reimer", 58 | "publisher-place": "Berlim", 59 | "title": "Aristotelis opera", 60 | "type": "book" 61 | } 62 | ``` 63 | 64 |
65 | 66 | **3. Citation backlinks** 67 | 68 | The need to turn the bibliography into a linked index of cited references, with links from the entries back to each of its multiple occurences in the body of the text (*e.g.* in `PDF`/`DOCX`: `[p. 1, p. 4, p. 10]`, in `HTML`: `[1, 2, 3]`) (and with the ability to turn these off globally or in an *ad hoc* fashion). 69 | 70 | ![](img/2023-03-18-22-32-06.png) 71 | 72 | - *Optionally*, the need to split the bibliography into sections, printing the bibliography for each chapter/section/part. (For this, you must uncomment the apropriate line in the `_extension.yaml` file.) 73 | 74 | ## Install 75 | 76 | Users of Quarto can install this extension with the following command 77 | 78 | ```bash 79 | quarto install extension bcdavasconcelos/citetools 80 | ``` 81 | 82 | and use it by adding `citetools` to the `filters` entry in their YAML header. 83 | 84 | ``` yaml 85 | --- 86 | filters: 87 | - citetools 88 | --- 89 | ``` 90 | 91 | ## Configuration 92 | 93 | ### Multiple bibliographies 94 | 95 | Add bibliography files to the `refs` folder. Then, add the following metadata to the YAML header of your document in this way: 96 | 97 | ```yaml 98 | --- 99 | bibliography_primary: refs/primary.json 100 | bibliography_secondary: refs/secondary.json 101 | --- 102 | ``` 103 | 104 | Then, place the bibliographies placeholders in the document where you want the bibliographies to appear. 105 | 106 | ``` markdown 107 | # Primary Sources 108 | 109 | ::: {#refs_primary} 110 | ::: 111 | 112 | # Secondary Sources 113 | 114 | ::: {#refs_secondary} 115 | ::: 116 | ``` 117 | 118 | These divs are filled with citations from the respective bib-file. Each refs-*x* div should have a matching entry *x* in the metadata. 119 | 120 | **Make sure the bibliography name and the placeholder div id match.** 121 | 122 | That is, if you have a bibliography named `bibliography_primary`, the placeholder div should be `refs-primary` or `refs_primary`. 123 | 124 | ### Cite fields and citation backlinks global options 125 | 126 | - `link-fields` (boolean): Link inlines printed by `citefield` to their corresponding entry in the bibliography. Default: `true`. 127 | - `link-citations` (boolean): Link citations to their respective reference in the bibliography. Default: `true`. Note: if `link-citations` is set to `false`, `link-fields` is also set to `false`. 128 | 129 | --- 130 | 131 | See sample document `sample.qmd` for a working example with explanations. 132 | 133 | 134 | image 135 | 136 | 137 | -------------------------------------------------------------------------------- /docs_qmd/_all-bibtex-fields-to-csl-yaml.qmd: -------------------------------------------------------------------------------- 1 | ::: {.callout-note collapse="true"} 2 | ## Given this very unlikely BibTeX reference... 3 | Repeated with different types, such as `book`, `article`, `incollection`, `inbook`, `thesis`. 4 | 5 | ```bibtex 6 | @book{ID, 7 | author = {author}, 8 | editor = {editor}, 9 | translator = {translator}, 10 | director = {director}, 11 | title = {title}, 12 | booktitle = {booktitle}, 13 | shortauthor = {shortauthor}, 14 | shorthand = {shorthand}, 15 | shortlabel = {shortlabel}, 16 | address = {address}, 17 | publisher = {publisher}, 18 | howpublished = {howpublished}, 19 | type = {type description}, 20 | library = {library}, 21 | series = {series}, 22 | journal = {journal}, 23 | issue = {issue}, 24 | organization = {organization}, 25 | school = {school}, 26 | institution = {institution}, 27 | keywords = {keywords}, 28 | annote = {annote}, 29 | note = {note}, 30 | isbn = {isbn}, 31 | issn = {issn}, 32 | doi = {doi}, 33 | url = {url}, 34 | edition = {edition}, 35 | chapter = {chapter}, 36 | volume = {volume}, 37 | eid = {Electronic identifier}, 38 | number = {number}, 39 | month = {month}, 40 | pages = {pages}, 41 | year = {year}, 42 | crossref = {crossref}, 43 | key = {key}, 44 | version = {0}, 45 | LCCN = {LCCN}, 46 | file = {file:///Users/bcdav/x.pdf}, 47 | contents = {copyright} 48 | } 49 | ``` 50 | ::: 51 | 52 | Converted with the command `/usr/local/bin/pandoc -f bibtex -t markdown -s --citeproc --wrap=none`, we would get this YAML: 53 | 54 | ::: {.panel-tabset} 55 | ## book 56 | ```yaml 57 | - annote: annote 58 | author: 59 | - family: author 60 | call-number: library 61 | chapter-number: chapter 62 | collection-number: number 63 | collection-title: Series 64 | container-title: journal 65 | director: 66 | - family: director 67 | doi: doi 68 | edition: edition 69 | editor: 70 | - family: editor 71 | genre: type description 72 | id: ID 73 | isbn: isbn 74 | issn: issn 75 | issued: year 76 | keyword: keywords 77 | note: note 78 | page: pages 79 | publisher: school; institution; organization; howpublished; publisher 80 | publisher-place: address 81 | title: Title 82 | translator: 83 | - family: translator 84 | type: book 85 | url: url 86 | version: 0 87 | volume: volume 88 | ``` 89 | ## article 90 | ```yaml 91 | - annote: annote 92 | author: 93 | - family: author 94 | call-number: library 95 | chapter-number: chapter 96 | collection-title: Series 97 | container-title: journal 98 | director: 99 | - family: director 100 | doi: doi 101 | edition: edition 102 | editor: 103 | - family: editor 104 | genre: type description 105 | id: ID 106 | isbn: isbn 107 | issn: issn 108 | issue: number, issue 109 | issued: year 110 | keyword: keywords 111 | note: note 112 | page: pages 113 | publisher: school; institution; organization; howpublished; publisher 114 | publisher-place: address 115 | title: Title 116 | translator: 117 | - family: translator 118 | type: article-journal 119 | url: url 120 | version: 0 121 | volume: volume 122 | ``` 123 | ## incollection 124 | ```yaml 125 | - annote: annote 126 | author: 127 | - family: author 128 | call-number: library 129 | chapter-number: chapter 130 | collection-number: number 131 | collection-title: Series 132 | container-title: Booktitle 133 | director: 134 | - family: director 135 | doi: doi 136 | edition: edition 137 | editor: 138 | - family: editor 139 | genre: type description 140 | id: ID 141 | isbn: isbn 142 | issn: issn 143 | issued: year 144 | keyword: keywords 145 | note: note 146 | page: pages 147 | publisher: school; institution; organization; howpublished; publisher 148 | publisher-place: address 149 | title: Title 150 | translator: 151 | - family: translator 152 | type: chapter 153 | url: url 154 | version: 0 155 | volume: volume 156 | ``` 157 | ## pdhthesis 158 | ```yaml 159 | - annote: annote 160 | author: 161 | - family: author 162 | call-number: library 163 | chapter-number: chapter 164 | collection-title: Series 165 | container-title: journal 166 | director: 167 | - family: director 168 | doi: doi 169 | edition: edition 170 | editor: 171 | - family: editor 172 | genre: type description 173 | id: ID 174 | isbn: isbn 175 | issn: issn 176 | issued: year 177 | keyword: keywords 178 | note: note 179 | number: number 180 | page: pages 181 | publisher: school; institution; organization; howpublished; publisher 182 | publisher-place: address 183 | title: Title 184 | translator: 185 | - family: translator 186 | type: thesis 187 | url: url 188 | version: 0 189 | volume: volume 190 | ``` 191 | ::: 192 | -------------------------------------------------------------------------------- /_extensions/citetools/multiple-bibliographies.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | multiple-bibliographies – create multiple bibliographies 3 | 4 | Copyright © 2018-2021 Albert Krewinkel 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | ]] 18 | local List = require 'pandoc.List' 19 | local utils = require 'pandoc.utils' 20 | local stringify = utils.stringify 21 | local run_json_filter = utils.run_json_filter 22 | 23 | --- Collection of all cites in the document 24 | local all_cites = {} 25 | --- Document meta value 26 | local doc_meta = pandoc.Meta{} 27 | 28 | --- Div used by pandoc-citeproc to insert the bibliography. 29 | local refs_div = pandoc.Div({}, pandoc.Attr('refs')) 30 | 31 | -- Div filled by pandoc-citeproc with properties set according to 32 | -- the output format and the attributes of cs:bibliography 33 | local refs_div_with_properties 34 | 35 | --- Run citeproc on a pandoc document 36 | local citeproc 37 | if utils.citeproc then 38 | -- Built-in Lua function 39 | citeproc = utils.citeproc 40 | else 41 | -- Use pandoc as a citeproc processor 42 | citeproc = function (doc) 43 | local opts = {'--from=json', '--to=json', '--citeproc', '--quiet'} 44 | return run_json_filter(doc, 'pandoc', opts) 45 | end 46 | end 47 | 48 | 49 | --- Resolve citations in the document by combining all bibliographies 50 | -- before running pandoc-citeproc on the full document. 51 | local function resolve_doc_citations (doc) 52 | -- combine all bibliographies 53 | local meta = doc.meta 54 | local orig_bib = meta.bibliography 55 | meta.bibliography = pandoc.MetaList{orig_bib} 56 | for name, value in pairs(meta) do 57 | if name:match('^bibliography_') then 58 | table.insert(meta.bibliography, value) 59 | end 60 | end 61 | -- add dummy div to catch the created bibliography 62 | table.insert(doc.blocks, refs_div) 63 | -- resolve all citations 64 | -- doc = run_json_filter(doc, 'pandoc-citeproc') 65 | doc = citeproc(doc) 66 | doc.meta.references = pandoc.utils.references(doc) 67 | -- remove catch-all bibliography and keep it for future use 68 | refs_div_with_properties = table.remove(doc.blocks) 69 | -- restore bibliography to original value 70 | doc.meta.bibliography = orig_bib 71 | return doc 72 | end 73 | 74 | --- Explicitly create a new meta object with all fields relevant for 75 | --- pandoc-citeproc. 76 | local function meta_for_pandoc_citeproc (bibliography) 77 | -- We could just indiscriminately copy all meta fields, but let's be 78 | -- explicit about what's important. 79 | local fields = { 80 | 'bibliography', 'references', 'csl', 'citation-style', 81 | 'link-citations', 'citation-abbreviations', 'lang', 82 | 'suppress-bibliography', 'reference-section-title', 83 | 'notes-after-punctuation', 'nocite' 84 | } 85 | local new_meta = pandoc.Meta{} 86 | for _, field in ipairs(fields) do 87 | new_meta[field] = doc_meta[field] 88 | end 89 | new_meta.bibliography = bibliography 90 | return new_meta 91 | end 92 | 93 | --- Create a bibliography for a given topic. This acts on all divs whose 94 | -- ID starts with "refs", followed by nothing but underscores and 95 | -- alphanumeric characters. 96 | local function create_topic_bibliography (div) 97 | local name = div.identifier:match('^refs([_%w]*)$') 98 | local bibfile = name and doc_meta['bibliography' .. name] 99 | if not bibfile then 100 | return nil 101 | end 102 | local tmp_blocks = {pandoc.Para(all_cites), refs_div} 103 | local tmp_meta = meta_for_pandoc_citeproc(bibfile) 104 | local tmp_doc = pandoc.Pandoc(tmp_blocks, tmp_meta) 105 | local res = citeproc(tmp_doc, true) -- try to be quiet 106 | -- First block of the result contains the dummy paragraph, second is 107 | -- the refs Div filled by pandoc-citeproc. 108 | div.content = res.blocks[2].content 109 | -- Set the classes and attributes as pandoc-citeproc did it on refs_div 110 | div.classes = refs_div_with_properties.classes 111 | div.attributes = refs_div_with_properties.attributes 112 | return div 113 | end 114 | 115 | return { 116 | { 117 | -- Collect all citations and the doc's Meta value for other filters. 118 | Cite = function (c) all_cites[#all_cites + 1] = c end, 119 | Meta = function (m) doc_meta = m end, 120 | }, 121 | { Pandoc = resolve_doc_citations }, 122 | { Div = create_topic_bibliography }, 123 | } 124 | -------------------------------------------------------------------------------- /_extensions/citetools/section-bibliographies.lua: -------------------------------------------------------------------------------- 1 | --- greetings.lua – turns any document into a friendly greeting 2 | --- 3 | --- Copyright: © 2018 Jesse Rosenthal, 2020–2022 Albert Krewinkel 4 | --- License: MIT – see LICENSE for details 5 | 6 | -- pandoc.utils.make_sections exists since pandoc 2.8 7 | PANDOC_VERSION:must_be_at_least {2,8} 8 | 9 | local utils = require 'pandoc.utils' 10 | local run_json_filter = utils.run_json_filter 11 | 12 | --- The document's metadata 13 | local meta 14 | -- Lowest level at which bibliographies should be generated. 15 | local section_refs_level 16 | -- original bibliography value 17 | local orig_bibliography 18 | 19 | -- Returns true iff a div is a section div. 20 | local function is_section_div (div) 21 | return div.t == 'Div' 22 | and div.classes[1] == 'section' 23 | and div.attributes.number 24 | end 25 | 26 | local function section_header (div) 27 | local header = div.content and div.content[1] 28 | local is_header = is_section_div(div) 29 | and header 30 | and header.t == 'Header' 31 | return is_header and header or nil 32 | end 33 | 34 | local function adjust_refs_components (div) 35 | local header = section_header(div) 36 | if not header then 37 | return div 38 | end 39 | local blocks = div.content 40 | local bib_header = blocks:find_if(function (b) 41 | return b.attr and b.identifier == 'bibliography' 42 | end) 43 | local refs = blocks:find_if(function (b) 44 | return b.attr and b.identifier == 'refs' 45 | end) 46 | if bib_header then 47 | bib_header.identifier = 'bibliography-' .. header.attributes.number 48 | bib_header.level = header.level + 1 49 | end 50 | if refs and refs.identifier == 'refs' then 51 | refs.identifier = 'refs-' .. header.attributes.number 52 | end 53 | return div 54 | end 55 | 56 | local function run_citeproc (doc) 57 | if PANDOC_VERSION >= '2.19.1' then 58 | return pandoc.utils.citeproc(doc) 59 | elseif PANDOC_VERSION >= '2.11' then 60 | local args = {'--from=json', '--to=json', '--citeproc'} 61 | return run_json_filter(doc, 'pandoc', args) 62 | else 63 | return run_json_filter(doc, 'pandoc-citeproc', {FORMAT, '-q'}) 64 | end 65 | end 66 | 67 | --- Create a bibliography for a given topic. This acts on all 68 | -- section divs at or above `section_refs_level` 69 | local function create_section_bibliography (div) 70 | -- don't do anything if there is no bibliography 71 | if not meta.bibliography and not meta.references then 72 | return nil 73 | end 74 | local header = section_header(div) 75 | -- Blocks for which a bibliography will be generated 76 | local subsections 77 | local blocks 78 | if not header or section_refs_level < header.level then 79 | -- Don't do anything for lower level sections. 80 | return nil 81 | elseif section_refs_level == header.level then 82 | blocks = div.content 83 | subsections = pandoc.List:new{} 84 | else 85 | blocks = div.content:filter(function (b) 86 | return not is_section_div(b) 87 | end) 88 | subsections = div.content:filter(is_section_div) 89 | end 90 | local tmp_doc = pandoc.Pandoc(blocks, meta) 91 | local new_doc = run_citeproc(tmp_doc) 92 | div.content = new_doc.blocks .. subsections 93 | return adjust_refs_components(div) 94 | end 95 | 96 | --- Remove remaining section divs 97 | local function flatten_sections (div) 98 | local header = section_header(div) 99 | if not header then 100 | return nil 101 | else 102 | header.identifier = div.identifier 103 | header.attributes.number = nil 104 | div.content[1] = header 105 | return div.content 106 | end 107 | end 108 | 109 | --- Filter to the references div and bibliography header added by 110 | --- pandoc-citeproc. 111 | local remove_pandoc_citeproc_results = { 112 | Header = function (header) 113 | return header.identifier == 'bibliography' 114 | and {} 115 | or nil 116 | end, 117 | Div = function (div) 118 | return div.identifier == 'refs' 119 | and {} 120 | or nil 121 | end 122 | } 123 | 124 | local function restore_bibliography (meta) 125 | meta.bibliography = orig_bibliography 126 | return meta 127 | end 128 | 129 | --- Setup the document for further processing by wrapping all 130 | --- sections in Div elements. 131 | function setup_document (doc) 132 | -- save meta for other filter functions 133 | meta = doc.meta 134 | section_refs_level = tonumber(meta["section-bibs-level"]) or 1 135 | orig_bibliography = meta.bibliography 136 | meta.bibliography = meta['section-bibs-bibliography'] or meta.bibliography 137 | local sections = utils.make_sections(true, nil, doc.blocks) 138 | return pandoc.Pandoc(sections, doc.meta) 139 | end 140 | 141 | return { 142 | -- remove result of previous pandoc-citeproc run (for backwards 143 | -- compatibility) 144 | remove_pandoc_citeproc_results, 145 | {Pandoc = setup_document}, 146 | {Div = create_section_bibliography}, 147 | {Div = flatten_sections, Meta = restore_bibliography} 148 | } 149 | -------------------------------------------------------------------------------- /refs/primary.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": [ 4 | { 5 | "family": "Aristotle" 6 | } 7 | ], 8 | "editor": [ 9 | { 10 | "family": "Bywater", 11 | "given": "Ingram" 12 | } 13 | ], 14 | "id": "ENBywater", 15 | "issued": { 16 | "date-parts": [ 17 | [ 18 | 1894 19 | ] 20 | ] 21 | }, 22 | "page": "1-224 (1094a1", 23 | "publisher": "Clarendon", 24 | "publisher-place": "Oxford", 25 | "title": "Ethica nicomachea", 26 | "type": "book", 27 | "volume": "Aristotelis ethica Nicomachea" 28 | }, 29 | { 30 | "author": [ 31 | { 32 | "family": "Aristotle" 33 | } 34 | ], 35 | "container-title": "Aristotelis opera", 36 | "editor": [ 37 | { 38 | "family": "Bekker", 39 | "given": "Immanuel" 40 | } 41 | ], 42 | "id": "DA", 43 | "issued": { 44 | "date-parts": [ 45 | [ 46 | 1831 47 | ] 48 | ] 49 | }, 50 | "original-title": "Περὶ ψυχῆς", 51 | "page": "402a01-435b25", 52 | "publisher": "Reimer", 53 | "publisher-place": "Berlim", 54 | "title": "De anima", 55 | "type": "chapter" 56 | }, 57 | { 58 | "author": [ 59 | { 60 | "family": "Aristotle" 61 | } 62 | ], 63 | "container-title": "Aristotelis opera", 64 | "editor": [ 65 | { 66 | "family": "Bekker", 67 | "given": "Immanuel" 68 | } 69 | ], 70 | "id": "EN", 71 | "issued": { 72 | "date-parts": [ 73 | [ 74 | 1831 75 | ] 76 | ] 77 | }, 78 | "original-title": "Ἠθικὰ νικομάχεια", 79 | "page": "1094a01-1181b23", 80 | "publisher": "Reimer", 81 | "publisher-place": "Berlim", 82 | "title": "Ethica nicomachea", 83 | "title-short":"EN", 84 | "type": "chapter" 85 | }, 86 | { 87 | "author": [ 88 | { 89 | "family": "Aristotle" 90 | } 91 | ], 92 | "editor": [ 93 | { 94 | "family": "Ross", 95 | "given": "William David" 96 | } 97 | ], 98 | "id": "DARoss", 99 | "issued": { 100 | "date-parts": [ 101 | [ 102 | 1961 103 | ] 104 | ] 105 | }, 106 | "page": "402a1-435b25", 107 | "publisher": "Clarendon", 108 | "publisher-place": "Oxford", 109 | "title": "De anima", 110 | "type": "book" 111 | }, 112 | { 113 | "author": [ 114 | { 115 | "family": "Aristotle" 116 | } 117 | ], 118 | "editor": [ 119 | { 120 | "family": "Burnet", 121 | "given": "John" 122 | } 123 | ], 124 | "id": "ENBurnet", 125 | "issued": { 126 | "date-parts": [ 127 | [ 128 | 1900 129 | ] 130 | ] 131 | }, 132 | "publisher": "Methuen", 133 | "publisher-place": "Londres", 134 | "title": "The ethics of aristotle", 135 | "type": "book" 136 | }, 137 | { 138 | "author": [ 139 | { 140 | "family": "Aristotle" 141 | } 142 | ], 143 | "editor": [ 144 | { 145 | "family": "Biehl", 146 | "given": "Wilhelm" 147 | } 148 | ], 149 | "id": "DABiehl1896", 150 | "issued": { 151 | "date-parts": [ 152 | [ 153 | 1896 154 | ] 155 | ] 156 | }, 157 | "publisher": "Teubner", 158 | "publisher-place": "Leipzig", 159 | "title": "De anima", 160 | "type": "book" 161 | }, 162 | { 163 | "author": [ 164 | { 165 | "family": "Aristotle" 166 | } 167 | ], 168 | "editor": [ 169 | { 170 | "family": "Susemihl", 171 | "given": "Franz" 172 | }, 173 | { 174 | "family": "Apelt", 175 | "given": "Otto" 176 | } 177 | ], 178 | "id": "ENSusemihlApelt1903", 179 | "issued": { 180 | "date-parts": [ 181 | [ 182 | 1903 183 | ] 184 | ] 185 | }, 186 | "publisher": "Teubner", 187 | "publisher-place": "Leipzig", 188 | "title": "Ethica nicomachea", 189 | "type": "book" 190 | }, 191 | { 192 | "author": [ 193 | { 194 | "family": "Aristotle" 195 | } 196 | ], 197 | "editor": [ 198 | { 199 | "family": "Förster", 200 | "given": "Aurél" 201 | } 202 | ], 203 | "id": "DAForster", 204 | "issued": { 205 | "date-parts": [ 206 | [ 207 | 1912 208 | ] 209 | ] 210 | }, 211 | "publisher": "Hungarian Academy of Sciences", 212 | "publisher-place": "Budapeste", 213 | "title": "Aristotelis de anima libri III", 214 | "type": "book" 215 | }, 216 | { 217 | "author": [ 218 | { 219 | "family": "Aristotle" 220 | } 221 | ], 222 | "editor": [ 223 | { 224 | "family": "Bekker", 225 | "given": "Immanuel" 226 | } 227 | ], 228 | "id": "AristOp", 229 | "issued": { 230 | "date-parts": [ 231 | [ 232 | 1831 233 | ] 234 | ] 235 | }, 236 | "number-of-volumes": "4", 237 | "publisher": "Reimer", 238 | "publisher-place": "Berlim", 239 | "title": "Aristotelis opera", 240 | "type": "book", 241 | "edition": "1" 242 | } 243 | ] 244 | -------------------------------------------------------------------------------- /_extensions/citetools/multibib.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | multibib – create multiple bibliographies 3 | 4 | Copyright © 2018-2022 Albert Krewinkel 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | ]] 18 | PANDOC_VERSION:must_be_at_least '2.11' 19 | 20 | local List = require 'pandoc.List' 21 | local utils = require 'pandoc.utils' 22 | local stringify = utils.stringify 23 | local run_json_filter = utils.run_json_filter 24 | 25 | --- get the type of meta object 26 | local metatype = pandoc.utils.type or 27 | function (v) 28 | local metatag = type(v) == 'table' and v.t and v.t:gsub('^Meta', '') 29 | return metatag and metatag ~= 'Map' and metatag or type(v) 30 | end 31 | 32 | --- Collection of all cites in the document 33 | local all_cites = {} 34 | --- Document meta value 35 | local doc_meta = pandoc.Meta{} 36 | 37 | --- Div used by citeproc to insert the bibliography. 38 | local refs_div = pandoc.Div({}, pandoc.Attr('refs')) 39 | 40 | -- Div filled by citeproc with properties set according to 41 | -- the output format and the attributes of cs:bibliography 42 | local refs_div_with_properties 43 | 44 | --- Run citeproc on a pandoc document 45 | local citeproc 46 | if utils.citeproc then 47 | -- Built-in Lua function 48 | citeproc = utils.citeproc 49 | else 50 | -- Use pandoc as a citeproc processor 51 | citeproc = function (doc) 52 | local opts = {'--from=json', '--to=json', '--citeproc', '--quiet'} 53 | return run_json_filter(doc, 'pandoc', opts) 54 | end 55 | end 56 | 57 | --- Resolve citations in the document by combining all bibliographies 58 | -- before running pandoc-citeproc on the full document. 59 | local function resolve_doc_citations (doc) 60 | -- combine all bibliographies 61 | local meta = doc.meta 62 | local bibconf = meta.bibliography 63 | meta.bibliography = pandoc.MetaList{} 64 | if metatype(bibconf) == 'table' then 65 | for _, value in pairs(bibconf) do 66 | table.insert(meta.bibliography, value) 67 | end 68 | end 69 | -- add refs div to catch the created bibliography 70 | table.insert(doc.blocks, refs_div) 71 | -- resolve all citations 72 | doc = citeproc(doc) 73 | doc.meta.references = pandoc.utils.references(doc) 74 | -- remove catch-all bibliography and keep it for future use 75 | refs_div_with_properties = table.remove(doc.blocks) 76 | -- restore bibliography to original value 77 | doc.meta.bibliography = orig_bib 78 | return doc 79 | end 80 | 81 | --- Explicitly create a new meta object with all fields relevant for 82 | --- pandoc-citeproc. 83 | local function meta_for_pandoc_citeproc (bibliography) 84 | -- We could just indiscriminately copy all meta fields, but let's be 85 | -- explicit about what's important. 86 | local fields = { 87 | 'bibliography', 'references', 'csl', 'citation-style', 88 | 'link-citations', 'citation-abbreviations', 'lang', 89 | 'suppress-bibliography', 'reference-section-title', 90 | 'notes-after-punctuation', 'nocite' 91 | } 92 | local new_meta = pandoc.Meta{} 93 | for _, field in ipairs(fields) do 94 | new_meta[field] = doc_meta[field] 95 | end 96 | new_meta.bibliography = bibliography 97 | return new_meta 98 | end 99 | 100 | local function remove_duplicates(classes) 101 | local seen = {} 102 | return classes:filter(function(x) 103 | if seen[x] then 104 | return false 105 | else 106 | seen[x] = true 107 | return true 108 | end 109 | end) 110 | end 111 | 112 | --- Create a bibliography for a given topic. This acts on all divs whose 113 | -- ID starts with "refs", followed by nothing but underscores and 114 | -- alphanumeric characters. 115 | local function create_topic_bibliography (div) 116 | local name = div.identifier:match('^refs([-_]?[-_%w]*)$') 117 | local bibfile = name and (doc_meta.bibliography or {})[name] 118 | if not bibfile then 119 | return nil 120 | end 121 | local tmp_blocks = {pandoc.Para(all_cites), refs_div} 122 | local tmp_meta = meta_for_pandoc_citeproc(bibfile) 123 | local tmp_doc = pandoc.Pandoc(tmp_blocks, tmp_meta) 124 | local res = citeproc(tmp_doc, true) 125 | -- First block of the result contains the dummy paragraph, second is 126 | -- the refs Div filled by citeproc. 127 | div.content = res.blocks[2].content 128 | -- Set the classes and attributes as citeproc did it on refs_div 129 | div.classes = remove_duplicates(refs_div_with_properties.classes) 130 | div.attributes = refs_div_with_properties.attributes 131 | return div 132 | end 133 | 134 | return { 135 | { 136 | -- Collect all citations and the doc's Meta value for other filters. 137 | Cite = function (c) all_cites[#all_cites + 1] = c end, 138 | Meta = function (m) doc_meta = m end, 139 | }, 140 | { Pandoc = resolve_doc_citations }, 141 | { Div = create_topic_bibliography }, 142 | } 143 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/anchor.min.js: -------------------------------------------------------------------------------- 1 | // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat 2 | // 3 | // AnchorJS - v4.3.1 - 2021-04-17 4 | // https://www.bryanbraun.com/anchorjs/ 5 | // Copyright (c) 2021 Bryan Braun; Licensed MIT 6 | // 7 | // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat 8 | !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function d(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function w(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],d(this.options),this.isTouchDevice=function(){return Boolean("ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,o,i,n,s,a,c,r,l,h,u,p=[];if(d(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=w(A=A||"h2, h3, h4, h5, h6")).length)return this;for(null===document.head.querySelector("style.anchorjs")&&((u=document.createElement("style")).className="anchorjs",u.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(u):document.head.insertBefore(u,A),u.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",u.sheet.cssRules.length),u.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",u.sheet.cssRules.length),u.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",u.sheet.cssRules.length),u.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',u.sheet.cssRules.length)),u=document.querySelectorAll("[id]"),t=[].map.call(u,function(A){return A.id}),i=0;i\]./()*\\\n\t\b\v\u00A0]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),A=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||A||!1}}}); 9 | // @license-end -------------------------------------------------------------------------------- /docs_qmd/01-basics.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: The Basics of Pandoc Citeproc 3 | bibliography: ../refs/primary.json 4 | citeproc: true 5 | --- 6 | 7 | Before we can begin with advanced bibliography features in Pandoc and Quarto, we need to get some basics out of the way, as this will be the foundation for the advanced bibliography features. 8 | 9 | ::: {.callout-tip appearance="simple"} 10 | ## Official documentation 11 | See the official documentation on citations at [Pandoc](https://pandoc.org/MANUAL.html#citations) and [Quarto](https://quarto.org/docs/authoring/footnotes-and-citations.html#sec-citations). 12 | ::: 13 | 14 | ::: {.callout-warning collapse="true"} 15 | ## Creating a bibliography file 16 | Before you can use Cite Tool, you will need a bibliography file. Although nothing stops you from keeping bibliography files manually, this is not advisable for anything other than very small-scale projects. For everything else, consider using software such as [Zotero](http://www.zotero.org), [JabRef](https://www.jabref.org), [Bookends](https://www.sonnysoftware.com), [Bibdesk](https://bibdesk.sourceforge.io), [Endnote](https://endnote.com) (and see also [this comparison on Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_reference_management_software)). These programs allow you to edit your bibliography and easily export it in the desired format. 17 | 18 | The most common format, and one of the oldest, is called `BibTeX` (or `BibLaTeX`); others, more recent, include `CSL-JSON` and `CSL-YAML`. These latter are *preferable* since they perform much faster on **Pandoc** and **Quarto** (being the format used to represent the bibliography internally)^[They are not, however, widely supported, so you'll probably be stuck with `BibTeX` or `BibLaTeX` in some way or other anyway.]. 19 | 20 | You can also use shared bibliographies on Github (just provide Pandoc with the URL to the raw file) or shared Zotero libraries, which can be downloaded using the API by accessing the link below, where `LibraryID` should be replaced by the 7-digit code in the middle of the library URL. 21 | 22 | `https://api.zotero.org/groups/LibraryID/items?format=bibtex&limit=999` 23 | ::: 24 | 25 | 26 | ## How to Setup a Simple Bibliography 27 | 28 | Set up the bibliography of a document by including the path to the bibliography file in the YAML header. 29 | 30 | ```yaml 31 | bibliography: path/to/bibfile.bib 32 | csl: path/to/cslfile.csl # optional 33 | ``` 34 | 35 | 36 | ::: {.callout-warning collapse=true} 37 | ## CSL file 38 | If no CSL file is supplied, Pandoc will default to the Chicago Author-Date style. It is advisable to use a CSL file, as it will ensure that the bibliography is formatted according to the style of your choice. You can find a list of available CSL styles in the [Citation Styles Github Repo](https://github.com/citation-style-language/styles) and you can edit them with the [CSL Visual Editor](https://editor.citationstyles.org/visualEditor/) or using [Zotero](https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step). 39 | ::: 40 | 41 | 42 | It is also advisable to keep the bibliography and CSL style files in the default Pandoc folder: 43 | 44 | - {{< fa brands apple >}} macOS: `~/.local/share/pandoc` 45 | - {{< fa brands linux >}} Linux: `~/.local/share/pandoc` 46 | - {{< fa brands windows >}} Windows: `C:\Users\USERNAME\AppData\Roaming\pandoc` 47 | 48 | You can find the path to your Pandoc folder by running the following command in your terminal: 49 | 50 | ```bash 51 | pandoc --version 52 | ``` 53 | 54 | This way, you can use the same bibliography and CSL-style files in all your documents. Alternatively, you can keep the files in the same folder as your document, which is the approach favored by [Quarto](https://quarto.org/docs/projects/quarto-projects.html). 55 | 56 | 57 | 58 | 59 | ::: {.callout-tip collapse=true} 60 | ## How to share the Pandoc folder 61 | If the Pandoc folder needs to be shared among multiple devices, you can use a cloud service like Dropbox or Google Drive to store the files and use a `symbolic link` to place the files in the Pandoc folder. For example, if you are using Dropbox, you can run the following command in your terminal: 62 | 63 | ```bash 64 | ln -s ~/Dropbox/Pandoc ~/.local/share/pandoc 65 | ``` 66 | 67 | The symbolic link will appear as a shortcut pointing to the Dropbox folder and any changes will be reflected in both locations. 68 | ::: 69 | 70 | 71 | If the files are in the default Pandoc folder or the same folder as the document, you can simply supply the file name: 72 | 73 | ```yaml 74 | bibliography: bibfile.bib 75 | csl: cslfile.csl 76 | ``` 77 | 78 | You can, but you don't have to, place a div at the end of the document or where you want the bibliography to be printed. 79 | 80 | ```markdown 81 | ::: {.references} 82 | ::: 83 | ``` 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | ## How to cite in Pandoc 92 | 93 | The vanilla Pandoc and Quarto's Citeproc environment is powerful and its syntax is simple. It uses `@Citekey` for `Author (Date)`and `[-@Citekey]` for `(Date)`. 94 | 95 | ::: {.callout-tip appearance="simple"} 96 | The advantage of this markup syntax lies in its simplicity and compatibility with all formats supported by Pandoc, a universal document converter. 97 | ::: 98 | 99 | Here are some examples: 100 | 101 | > `@Aubenque1961a` says that... [...] ...on the deliberations of the prudent person `[-@Aubenque1961a]`. 102 | 103 | > @Aubenque1961a says that... [...] ...on the deliberations of the prudent person [-@Aubenque1961a]. 104 | 105 | The citation key is *optionally* followed by a locator, which can be a page number, a line number, a chapter number, or a section number, preceded by a comma. 106 | 107 | > ...on the deliberations of the prudent person `[-@Aubenque1961a, p.15]` . 108 | 109 | > ...on the deliberations of the prudent person [-@Aubenque1961a, p.15]. 110 | 111 | 112 | 113 | ## Syntax Summary 114 | 115 | 116 | | Syntax | Output | 117 | | :--------------: | :--------------: | 118 | | `@Aubenque1961a` | @Aubenque1961a | 119 | | `[@Aubenque1961a]` | [@Aubenque1961a] | 120 | | `[@Aubenque1961a, p.15]` | [@Aubenque1961a, p.15] | 121 | | `[-@Aubenque1961a]` | [-@Aubenque1961a] | 122 | | `[-@Aubenque1961a, p.15]` | [-@Aubenque1961a, p.15] | 123 | 124 | : Variations of the Citation syntax 125 | 126 | 127 | Now that we have the basics covered, let us see what Cite Tools can do for us. 128 | -------------------------------------------------------------------------------- /_extensions/citetools/citefield.lua: -------------------------------------------------------------------------------- 1 | --- https://github.com/bcdavasconcelos/citefield 2 | --- citefield.lua 3 | --- 1.0.3 4 | --- Copyright: © 2023 - Albert Krewinkel & Bernardo Vasconcelos 5 | --- License: MIT – see LICENSE for details 6 | 7 | --- [@Citekey]{.csl_field} 8 | --- to print any valid CSL field 9 | --- [@Citekey]{.csl_field.} (with extra dot) 10 | --- to do it without creating a link. 11 | 12 | --- ATTENTION: *MUST* *RUN* *AFTER* *CITEPROC*. 13 | 14 | PANDOC_VERSION:must_be_at_least '2.17' 15 | 16 | local stringify = require 'pandoc.utils'.stringify 17 | 18 | csl_fields = {"abstract", "accessed", "annote", "archive", "archive_collection", "archive_location", "archive-place", "author", "authority", "available-date", "call-number", "chair", "chapter-number", "citation-key", "citation-label", "citation-number", "collection-editor", "collection-number", "collection-title", "compiler", "composer", "container-author", "container-title", "container-title-short", "contributor", "curator", "dimensions", "director", "division", "DOI", "edition", "editor", "editor-translator", "editorial-director", "event", "event-date", "event-place", "event-title", "executive-producer", "first-reference-note-number", "genre", "guest", "host", "illustrator", "interviewer", "ISBN", "ISSN", "issue", "issued", "jurisdiction", "keyword", "language", "license", "locator", "medium", "narrator", "note", "number", "number-of-pages", "number-of-volumes", "organizer", "original-author", "original-date", "original-publisher", "original-publisher-place", "original-title", "page", "page-first", "part-number", "part-title", "performer", "PMCID", "PMID", "printing-number", "producer", "publisher", "publisher-place", "recipient", "references", "reviewed-author", "reviewed-genre", "reviewed-title", "scale", "script-writer", "section", "series-creator", "source", "status", "submitted", "supplement-number", "title", "title-short", "translator", "URL", "version", "volume", "volume-title", "year-suffix"} 19 | 20 | function get_options(meta) 21 | if meta['link-citations'] or meta['link-fields'] or meta['title-field-emphasis'] then 22 | return {link_citations = meta['link-citations'], link_fields = meta['link-fields'], title_field_emph = meta['title-field-emphasis']} 23 | else 24 | return {} 25 | end 26 | end 27 | 28 | local function has_value(tab, val) 29 | for index, value in ipairs(tab) do 30 | if value == val then 31 | return true 32 | end 33 | end 34 | return false 35 | end 36 | 37 | function Pandoc (doc) 38 | 39 | doc.meta.references = pandoc.utils.references(doc) 40 | doc.meta.bibliography = nil 41 | 42 | return doc:walk{ 43 | 44 | Span = function (span) 45 | 46 | -- check that the span contains only a single cite object 47 | local cite = span.content[1] 48 | local citations = cite and cite.citations or nil 49 | if #span.content == 1 and cite.t == 'Cite' and #citations == 1 then 50 | the_arg = stringify(span.classes[1]) 51 | if span.classes[2] then -- note in use 52 | local extra_arg = stringify(span.classes[2]) 53 | end 54 | -- check dotted to turn off linking 55 | if string.find(the_arg, ".", 1, true) then 56 | dotted = true 57 | the_arg = string.gsub(the_arg, "%.$", "") 58 | else 59 | dotted = false 60 | end 61 | -- check ordinal:to retrieve the first, second, third or forth author/editor/translator 62 | if string.find(the_arg, "_first", 1, true) then 63 | ordinal = 1 64 | the_arg = string.gsub(the_arg, "%_first$", "") 65 | else if string.find(the_arg, "_second", 1, true) then 66 | ordinal = 2 67 | the_arg = string.gsub(the_arg, "%_second$", "") 68 | else if string.find(the_arg, "_third", 1, true) then 69 | ordinal = 3 70 | the_arg = string.gsub(the_arg, "%_third$", "") 71 | else if string.find(the_arg, "_forth", 1, true) then 72 | ordinal = 4 73 | the_arg = string.gsub(the_arg, "%_fourth$", "") 74 | else 75 | ordinal = 1 76 | end 77 | end 78 | end 79 | end 80 | 81 | -- Simple error trap 82 | if has_value(csl_fields, the_arg) then 83 | else -- if field is not valid 84 | return "#ERROR: Invalid CSL Field#" 85 | end -- end of error trap 86 | 87 | local cite_id = citations[1].id -- get citekey 88 | local the_result = "" -- initialize result 89 | local ref = doc.meta.references:find_if( -- get reference 90 | function (r) return cite_id == r.id end 91 | ) -- end of get reference 92 | 93 | if ref and ref[the_arg] then -- if field is not empty 94 | local content = ref[the_arg] -- get field 95 | local title_field_emph = get_options(doc.meta).title_field_emph 96 | if the_arg == "author" or the_arg == "editor" or the_arg == "translator" then -- if field contains name 97 | if content[ordinal] then -- if name[ord] exists 98 | if content[ordinal]["family"] then -- if name[ord] contains family name 99 | the_result = ref[the_arg][ordinal]["family"] -- get family name 100 | else if ref[the_arg][ordinal]["literal"] then -- if name[ord] does not contain family name, but contains literal 101 | the_result = ref[the_arg][ordinal]["literal"] 102 | else -- if field does not contain family name or literal 103 | the_result = "#ERROR#" 104 | end 105 | end -- end of name exists 106 | else -- no name error 107 | print("ERROR: [".. cite_id .. "][" .. the_arg .. "][" .. ordinal .. "] is empty") 108 | return "#ERROR: [".. cite_id .. "][" .. the_arg .. "][" .. ordinal .. "] is empty#" 109 | end -- end of field contains name 110 | else if the_arg == "title" and title_field_emph ~= false then -- if field is a title 111 | the_result = pandoc.Emph{stringify(ref[the_arg])} 112 | else if the_arg == "title-short" and title_field_emph ~= false then -- if field is a short title 113 | the_result = pandoc.Emph{stringify(ref[the_arg])} 114 | else -- if field is not a name or a title 115 | the_result = stringify(ref[the_arg]) 116 | end -- end of field is not a name or a title 117 | end -- end of field is a short title 118 | end -- end of field is a title 119 | else -- end of field is empty 120 | the_result = span 121 | end 122 | 123 | if dotted == true 124 | or the_arg == "notes" 125 | or the_arg == "abstract" 126 | or the_arg == "keyword" 127 | or the_arg == "annote" 128 | or get_options(doc.meta).link_citations == false 129 | then -- if field is not to be linked 130 | return the_result 131 | else -- if field is to be linked 132 | if get_options(doc.meta).link_citations == true and get_options(doc.meta).link_fields ~= false then 133 | the_result = pandoc.Link(the_result, "#ref-"..cite_id) 134 | cite.content = {the_result} 135 | return cite 136 | else -- if get_options(doc.meta).link_citations == true and get_options(doc.meta).link_fields == false then 137 | return the_result 138 | end 139 | end -- end of field is to be linked 140 | end -- end of span contains only a single cite object 141 | 142 | end -- end of Span 143 | 144 | } -- end of doc:walk 145 | 146 | end -- end of Pandoc 147 | 148 | 149 | --- The original version of this script was generously contributed by [Albert Krewinkel](https://github.com/sponsors/tarleb) to the [Pandoc-Dicuss mailing list](https://groups.google.com/g/pandoc-discuss/c/5gb64T4OU9Q). It is being shared with permission (and at the request) of the original author for the benefit of the community of Pandoc users. 150 | --- The current version was butchered by Bernardo CDA Vasconcelos to include error msgs, csl-field validation, making all field retrievable (including items in lists), adding emph for titles. The code probably needs refactorying from someone that actually know something about Lua to make it simpler, but it works. 151 | -------------------------------------------------------------------------------- /index.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: | 3 | Cite Tools 4 | subtitle: | 5 | Advanced bibliography for Pandoc and Quarto 6 | author: "Bernardo Vasconcelos" 7 | date: 2023-03-26 8 | filters: 9 | - citetools 10 | # - fontawesome 11 | --- 12 | 13 | Cite Tools is an extension of the Quarto Open-Source Scientific and Technical Publishing System, built upon Pandoc and compatible with any version above `2.17`, that bundles together [several Lua filters](/docs_qmd/05-about.qmd) 🌙 to introduce advanced bibliography features. 14 | 15 | ## Why a bibliography extension? 16 | 17 | Users of the jurassic [BibTeX](https://en.wikipedia.org/wiki/BibTeX) would probably be exceptionally pleased with the speed and reliability of Pandoc Citeproc. Apart from being (*a lot*) faster, Citeproc will produce the same output across all formats supported by Pandoc, which amount to over 60, including HTML, LaTeX, and Word. 18 | 19 | Out-of-the-box, however, Citeproc does not provide common BibTeX functionalities, such as the ability to split the bibliography into multiple sections, or the ability to cite arbitrary fields of the references (*e.g.* `citetitle`, `citeauthor`, `citefield`). It also lacks the interesting **backref** option afforded by BibTeX and [HyperRef](http://www.ctan.org/pkg/hyperref), which allows for the creation of linked indexes of citations. 20 | 21 | Luckily, Citeproc is extensible, and this extension aims to provide a solution to these limitations and, *hopefully*, allow Pandoc and Quarto users to **completely** replace BibTeX/BibLaTeX with Citeproc. It will allow the user to *easily* create multiple bibliographies (or bibliographies with multiple sections, such as *primary* and *secondary sources*), cite arbitrary fields of the references^[In the official nomenclature, CSL has *variables*, BibTeX has *fields*, and RIS has *tags*. As a general rule, we have stuck to the term *fields*.], and create linked indexes of citations^[Linked glossaries can also easily be created by dressing it as bibiography]. All of this with very little configuration needed. 22 | 23 | Also, with the advent of Quarto, it has become easier for those not well-versed Lua or Pandoc to use extensions such as this one! So, why not?! 24 | 25 | ## New to Quarto ? 26 | Quarto is an open-source scientific and technical publishing system. Visit the [getting started](https://quarto.org/docs/get-started/) guide to download and install. Once installed, you can use it to create, build, and preview your documents. 27 | 28 | ::: {.callout-tip appearance="simple"} 29 | **I highly recommend visiting the [Tutorial: Hello, Quarto](https://quarto.org/docs/get-started/hello/vscode.html).** You'll learn how to create a document, build it, and preview it. You will also be taken to the excellent extensions for [VS Code](https://quarto.org/docs/get-started/#quarto-for-vs-code) and [RStudio](https://quarto.org/docs/get-started/#quarto-for-rstudio) that will make your life easier. 30 | ::: 31 | 32 | ::: {.callout-note collapse="true"} 33 | ## Quarto Quickstart 🚀 34 | 35 | - On macOS ({{< fa brands apple >}}), use [Homebrew](https://brew.sh/) to `brew install quarto`. 36 | - On Windows ({{< fa brands windows >}}), use [Chocolatey](https://chocolatey.org/) to `choco install quarto`. 37 | - On Linux ({{< fa brands linux >}}), use your package manager to install `quarto`. 38 | 39 | Find out more at [Awesome Quarto](https://github.com/mcanouil/awesome-quarto), [Quarto Extensions](https://github.com/quarto-ext?type=source), [Quarto on Github](https://github.com/search?q=topic%3Aquarto&type=repositories), [RStudio Community](https://community.rstudio.com/tags/quarto), [Stack Overflow](https://stackoverflow.com/questions/tagged/quarto), [Twitter](https://twitter.com/quarto_pub). 40 | ::: 41 | 42 | 43 | 44 | ## New to Pandoc ? 45 | [Pandoc](https://pandoc.org/) is a universal document converter developed by John MacFarlane, professor of philosophy, that is at the core of Quarto. To learn more about it, see the [Pandoc User's Guide](https://pandoc.org/MANUAL.html) [{{< fa regular file-pdf >}}](https://pandoc.org/MANUAL.pdf). You can install Pandoc as a standalone application, but it will also inevitably be included in any Quarto instalation. 46 | 47 | Make sure to check [Pandoc-Discuss](https://groups.google.com/g/pandoc-discuss) in case you have unsolved questions. You can also ask questions on [Pandoc at Stack Overflow](https://stackoverflow.com/questions/tagged/pandoc). 48 | 49 | ## Installation 📦 50 | 51 | If the prospect of typing something on the command line seems daunting, or if you simply need a sample, you can download the [citetools repository](https://github.com/bcdavasconcelos/citetools/archive/refs/heads/main.zip) {{< fa brands github >}} directly and open it in VSCode to see a working example. 52 | 53 | Otherwise, create a new project and install it using: 54 | 55 | ```bash 56 | quarto install extension bcdavasconcelos/citetools 57 | ``` 58 | 59 | Activate it by adding `citetools` to the `_quarto.yml` file in the filters section. 60 | 61 | ```yaml 62 | filters: 63 | - citetools 64 | ``` 65 | 66 | ## Quickstart 🚀 67 | 68 | Add the path to the bibliography files to the document YAML header or `_quarto.yml` 📁 69 | 70 | ```yaml 71 | --- 72 | bibliography_bib-name: path/to/bibfile.bib 73 | bibliography_other-bib-name: path/to/otherbibfile.bib 74 | --- 75 | ``` 76 | 77 | Place the corresponding placeholders where they should be printed in the document body 🖨️ 78 | 79 | ```markdown 80 | ::: {#refs_bib-name} 81 | ::: 82 | 83 | ::: {#refs_other-bib-name} 84 | ::: 85 | ``` 86 | 87 | You're ready to rock. 🤘 88 | 89 | ## Usage 📖 90 | 91 | Cite references [as you normally do in Pandoc](/docs_qmd/01-basics.qmd#how-to-cite-in-pandoc) and they will be linked 🔗 and backlinked 🔗 to the bibliography 📚 92 | 93 | ```markdown 94 | [@citekey] 95 | ``` 96 | 97 | Use `[@Citekey]{.csl_field}` to arbitrarily print specific fields instead of the usual Author-Date format. This is useful for printing the title of a book or the name of a journal in the text. 🎯 98 | 99 | ```markdown 100 | [@citekey]{.author} 101 | [@citekey]{.title} 102 | [@citekey]{.original-title} 103 | ``` 104 | Append the field name with a dot to avoid creating a link to the bibliography in this particular citation📍 105 | 106 | ```markdown 107 | [@citekey]{.author.} 108 | ``` 109 | This can also be done globally 🌐 by setting `link-fields: false` in the metadata^[If `link-citations` is `false` then `link-fields` will also default to `false`.]. This is useful if you want to print the title of a book or the name of a journal in the text, but don't want to create a link to the bibliography. 110 | 111 | ```yaml 112 | --- 113 | link-fields: false 114 | --- 115 | ``` 116 | 117 | ## Documentation 📚 118 | 119 | This [Quarto-powered website](https://quarto.org/docs/websites/) provides documentation for the following filters: 120 | 121 | - [{{< fa solid file-code >}}](https://github.com/bcdavasconcelos/citetools/blob/main/_extensions/citetools/multiple-bibliographies.lua) [multiple-bibliographies](/docs_qmd/02-multibib.qmd) 122 | - [{{< fa solid file-code >}}](https://github.com/bcdavasconcelos/citetools/blob/main/_extensions/citetools/cite-field.lua) [cite-field](/docs_qmd/03-cite-field.qmd) 123 | - [{{< fa solid file-code >}}](https://github.com/bcdavasconcelos/citetools/blob/main/_extensions/citetools/citation-backlinks.lua) [citation-backlinks](/docs_qmd/04-citation-backlinks.qmd) 124 | 125 | In the future, we plan to add documentation for the following filters: 126 | 127 | - [section-bibliographies](https://github.com/pandoc-ext/section-bibliographies) 128 | - [recursive citeproc](https://github.com/dialoa/recursive-citeproc) 129 | 130 | 131 | ## Contributing 🤝 132 | If you have suggestions for other filters, improvements to the existing ones, or bug reports, please open an issue at the [citetools repository](https://github.com/bcdavasconcelos/citetools/issues) {{< fa brands github >}}. 133 | 134 | 135 | ## Acknowledgments 🙏 136 | 137 | - Albert Krewinkel, for creating Pandoc filters. 138 | - John MacFarlane, for creating Pandoc. 139 | - The community of Quarto and Pandoc developers and users. 140 | 141 | ## See also 142 | 143 | - [ScriQ](https://github.com/bcdavasconcelos/ScrivQ/) is a Scrivener template with hundreds of built-in Quarto parameters, plus the ability to export multiple files, to handle cross-references and manage bibliography. 144 | 145 | -------------------------------------------------------------------------------- /docs/site_libs/clipboard/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.11 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1 The works of \[\@AristOp]{.author} were first edited by \[\@AristOp]{.editor} under the title \[\@AristOp]{.title} in \[\@AristOp]{.issued}. 130 | 131 | Which would render as: 132 | 133 | > The works of [@AristOp]{.author} were first edited by [@AristOp]{.editor} under the title [@AristOp]{.title} in [@AristOp]{.issued}. 134 | 135 | 136 | 137 | 138 | 139 | 140 | ## Citation Style Language 141 | 142 | ::: {.callout-note appearance="simple"} 143 | Did you notice that we used `[@AristOp]{.issued}` instead of ~~`[@AristOp]{.date}`~~? And `[@AristOp]{.publisher-place}` instead of ~~`[@AristOp]{.city}`~~? 144 | ::: 145 | 146 | Internally, as we said, Pandoc uses the [Citation Style Language](https://docs.citationstyles.org/en/stable/specification.html) to handle bibliographies. This is a standard schema for bibliographic data, which is used by some bibliography managers, such as Zotero, and JabRef. Most, however, are closer to 147 | the conventions of [BibTeX](https://en.wikipedia.org/wiki/BibTeX#Field_types) (or [RIS](https://en.wikipedia.org/wiki/RIS_(file_format)#Tags)) which is why you may not see an exact correspondence between the CSL variables and BibTeX field names. 148 | 149 | In CSL, there are the following variables: 150 | 151 | ``` 152 | abstract accessed annote archive archive_collection archive_location archive-place author authority available-date call-number chair chapter-number citation-key citation-label citation-number collection-editor collection-number collection-title compiler composer container-author container-title container-title-short contributor curator dimensions director division DOI edition editor editor-translator editorial-director event event-date event-place event-title executive-producer first-reference-note-number genre guest host illustrator interviewer ISBN ISSN issue issued jurisdiction keyword language license locator medium narrator note notes number number-of-pages number-of-volumes organizer original-author original-date original-publisher original-publisher-place original-title page page-first part-number part-title performer PMCID PMID printing-number producer publisher publisher-place recipient references reviewed-author reviewed-genre reviewed-title scale script-writer section series-creator source status submitted supplement-number title title-short translator URL version volume volume-title year-suffix 153 | ``` 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | Here is a quick reference, not exhaustive by any means, of where will the data end up in the conversion from BibTeX and RIS to CSL. This means that the CSL variables on the first column are the final destination and they receive the content of the second or third-column fields depending on the format it converts from. On the second tab, we map the reference types from BibTeX to the CSL types. 162 | 163 | ::: {.panel-tabset} 164 | ## CSL & BibTeX Fields 165 | | CSL | BibTeX | RIS | 166 | |:----:|:----:|:--:| 167 | | author | authors | AU | 168 | | editor | editors | ED | 169 | | issued | date | PY | 170 | | title | title | T1 | 171 | | title-short | shorttitle | `-` | 172 | | container-title | booktitle (**inproceedings incollection inbook**) | BT | 173 | | container-title | journal (**article book proceedings masterthesis lexicon online booklet**) | JA | 174 | | collection-title | series | `-` | 175 | | original-title | origtitle | OR | 176 | | publisher | school, institution, organization, howpublished, publisher | PB | 177 | | publisher-place | address | PP | 178 | | abstract | abstract | AB | 179 | | url | URL | UR | 180 | | keywords | keywords | KW | 181 | | chapter-number | chapter | `-` | 182 | | issue | issue (**article**), number (**article**) | IS | 183 | | number | number (**phdthesis**) | IS | 184 | | collection-number | number (**book**) | IS | 185 | | volume | volume | VL | 186 | | number-of-volumes | volumes | NV | 187 | | page | pages | SP | 188 | | edition | edition | ET | 189 | | genre | type | `-` | 190 | | call-number | library | ID | 191 | | version | version | `-` | 192 | 193 | : Where do BibTeX and RIS fields end up in CSL-YAML/CSL-JSON? 194 | 195 | See also, the full list of [CSL variables](https://docs.citationstyles.org/en/stable/specification.html#appendix-iv-variables), [BibTeX Fields](https://en.wikipedia.org/wiki/BibTeX#Field_types) and [RIS Tags](https://en.wikipedia.org/wiki/RIS_(file_format)#Tags). 196 | 197 | 198 | ## CSL & BibTeX Types 199 | 200 | | CSL | BibTeX | 201 | |:----------:|:---------:| 202 | | article-journal | article | 203 | | book | book | 204 | | pamphlet | booklet | 205 | | chapter | inbook | 206 | | chapter | incollection | 207 | | paper-conference | inproceedings | 208 | | book | manual | 209 | | thesis | mastersthesis | 210 | | thesis | misc | 211 | | thesis | phdthesis | 212 | | book | proceedings | 213 | | report | techreport | 214 | | manuscript | unpublished | 215 | 216 | : How do BibTeX types end up in CSL-YAML/CSL-JSON? 217 | 218 | See also the full list of [CSL](https://docs.citationstyles.org/en/stable/specification.html#appendix-iii-types) and [BibTeX](https://en.wikipedia.org/wiki/BibTeX#Entry_types) types. 219 | ::: 220 | 221 | 222 | 223 | 224 | # Primary Sources {.appendix} 225 | 226 | ::: {#refs_primary} 227 | ::: 228 | 229 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-nav/quarto-nav.js: -------------------------------------------------------------------------------- 1 | const headroomChanged = new CustomEvent("quarto-hrChanged", { 2 | detail: {}, 3 | bubbles: true, 4 | cancelable: false, 5 | composed: false, 6 | }); 7 | 8 | window.document.addEventListener("DOMContentLoaded", function () { 9 | let init = false; 10 | 11 | // Manage the back to top button, if one is present. 12 | let lastScrollTop = window.pageYOffset || document.documentElement.scrollTop; 13 | const scrollDownBuffer = 5; 14 | const scrollUpBuffer = 35; 15 | const btn = document.getElementById("quarto-back-to-top"); 16 | const hideBackToTop = () => { 17 | btn.style.display = "none"; 18 | }; 19 | const showBackToTop = () => { 20 | btn.style.display = "inline-block"; 21 | }; 22 | if (btn) { 23 | window.document.addEventListener( 24 | "scroll", 25 | function () { 26 | const currentScrollTop = 27 | window.pageYOffset || document.documentElement.scrollTop; 28 | 29 | // Shows and hides the button 'intelligently' as the user scrolls 30 | if (currentScrollTop - scrollDownBuffer > lastScrollTop) { 31 | hideBackToTop(); 32 | lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop; 33 | } else if (currentScrollTop < lastScrollTop - scrollUpBuffer) { 34 | showBackToTop(); 35 | lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop; 36 | } 37 | 38 | // Show the button at the bottom, hides it at the top 39 | if (currentScrollTop <= 0) { 40 | hideBackToTop(); 41 | } else if ( 42 | window.innerHeight + currentScrollTop >= 43 | document.body.offsetHeight 44 | ) { 45 | showBackToTop(); 46 | } 47 | }, 48 | false 49 | ); 50 | } 51 | 52 | function throttle(func, wait) { 53 | var timeout; 54 | return function () { 55 | const context = this; 56 | const args = arguments; 57 | const later = function () { 58 | clearTimeout(timeout); 59 | timeout = null; 60 | func.apply(context, args); 61 | }; 62 | 63 | if (!timeout) { 64 | timeout = setTimeout(later, wait); 65 | } 66 | }; 67 | } 68 | 69 | function headerOffset() { 70 | // Set an offset if there is are fixed top navbar 71 | const headerEl = window.document.querySelector("header.fixed-top"); 72 | if (headerEl) { 73 | return headerEl.clientHeight; 74 | } else { 75 | return 0; 76 | } 77 | } 78 | 79 | function footerOffset() { 80 | const footerEl = window.document.querySelector("footer.footer"); 81 | if (footerEl) { 82 | return footerEl.clientHeight; 83 | } else { 84 | return 0; 85 | } 86 | } 87 | 88 | function updateDocumentOffsetWithoutAnimation() { 89 | updateDocumentOffset(false); 90 | } 91 | 92 | function updateDocumentOffset(animated) { 93 | // set body offset 94 | const topOffset = headerOffset(); 95 | const bodyOffset = topOffset + footerOffset(); 96 | const bodyEl = window.document.body; 97 | bodyEl.setAttribute("data-bs-offset", topOffset); 98 | bodyEl.style.paddingTop = topOffset + "px"; 99 | 100 | // deal with sidebar offsets 101 | const sidebars = window.document.querySelectorAll( 102 | ".sidebar, .headroom-target" 103 | ); 104 | sidebars.forEach((sidebar) => { 105 | if (!animated) { 106 | sidebar.classList.add("notransition"); 107 | // Remove the no transition class after the animation has time to complete 108 | setTimeout(function () { 109 | sidebar.classList.remove("notransition"); 110 | }, 201); 111 | } 112 | 113 | if (window.Headroom && sidebar.classList.contains("sidebar-unpinned")) { 114 | sidebar.style.top = "0"; 115 | sidebar.style.maxHeight = "100vh"; 116 | } else { 117 | sidebar.style.top = topOffset + "px"; 118 | sidebar.style.maxHeight = "calc(100vh - " + topOffset + "px)"; 119 | } 120 | }); 121 | 122 | // allow space for footer 123 | const mainContainer = window.document.querySelector(".quarto-container"); 124 | if (mainContainer) { 125 | mainContainer.style.minHeight = "calc(100vh - " + bodyOffset + "px)"; 126 | } 127 | 128 | // link offset 129 | let linkStyle = window.document.querySelector("#quarto-target-style"); 130 | if (!linkStyle) { 131 | linkStyle = window.document.createElement("style"); 132 | linkStyle.setAttribute("id", "quarto-target-style"); 133 | window.document.head.appendChild(linkStyle); 134 | } 135 | while (linkStyle.firstChild) { 136 | linkStyle.removeChild(linkStyle.firstChild); 137 | } 138 | if (topOffset > 0) { 139 | linkStyle.appendChild( 140 | window.document.createTextNode(` 141 | section:target::before { 142 | content: ""; 143 | display: block; 144 | height: ${topOffset}px; 145 | margin: -${topOffset}px 0 0; 146 | }`) 147 | ); 148 | } 149 | if (init) { 150 | window.dispatchEvent(headroomChanged); 151 | } 152 | init = true; 153 | } 154 | 155 | // initialize headroom 156 | var header = window.document.querySelector("#quarto-header"); 157 | if (header && window.Headroom) { 158 | const headroom = new window.Headroom(header, { 159 | tolerance: 5, 160 | onPin: function () { 161 | const sidebars = window.document.querySelectorAll( 162 | ".sidebar, .headroom-target" 163 | ); 164 | sidebars.forEach((sidebar) => { 165 | sidebar.classList.remove("sidebar-unpinned"); 166 | }); 167 | updateDocumentOffset(); 168 | }, 169 | onUnpin: function () { 170 | const sidebars = window.document.querySelectorAll( 171 | ".sidebar, .headroom-target" 172 | ); 173 | sidebars.forEach((sidebar) => { 174 | sidebar.classList.add("sidebar-unpinned"); 175 | }); 176 | updateDocumentOffset(); 177 | }, 178 | }); 179 | headroom.init(); 180 | 181 | let frozen = false; 182 | window.quartoToggleHeadroom = function () { 183 | if (frozen) { 184 | headroom.unfreeze(); 185 | frozen = false; 186 | } else { 187 | headroom.freeze(); 188 | frozen = true; 189 | } 190 | }; 191 | } 192 | 193 | window.addEventListener( 194 | "hashchange", 195 | function (e) { 196 | window.scrollTo(0, window.pageYOffset - headerOffset()); 197 | }, 198 | false 199 | ); 200 | 201 | // Observe size changed for the header 202 | const headerEl = window.document.querySelector("header.fixed-top"); 203 | if (headerEl && window.ResizeObserver) { 204 | const observer = new window.ResizeObserver( 205 | updateDocumentOffsetWithoutAnimation 206 | ); 207 | observer.observe(headerEl, { 208 | attributes: true, 209 | childList: true, 210 | characterData: true, 211 | }); 212 | } else { 213 | window.addEventListener( 214 | "resize", 215 | throttle(updateDocumentOffsetWithoutAnimation, 50) 216 | ); 217 | } 218 | setTimeout(updateDocumentOffsetWithoutAnimation, 250); 219 | 220 | // fixup index.html links if we aren't on the filesystem 221 | if (window.location.protocol !== "file:") { 222 | const links = window.document.querySelectorAll("a"); 223 | for (let i = 0; i < links.length; i++) { 224 | if (links[i].href) { 225 | links[i].href = links[i].href.replace(/\/index\.html/, "/"); 226 | } 227 | } 228 | 229 | // Fixup any sharing links that require urls 230 | // Append url to any sharing urls 231 | const sharingLinks = window.document.querySelectorAll( 232 | "a.sidebar-tools-main-item" 233 | ); 234 | for (let i = 0; i < sharingLinks.length; i++) { 235 | const sharingLink = sharingLinks[i]; 236 | const href = sharingLink.getAttribute("href"); 237 | if (href) { 238 | sharingLink.setAttribute( 239 | "href", 240 | href.replace("|url|", window.location.href) 241 | ); 242 | } 243 | } 244 | 245 | // Scroll the active navigation item into view, if necessary 246 | const navSidebar = window.document.querySelector("nav#quarto-sidebar"); 247 | if (navSidebar) { 248 | // Find the active item 249 | const activeItem = navSidebar.querySelector("li.sidebar-item a.active"); 250 | if (activeItem) { 251 | // Wait for the scroll height and height to resolve by observing size changes on the 252 | // nav element that is scrollable 253 | const resizeObserver = new ResizeObserver((_entries) => { 254 | // The bottom of the element 255 | const elBottom = activeItem.offsetTop; 256 | const viewBottom = navSidebar.scrollTop + navSidebar.clientHeight; 257 | 258 | // The element height and scroll height are the same, then we are still loading 259 | if (viewBottom !== navSidebar.scrollHeight) { 260 | // Determine if the item isn't visible and scroll to it 261 | if (elBottom >= viewBottom) { 262 | navSidebar.scrollTop = elBottom; 263 | } 264 | 265 | // stop observing now since we've completed the scroll 266 | resizeObserver.unobserve(navSidebar); 267 | } 268 | }); 269 | resizeObserver.observe(navSidebar); 270 | } 271 | } 272 | } 273 | }); 274 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/popper.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @popperjs/core v2.11.4 - MIT License 3 | */ 4 | 5 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),o=1,i=1;if(r(e)&&t){var a=e.offsetHeight,f=e.offsetWidth;f>0&&(o=s(n.width)/f||1),a>0&&(i=s(n.height)/a||1)}return{width:n.width/o,height:n.height/i,top:n.top/i,right:n.right/o,bottom:n.bottom/i,left:n.left/o,x:n.left/o,y:n.top/i}}function c(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function p(e){return e?(e.nodeName||"").toLowerCase():null}function u(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function l(e){return f(u(e)).left+c(e).scrollLeft}function d(e){return t(e).getComputedStyle(e)}function h(e){var t=d(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function m(e,n,o){void 0===o&&(o=!1);var i,a,d=r(n),m=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),v=u(n),g=f(e,m),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(d||!d&&!o)&&(("body"!==p(n)||h(v))&&(y=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:c(i)),r(n)?((b=f(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):v&&(b.x=l(v))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function v(e){var t=f(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function g(e){return"html"===p(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||u(e)}function y(e){return["html","body","#document"].indexOf(p(e))>=0?e.ownerDocument.body:r(e)&&h(e)?e:y(g(e))}function b(e,n){var r;void 0===n&&(n=[]);var o=y(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],h(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(b(g(s)))}function x(e){return["table","td","th"].indexOf(p(e))>=0}function w(e){return r(e)&&"fixed"!==d(e).position?e.offsetParent:null}function O(e){for(var n=t(e),i=w(e);i&&x(i)&&"static"===d(i).position;)i=w(i);return i&&("html"===p(i)||"body"===p(i)&&"static"===d(i).position)?n:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&r(e)&&"fixed"===d(e).position)return null;var n=g(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(p(n))<0;){var i=d(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var j="top",E="bottom",D="right",A="left",L="auto",P=[j,E,D,A],M="start",k="end",W="viewport",B="popper",H=P.reduce((function(e,t){return e.concat([t+"-"+M,t+"-"+k])}),[]),T=[].concat(P,[L]).reduce((function(e,t){return e.concat([t,t+"-"+M,t+"-"+k])}),[]),R=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function S(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function V(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function N(e,r){return r===W?V(function(e){var n=t(e),r=u(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,f=0;return o&&(i=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=o.offsetLeft,f=o.offsetTop)),{width:i,height:a,x:s+l(e),y:f}}(e)):n(r)?function(e){var t=f(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(r):V(function(e){var t,n=u(e),r=c(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+l(e),p=-r.scrollTop;return"rtl"===d(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:p}}(u(e)))}function I(e,t,o){var s="clippingParents"===t?function(e){var t=b(g(e)),o=["absolute","fixed"].indexOf(d(e).position)>=0&&r(e)?O(e):e;return n(o)?t.filter((function(e){return n(e)&&q(e,o)&&"body"!==p(e)})):[]}(e):[].concat(t),f=[].concat(s,[o]),c=f[0],u=f.reduce((function(t,n){var r=N(e,n);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),N(e,c));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function _(e){return e.split("-")[1]}function F(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function U(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?C(o):null,a=o?_(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case j:t={x:s,y:n.y-r.height};break;case E:t={x:s,y:n.y+n.height};break;case D:t={x:n.x+n.width,y:f};break;case A:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?F(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case M:t[c]=t[c]-(n[p]/2-r[p]/2);break;case k:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Y(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.boundary,s=void 0===a?"clippingParents":a,c=r.rootBoundary,p=void 0===c?W:c,l=r.elementContext,d=void 0===l?B:l,h=r.altBoundary,m=void 0!==h&&h,v=r.padding,g=void 0===v?0:v,y=z("number"!=typeof g?g:X(g,P)),b=d===B?"reference":B,x=e.rects.popper,w=e.elements[m?b:d],O=I(n(w)?w:w.contextElement||u(e.elements.popper),s,p),A=f(e.elements.reference),L=U({reference:A,element:x,strategy:"absolute",placement:i}),M=V(Object.assign({},x,L)),k=d===B?M:A,H={top:O.top-k.top+y.top,bottom:k.bottom-O.bottom+y.bottom,left:O.left-k.left+y.left,right:k.right-O.right+y.right},T=e.modifiersData.offset;if(d===B&&T){var R=T[i];Object.keys(H).forEach((function(e){var t=[D,E].indexOf(e)>=0?1:-1,n=[j,E].indexOf(e)>=0?"y":"x";H[e]+=R[n]*t}))}return H}var G={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[A,D].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},ie={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return ie[e]}))}var se={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function ce(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?T:f,p=_(r),u=p?s?H:H.filter((function(e){return _(e)===p})):P,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=Y(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[C(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var pe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,g=C(v),y=f||(g===v||!h?[ae(v)]:function(e){if(C(e)===L)return[];var t=ae(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(C(n)===L?ce(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,P=!0,k=b[0],W=0;W=0,S=R?"width":"height",q=Y(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),V=R?T?D:A:T?E:j;x[S]>w[S]&&(V=ae(V));var N=ae(V),I=[];if(i&&I.push(q[H]<=0),s&&I.push(q[V]<=0,q[N]<=0),I.every((function(e){return e}))){k=B,P=!1;break}O.set(B,I)}if(P)for(var F=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},U=h?3:1;U>0;U--){if("break"===F(U))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ue(e,t,n){return i(e,a(t,n))}var le={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,g=n.tetherOffset,y=void 0===g?0:g,b=Y(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=C(t.placement),w=_(t.placement),L=!w,P=F(x),k="x"===P?"y":"x",W=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,q={x:0,y:0};if(W){if(s){var V,N="y"===P?j:A,I="y"===P?E:D,U="y"===P?"height":"width",z=W[P],X=z+b[N],G=z-b[I],J=m?-H[U]/2:0,K=w===M?B[U]:H[U],Q=w===M?-H[U]:-B[U],Z=t.elements.arrow,$=m&&Z?v(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[N],ne=ee[I],re=ue(0,B[U],$[U]),oe=L?B[U]/2-J-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=L?-B[U]/2+J+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&O(t.elements.arrow),se=ae?"y"===P?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(V=null==S?void 0:S[P])?V:0,ce=z+ie-fe,pe=ue(m?a(X,z+oe-fe-se):X,z,m?i(G,ce):G);W[P]=pe,q[P]=pe-z}if(c){var le,de="x"===P?j:A,he="x"===P?E:D,me=W[k],ve="y"===k?"height":"width",ge=me+b[de],ye=me-b[he],be=-1!==[j,A].indexOf(x),xe=null!=(le=null==S?void 0:S[k])?le:0,we=be?ge:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ye,je=m&&be?function(e,t,n){var r=ue(e,t,n);return r>n?n:r}(we,me,Oe):ue(m?we:ge,me,m?Oe:ye);W[k]=je,q[k]=je-me}t.modifiersData[r]=q}},requiresIfExists:["offset"]};var de={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=C(n.placement),f=F(s),c=[A,D].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,P))}(o.padding,n),u=v(i),l="y"===f?j:A,d="y"===f?E:D,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],g=O(i),y=g?"y"===f?g.clientHeight||0:g.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],L=y/2-u[c]/2+b,M=ue(x,L,w),k=f;n.modifiersData[r]=((t={})[k]=M,t.centerOffset=M-L,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function he(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[j,D,E,A].some((function(t){return e[t]>=0}))}var ve={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Y(t,{elementContext:"reference"}),s=Y(t,{altBoundary:!0}),f=he(a,r),c=he(s,o,i),p=me(f),u=me(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},ge=K({defaultModifiers:[Z,$,ne,re]}),ye=[Z,$,ne,re,oe,pe,le,de,ve],be=K({defaultModifiers:ye});e.applyStyles=re,e.arrow=de,e.computeStyles=ne,e.createPopper=be,e.createPopperLite=ge,e.defaultModifiers=ye,e.detectOverflow=Y,e.eventListeners=Z,e.flip=pe,e.hide=ve,e.offset=oe,e.popperGenerator=K,e.popperOffsets=$,e.preventOverflow=le,Object.defineProperty(e,"__esModule",{value:!0})})); 6 | 7 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-search/fuse.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) 3 | * 4 | * Copyright (c) 2022 Kiro Risk (http://kiro.me) 5 | * All Rights Reserved. Apache Software License 2.0 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | */ 9 | var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(C).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),c=parseFloat(Math.round(o*r)/r);return n.set(i,c),c},clear:function(){n.clear()}}}var $=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?I.getFn:n,o=t.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o;r(this,e),this.norm=E(c,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?I.getFn:r,o=n.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o,a=new $({getFn:i,fieldNormWeight:c});return a.setKeys(e.map(_)),a.setSources(t),a.create(),a}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?I.distance:s,h=t.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=r/e.length;if(l)return f;var d=Math.abs(a-o);return u?f+d/u:d?1:f}function N(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var P=32;function W(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?I.location:o,a=i.threshold,s=void 0===a?I.threshold:a,u=i.distance,h=void 0===u?I.distance:u,l=i.includeMatches,f=void 0===l?I.includeMatches:l,d=i.findAllMatches,v=void 0===d?I.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?I.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?I.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?I.ignoreLocation:k;if(r(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:f,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var b=function(e,t){n.chunks.push({pattern:e,alphabet:W(e),startIndex:t})},x=this.pattern.length;if(x>P){for(var w=0,L=x%P,S=x-L;w3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?I.location:i,c=r.distance,a=void 0===c?I.distance:c,s=r.threshold,u=void 0===s?I.threshold:s,h=r.findAllMatches,l=void 0===h?I.findAllMatches:h,f=r.minMatchCharLength,d=void 0===f?I.minMatchCharLength:f,v=r.includeMatches,g=void 0===v?I.includeMatches:v,y=r.ignoreLocation,p=void 0===y?I.ignoreLocation:y;if(t.length>P)throw new Error(w(P));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,L=b,S=d>1||g,_=S?Array(M):[];(m=e.indexOf(t,L))>-1;){var O=R(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(O,x),L=m+k,S)for(var j=0;j=z;q-=1){var B=q-1,J=n[e.charAt(B)];if(S&&(_[B]=+!!J),K[q]=(K[q+1]<<1|1)&J,F&&(K[q]|=(A[q+1]|A[q])<<1|1|A[q+1]),K[q]&$&&(C=R(t,{errors:F,currentLocation:B,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=C,(L=B)<=b)break;z=Math.max(1,2*b-L)}}if(R(t,{errors:F+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p})>x)break;A=K}var U={isMatch:L>=0,score:Math.max(.001,C)};if(S){var V=N(_,d);V.length?g&&(U.indices=V):U.isMatch=!1}return U}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:l}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(f(d),f(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),z=function(){function e(t){r(this,e),this.pattern=t}return o(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return D(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return D(e,this.singleRegex)}}]),e}();function D(e,t){var n=e.match(t);return n?n[1]:null}var K=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),n}(z),q=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),n}(z),B=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),n}(z),J=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),n}(z),U=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),n}(z),V=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),n}(z),G=function(e){a(n,e);var t=l(n);function n(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?I.location:c,s=o.threshold,u=void 0===s?I.threshold:s,h=o.distance,l=void 0===h?I.distance:h,f=o.includeMatches,d=void 0===f?I.includeMatches:f,v=o.findAllMatches,g=void 0===v?I.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?I.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?I.isCaseSensitive:m,M=o.ignoreLocation,b=void 0===M?I.ignoreLocation:M;return r(this,n),(i=t.call(this,e))._bitapSearch=new T(e,{location:a,threshold:u,distance:l,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),i}return o(n,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),n}(z),H=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),n}(z),Q=[K,H,B,J,V,U,q,G],X=Q.length,Y=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Y).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i1&&void 0!==arguments[1]?arguments[1]:{},i=n.isCaseSensitive,o=void 0===i?I.isCaseSensitive:i,c=n.includeMatches,a=void 0===c?I.includeMatches:c,s=n.minMatchCharLength,u=void 0===s?I.minMatchCharLength:s,h=n.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=n.findAllMatches,d=void 0===f?I.findAllMatches:f,v=n.location,g=void 0===v?I.location:v,y=n.threshold,p=void 0===y?I.threshold:y,m=n.distance,k=void 0===m?I.distance:m;r(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:d,ignoreLocation:l,location:g,threshold:p,distance:k},this.pattern=o?t:t.toLowerCase(),this.query=Z(this.pattern,this.options)}return o(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function ve(e,t){t.score=e.score}function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?I.includeMatches:r,o=n.includeScore,c=void 0===o?I.includeScore:o,a=[];return i&&a.push(de),c&&a.push(ve),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}var ye=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;r(this,e),this.options=t(t({},I),i),this.options.useExtendedSearch,this._keyStore=new S(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof $))throw new Error("Incorrect 'index' type");this._myIndex=t||F(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){k(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=g(e)?g(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return fe(h,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),ge(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=re(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(k(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,r=void 0===n||n,i=function e(n){var i=Object.keys(n),o=ue(n);if(!o&&i.length>1&&!se(n))return e(le(n));if(he(n)){var c=o?n[ce]:i[0],a=o?n[ae]:n[c];if(!g(a))throw new Error(x(c));var s={keyId:j(c),pattern:a};return r&&(s.searcher=re(a,t)),s}var u={children:[],operator:i[0]};return i.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return se(e)||(e=le(e)),i(e)}(e,this.options),r=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return a&&a.length?[{idx:i,item:r,matches:a}]:[]}for(var s=[],u=0,h=n.children.length;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?I.getFn:n,i=t.fieldNormWeight,o=void 0===i?I.fieldNormWeight:i,c=e.keys,a=e.records,s=new $({getFn:r,fieldNormWeight:o});return s.setKeys(c),s.setIndexRecords(a),s},ye.config=I,function(){ne.push.apply(ne,arguments)}(te),ye},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/tippy.umd.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||I(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(V(r.arrow))):i.appendChild(V(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),I(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}N.$$tippy=!0;var B=1,H=[],U=[];function _(o,s){var v,g,h,C,T,A,L,k,M=j(o,Object.assign({},R,P(l(s)))),V=!1,I=!1,N=!1,_=!1,F=[],W=a(we,M.interactiveDebounce),X=B++,Y=(k=M.plugins).filter((function(e,t){return k.indexOf(e)===t})),$={id:X,reference:o,popper:d(),popperInstance:null,props:M,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:Y,clearDelayTimeouts:function(){clearTimeout(v),clearTimeout(g),cancelAnimationFrame(h)},setProps:function(e){if($.state.isDestroyed)return;ae("onBeforeUpdate",[$,e]),be();var t=$.props,n=j(o,Object.assign({},t,l(e),{ignoreAttributes:!0}));$.props=n,he(),t.interactiveDebounce!==n.interactiveDebounce&&(ce(),W=a(we,n.interactiveDebounce));t.triggerTarget&&!n.triggerTarget?u(t.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):n.triggerTarget&&o.removeAttribute("aria-expanded");ue(),ie(),J&&J(t,n);$.popperInstance&&(Ce(),Ae().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[$,e])},setContent:function(e){$.setProps({content:e})},show:function(){var e=$.state.isVisible,t=$.state.isDestroyed,o=!$.state.isEnabled,a=x.isTouch&&!$.props.touch,s=r($.props.duration,0,R.duration);if(e||t||o||a)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[$],!1),!1===$.props.onShow($))return;$.state.isVisible=!0,ee()&&(z.style.visibility="visible");ie(),de(),$.state.isMounted||(z.style.transition="none");if(ee()){var u=re(),p=u.box,f=u.content;b([p,f],0)}A=function(){var e;if($.state.isVisible&&!_){if(_=!0,z.offsetHeight,z.style.transition=$.props.moveTransition,ee()&&$.props.animation){var t=re(),n=t.box,r=t.content;b([n,r],s),y([n,r],"visible")}se(),ue(),c(U,$),null==(e=$.popperInstance)||e.forceUpdate(),ae("onMount",[$]),$.props.animation&&ee()&&function(e,t){me(e,t)}(s,(function(){$.state.isShown=!0,ae("onShown",[$])}))}},function(){var e,t=$.props.appendTo,r=te();e=$.props.interactive&&t===n||"parent"===t?r.parentNode:i(t,[r]);e.contains(z)||e.appendChild(z);$.state.isMounted=!0,Ce()}()},hide:function(){var e=!$.state.isVisible,t=$.state.isDestroyed,n=!$.state.isEnabled,o=r($.props.duration,1,R.duration);if(e||t||n)return;if(ae("onHide",[$],!1),!1===$.props.onHide($))return;$.state.isVisible=!1,$.state.isShown=!1,_=!1,V=!1,ee()&&(z.style.visibility="hidden");if(ce(),ve(),ie(!0),ee()){var i=re(),a=i.box,s=i.content;$.props.animation&&(b([a,s],o),y([a,s],"hidden"))}se(),ue(),$.props.animation?ee()&&function(e,t){me(e,(function(){!$.state.isVisible&&z.parentNode&&z.parentNode.contains(z)&&t()}))}(o,$.unmount):$.unmount()},hideWithInteractivity:function(e){ne().addEventListener("mousemove",W),c(H,W),W(e)},enable:function(){$.state.isEnabled=!0},disable:function(){$.hide(),$.state.isEnabled=!1},unmount:function(){$.state.isVisible&&$.hide();if(!$.state.isMounted)return;Te(),Ae().forEach((function(e){e._tippy.unmount()})),z.parentNode&&z.parentNode.removeChild(z);U=U.filter((function(e){return e!==$})),$.state.isMounted=!1,ae("onHidden",[$])},destroy:function(){if($.state.isDestroyed)return;$.clearDelayTimeouts(),$.unmount(),be(),delete o._tippy,$.state.isDestroyed=!0,ae("onDestroy",[$])}};if(!M.render)return $;var q=M.render($),z=q.popper,J=q.onUpdate;z.setAttribute("data-tippy-root",""),z.id="tippy-"+$.id,$.popper=z,o._tippy=$,z._tippy=$;var G=Y.map((function(e){return e.fn($)})),K=o.hasAttribute("aria-expanded");return he(),ue(),ie(),ae("onCreate",[$]),M.showOnCreate&&Le(),z.addEventListener("mouseenter",(function(){$.props.interactive&&$.state.isVisible&&$.clearDelayTimeouts()})),z.addEventListener("mouseleave",(function(){$.props.interactive&&$.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",W)})),$;function Q(){var e=$.props.touch;return Array.isArray(e)?e:[e,0]}function Z(){return"hold"===Q()[0]}function ee(){var e;return!(null==(e=$.props.render)||!e.$$tippy)}function te(){return L||o}function ne(){var e=te().parentNode;return e?w(e):document}function re(){return S(z)}function oe(e){return $.state.isMounted&&!$.state.isVisible||x.isTouch||C&&"focus"===C.type?0:r($.props.delay,e?0:1,R.delay)}function ie(e){void 0===e&&(e=!1),z.style.pointerEvents=$.props.interactive&&!e?"":"none",z.style.zIndex=""+$.props.zIndex}function ae(e,t,n){var r;(void 0===n&&(n=!0),G.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=$.props)[e].apply(r,t)}function se(){var e=$.props.aria;if(e.content){var t="aria-"+e.content,n=z.id;u($.props.triggerTarget||o).forEach((function(e){var r=e.getAttribute(t);if($.state.isVisible)e.setAttribute(t,r?r+" "+n:n);else{var o=r&&r.replace(n,"").trim();o?e.setAttribute(t,o):e.removeAttribute(t)}}))}}function ue(){!K&&$.props.aria.expanded&&u($.props.triggerTarget||o).forEach((function(e){$.props.interactive?e.setAttribute("aria-expanded",$.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function ce(){ne().removeEventListener("mousemove",W),H=H.filter((function(e){return e!==W}))}function pe(e){if(!x.isTouch||!N&&"mousedown"!==e.type){var t=e.composedPath&&e.composedPath()[0]||e.target;if(!$.props.interactive||!O(z,t)){if(u($.props.triggerTarget||o).some((function(e){return O(e,t)}))){if(x.isTouch)return;if($.state.isVisible&&$.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[$,e]);!0===$.props.hideOnClick&&($.clearDelayTimeouts(),$.hide(),I=!0,setTimeout((function(){I=!1})),$.state.isMounted||ve())}}}function fe(){N=!0}function le(){N=!1}function de(){var e=ne();e.addEventListener("mousedown",pe,!0),e.addEventListener("touchend",pe,t),e.addEventListener("touchstart",le,t),e.addEventListener("touchmove",fe,t)}function ve(){var e=ne();e.removeEventListener("mousedown",pe,!0),e.removeEventListener("touchend",pe,t),e.removeEventListener("touchstart",le,t),e.removeEventListener("touchmove",fe,t)}function me(e,t){var n=re().box;function r(e){e.target===n&&(E(n,"remove",r),t())}if(0===e)return t();E(n,"remove",T),E(n,"add",r),T=r}function ge(e,t,n){void 0===n&&(n=!1),u($.props.triggerTarget||o).forEach((function(r){r.addEventListener(e,t,n),F.push({node:r,eventType:e,handler:t,options:n})}))}function he(){var e;Z()&&(ge("touchstart",ye,{passive:!0}),ge("touchend",Ee,{passive:!0})),(e=$.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ge(e,ye),e){case"mouseenter":ge("mouseleave",Ee);break;case"focus":ge(D?"focusout":"blur",Oe);break;case"focusin":ge("focusout",Oe)}}))}function be(){F.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),F=[]}function ye(e){var t,n=!1;if($.state.isEnabled&&!xe(e)&&!I){var r="focus"===(null==(t=C)?void 0:t.type);C=e,L=e.currentTarget,ue(),!$.state.isVisible&&m(e)&&H.forEach((function(t){return t(e)})),"click"===e.type&&($.props.trigger.indexOf("mouseenter")<0||V)&&!1!==$.props.hideOnClick&&$.state.isVisible?n=!0:Le(e),"click"===e.type&&(V=!n),n&&!r&&De(e)}}function we(e){var t=e.target,n=te().contains(t)||z.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=p(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,f="right"===a?s.left.x:0,l="left"===a?s.right.x:0,d=t.top-r+u>i,v=r-t.bottom-c>i,m=t.left-n+f>i,g=n-t.right-l>i;return d||v||m||g}))}(Ae().concat(z).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:M}:null})).filter(Boolean),e)&&(ce(),De(e))}function Ee(e){xe(e)||$.props.trigger.indexOf("click")>=0&&V||($.props.interactive?$.hideWithInteractivity(e):De(e))}function Oe(e){$.props.trigger.indexOf("focusin")<0&&e.target!==te()||$.props.interactive&&e.relatedTarget&&z.contains(e.relatedTarget)||De(e)}function xe(e){return!!x.isTouch&&Z()!==e.type.indexOf("touch")>=0}function Ce(){Te();var t=$.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,u=ee()?S(z).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:o,p=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ee()){var n=re().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];ee()&&u&&p.push({name:"arrow",options:{element:u,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),$.popperInstance=e.createPopper(c,z,Object.assign({},n,{placement:r,onFirstUpdate:A,modifiers:p}))}function Te(){$.popperInstance&&($.popperInstance.destroy(),$.popperInstance=null)}function Ae(){return f(z.querySelectorAll("[data-tippy-root]"))}function Le(e){$.clearDelayTimeouts(),e&&ae("onTrigger",[$,e]),de();var t=oe(!0),n=Q(),r=n[0],o=n[1];x.isTouch&&"hold"===r&&o&&(t=o),t?v=setTimeout((function(){$.show()}),t):$.show()}function De(e){if($.clearDelayTimeouts(),ae("onUntrigger",[$,e]),$.state.isVisible){if(!($.props.trigger.indexOf("mouseenter")>=0&&$.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&V)){var t=oe(!1);t?g=setTimeout((function(){$.state.isVisible&&$.hide()}),t):h=requestAnimationFrame((function(){$.hide()}))}}else ve()}}function F(e,n){void 0===n&&(n={});var r=R.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",T,t),window.addEventListener("blur",L);var o=Object.assign({},n,{plugins:r}),i=h(e).reduce((function(e,t){var n=t&&_(t,o);return n&&e.push(n),e}),[]);return v(e)?i[0]:i}F.defaultProps=R,F.setDefaultProps=function(e){Object.keys(e).forEach((function(t){R[t]=e[t]}))},F.currentInput=x;var W=Object.assign({},e.applyStyles,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),X={mouseover:"mouseenter",focusin:"focus",click:"click"};var Y={name:"animateFill",defaultValue:!1,fn:function(e){var t;if(null==(t=e.props.render)||!t.$$tippy)return{};var n=S(e.popper),r=n.box,o=n.content,i=e.props.animateFill?function(){var e=d();return e.className="tippy-backdrop",y([e],"hidden"),e}():null;return{onCreate:function(){i&&(r.insertBefore(i,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(i){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms",i.style.transitionDuration=e,y([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&y([i],"hidden")}}}};var $={clientX:0,clientY:0},q=[];function z(e){var t=e.clientX,n=e.clientY;$={clientX:t,clientY:n}}var J={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=w(e.props.triggerTarget||t),r=!1,o=!1,i=!0,a=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function u(){n.addEventListener("mousemove",f)}function c(){n.removeEventListener("mousemove",f)}function p(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||t.contains(n.target),o=e.props.followCursor,i=n.clientX,a=n.clientY,s=t.getBoundingClientRect(),u=i-s.left,c=a-s.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=i,r=a;"initial"===o&&(n=e.left+u,r=e.top+c);var s="horizontal"===o?e.top:r,p="vertical"===o?e.right:n,f="horizontal"===o?e.bottom:r,l="vertical"===o?e.left:n;return{width:p-l,height:f-s,top:s,right:p,bottom:f,left:l}}})}function l(){e.props.followCursor&&(q.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",z)}(n))}function d(){0===(q=q.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",z)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,n){var i=n.followCursor;r||void 0!==i&&a.followCursor!==i&&(d(),i?(l(),!e.state.isMounted||o||s()||u()):(c(),p()))},onMount:function(){e.props.followCursor&&!o&&(i&&(f($),i=!1),s()||u())},onTrigger:function(e,t){m(t)&&($={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(p(),c(),i=!0)}}}};var G={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,n=e.reference;var r=-1,o=!1,i=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(o){var a=o.state;e.props.inlinePositioning&&(-1!==i.indexOf(a.placement)&&(i=[]),t!==a.placement&&-1===i.indexOf(a.placement)&&(i.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,n,r){if(n.length<2||null===e)return t;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||t;switch(e){case"top":case"bottom":var o=n[0],i=n[n.length-1],a="top"===e,s=o.top,u=i.bottom,c=a?o.left:i.left,p=a?o.right:i.right;return{top:s,bottom:u,left:c,right:p,width:p-c,height:u-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(e){return e.left}))),l=Math.max.apply(Math,n.map((function(e){return e.right}))),d=n.filter((function(t){return"left"===e?t.left===f:t.right===l})),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return t}}(p(e),n.getBoundingClientRect(),f(n.getClientRects()),r)}(a.placement)}})),t=a.placement)}};function s(){var t;o||(t=function(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),o=!0,e.setProps(t),o=!1)}return{onCreate:s,onAfterUpdate:s,onTrigger:function(t,n){if(m(n)){var o=f(e.reference.getClientRects()),i=o.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY})),a=o.indexOf(i);r=a>-1?a:r}},onHidden:function(){r=-1}}}};var K={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function r(t){return!0===e.props.sticky||e.props.sticky===t}var o=null,i=null;function a(){var s=r("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,u=r("popper")?n.getBoundingClientRect():null;(s&&Q(o,s)||u&&Q(i,u))&&e.popperInstance&&e.popperInstance.update(),o=s,i=u,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function Q(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}return F.setDefaultProps({plugins:[Y,J,G,K],render:N}),F.createSingleton=function(e,t){var n;void 0===t&&(t={});var r,o=e,i=[],a=[],c=t.overrides,p=[],f=!1;function l(){a=o.map((function(e){return u(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function v(){i=o.map((function(e){return e.reference}))}function m(e){o.forEach((function(t){e?t.enable():t.disable()}))}function g(e){return o.map((function(t){var n=t.setProps;return t.setProps=function(o){n(o),t.reference===r&&e.setProps(o)},function(){t.setProps=n}}))}function h(e,t){var n=a.indexOf(t);if(t!==r){r=t;var s=(c||[]).concat("content").reduce((function(e,t){return e[t]=o[n].props[t],e}),{});e.setProps(Object.assign({},s,{getReferenceClientRect:"function"==typeof s.getReferenceClientRect?s.getReferenceClientRect:function(){var e;return null==(e=i[n])?void 0:e.getBoundingClientRect()}}))}}m(!1),v(),l();var b={fn:function(){return{onDestroy:function(){m(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!f&&(f=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!f&&(f=!0,h(e,i[0]))},onTrigger:function(e,t){h(e,t.currentTarget)}}}},y=F(d(),Object.assign({},s(t,["overrides"]),{plugins:[b].concat(t.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(n=t.popperOptions)?void 0:n.modifiers)||[],[W])})})),w=y.show;y.show=function(e){if(w(),!r&&null==e)return h(y,i[0]);if(!r||null!=e){if("number"==typeof e)return i[e]&&h(y,i[e]);if(o.indexOf(e)>=0){var t=e.reference;return h(y,t)}return i.indexOf(e)>=0?h(y,e):void 0}},y.showNext=function(){var e=i[0];if(!r)return y.show(0);var t=i.indexOf(r);y.show(i[t+1]||e)},y.showPrevious=function(){var e=i[i.length-1];if(!r)return y.show(e);var t=i.indexOf(r),n=i[t-1]||e;y.show(n)};var E=y.setProps;return y.setProps=function(e){c=e.overrides||c,E(e)},y.setInstances=function(e){m(!0),p.forEach((function(e){return e()})),o=e,m(!1),v(),l(),p=g(y),y.setProps({triggerTarget:a})},p=g(y),y},F.delegate=function(e,n){var r=[],o=[],i=!1,a=n.target,c=s(n,["target"]),p=Object.assign({},c,{trigger:"manual",touch:!1}),f=Object.assign({touch:R.touch},c,{showOnCreate:!0}),l=F(e,p);function d(e){if(e.target&&!i){var t=e.target.closest(a);if(t){var r=t.getAttribute("data-tippy-trigger")||n.trigger||R.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof f.touch||"touchstart"!==e.type&&r.indexOf(X[e.type])<0)){var s=F(t,f);s&&(o=o.concat(s))}}}}function v(e,t,n,o){void 0===o&&(o=!1),e.addEventListener(t,n,o),r.push({node:e,eventType:t,handler:n,options:o})}return u(l).forEach((function(e){var n=e.destroy,a=e.enable,s=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&o.forEach((function(e){e.destroy()})),o=[],r.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),r=[],n()},e.enable=function(){a(),o.forEach((function(e){return e.enable()})),i=!1},e.disable=function(){s(),o.forEach((function(e){return e.disable()})),i=!0},function(e){var n=e.reference;v(n,"touchstart",d,t),v(n,"mouseover",d),v(n,"focusin",d),v(n,"click",d)}(e)})),l},F.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;U.forEach((function(e){var t=!1;if(n&&(t=g(n)?e.reference===n:e.popper===n.popper),!t){var o=e.props.duration;e.setProps({duration:r}),e.hide(),e.state.isDestroyed||e.setProps({duration:o})}}))},F.roundArrow='',F})); 2 | 3 | -------------------------------------------------------------------------------- /docs/changelog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Cite Tools – changelog 11 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 62 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
81 |
82 | 95 |
96 | 97 |
98 | 99 | 167 |
168 | 169 | 182 | 183 |
184 | 185 | 186 | 187 |
188 |

citetools

189 |
190 |

v1.0.1

191 |

Released 2023-04-02. - Added title-field-emphasis option (default: true).

192 |
193 |
194 |

v1.0.0

195 |

Released 2023-03-18.

196 | 197 | 198 |
199 |
200 | 201 |

Citation

BibTeX citation:
@online{vasconcelos2023,
202 |   author = {Vasconcelos, BCDA},
203 |   date = {2023},
204 |   url = {https://bcdavasconcelos.github.io/citetools/changelog.html},
205 |   langid = {en}
206 | }
207 | 
For attribution, please cite this work as:
208 | Vasconcelos, BCDA. 2023. 2023. https://bcdavasconcelos.github.io/citetools/changelog.html. 209 |
210 | 558 |
559 | 568 | 569 | 570 | 571 | --------------------------------------------------------------------------------