Skip to content

Instantly share code, notes, and snippets.

@kotobuki
Created September 4, 2023 06:49
Show Gist options
  • Save kotobuki/3a958f4b7b2ece5c43c47c613f4008b8 to your computer and use it in GitHub Desktop.
Save kotobuki/3a958f4b7b2ece5c43c47c613f4008b8 to your computer and use it in GitHub Desktop.
citeproc-js test

How I tested

  1. Clone the repository and install required files

    git clone --recursive https://github.com/frianasoa/citeproc-js.git
    git clone https://github.com/kotobuki/citeproc-js-based-replacer.git
    cd citeproc-js-based-replacer
    npm install
    cp ../citeproc-js/citeproc_commonjs.js ./node_modules/citeproc
    cp ../citeproc-js/cp ../citeproc-js/csl-files/*.csl .
    curl -OL https://raw.githubusercontent.com/citation-style-language/locales/6b0cb4689127a69852f48608b6d1a879900f418b/locales-en-US.xml
    curl -OL https://raw.githubusercontent.com/citation-style-language/locales/6b0cb4689127a69852f48608b6d1a879900f418b/locales-ja-JP.xml
  2. Download the content of this git to the same directory

  3. Build the document with pandoc

    pandoc input.md -s --filter pandoc-crossref --filter=./citeproc-js-based-replacer.js -o output.md

What I got

テスト [^1]。

# 参考文献

Morgan, C. & Patrov, A. (2022=2023). 自由意志の哲学 Translated by 鈴木真紀. 東京: 城南大学出版会.

[^1]: (Morgan & Patrov, 2023, p. 42)
[
{
"id": "morgan2023jiyu",
"author": [
{ "family": "Morgan", "given": "Casey" },
{ "family": "Patrov", "given": "Alexei" }
],
"citation-key": "morgan2023jiyu",
"event-place": "東京",
"issued": { "date-parts": [[2023]] },
"language": "ja",
"original-date": { "date-parts": [[2022]] },
"original-publisher": "Global Academic Press",
"original-publisher-place": "Chicago, IL",
"original-title": "The Philosophy of Free Will",
"publisher": "城南大学出版会",
"publisher-place": "東京",
"title": "自由意志の哲学",
"translator": [{ "family": "鈴木", "given": "真紀" }],
"type": "book"
}
]
bibliography csl
bibliography.json
chicago-author-date-aerj-ja.csl

テスト ^[[@morgan2023jiyu [p. 42]]]。

参考文献

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment