Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 3.47 KB

README.md

File metadata and controls

81 lines (54 loc) · 3.47 KB

citeproc-js-based-replacer

About this tool

citeproc-js-based-replacer is a tool for generating CSL-M compatible citations using the citeproc-js library. This tool replaces citation keys (@key) in Markdown files and adds a bibliography if a header with the text "Bibliography" or "参考文献" is present.

Features

  • Replaces citation keys (@key) in Markdown files
  • Adds a bibliography if a "Bibliography" or "参考文献" header is present
  • Specifies bibliography file, CSL file, and uncited items to include in the bibliography in the YAML header of the Markdown file

Preparation

Steps

  1. Run npm install to install the required libraries
  2. Obtain the desired CSL-M file from sources like jm-styles
  3. Obtain the necessary locale file(s) (e.g., locales-en-US.xml) from citation-style-language / locales
  4. Generate a bibliography with Jurism or Zotero

Example file layout

  • citeproc-js-based-replacer.js
  • jm-japan-sociological-society.csl
  • locales-en-US.xml
  • locales-ja-JP.xml
  • bibliography.json
  • input.md
  • node_modules/

Usage

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

Development

This project is in its early stages, and we welcome feedback and bug reports. Pull requests are highly appreciated!


本ツールについて

citeproc-js-based-replacerは、citeproc-jsライブラリを使用してCSL-M対応の文献引用を生成するためのツールです。このツールは、Markdownファイル内の引用キー(@key)を置き換え、"参考文献"または"Bibliography"というヘッダーがある場合に文献目録を追加します。

機能

  • Markdownファイル内の引用キー(@key)を置き換えます
  • "参考文献"または"Bibliography"というヘッダーがある場合に文献目録を追加します
  • MarkdownファイルのYAMLヘッダー部分で、bibliographyファイル、CSLファイル、引用しないが参考文献に含めたい文献の指定を行います

準備

手順

  1. npm installを実行して必要なライブラリをインストールする
  2. jm-styles などから、使用したいCSL-Mファイルを入手する
  3. citation-style-language / locales から必要なlocaleファイル(例:locales-en-US.xml)を入手する
  4. JurismZoteroによりJSON形式のbibliographyを生成する

ファイルの配置例

  • citeproc-js-based-replacer.js
  • jm-japan-sociological-society.csl
  • locales-en-US.xml
  • locales-ja-JP.xml
  • bibliography.json
  • input.md
  • node_modules/

使い方

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

開発

このプロジェクトはまだ開発が始まったばかりであり、要望や不具合に関するレポートを歓迎します。とくに、プルリクエストは大歓迎です!