Lua API to list the references of a document, like pandoc.utils.references

オープン
#1,407 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
54/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
lua, rust
領域
api, backend

調査の方向性

Start by reading crates/pampa/src/lua/utils.rs, where the issue says Lua utilities are registered, and trace how q2's citeproc reads document references. The goal is a Lua-accessible function returning those same references with at least their id; verify that a filter can distinguish reference IDs from other @ syntax. The issue does not name tests, so find the relevant Lua API or citation tests before implementing.

索引モデルが issue の本文から書いたものです。

説明

Description

Quarto 1 filters can call pandoc.utils.references(doc) to get the references that a document defines, from its references metadata and its bibliography files.
q2 resolves citations in its own citeproc, but no Lua function gives that list: pandoc.utils.references is nil in q2 0.48.0-nightly.20261126, and crates/pampa/src/lua/utils.rs does not register it.

Filters use this list to tell a real citation from other @ syntax.
For example, quarto-gitlink turns @user into a link to a GitHub profile, but leaves @key alone when key is a reference id.
Without the list, a filter cannot know which Cite elements q2 will resolve.
It has to keep every citation as is, or risk turning a reference into a user link.

function Pandoc(doc)
  -- Quarto 1: a list of references with an `id` field.
  -- q2: attempt to call a nil value (field 'references').
  for _, ref in ipairs(pandoc.utils.references(doc)) do
    quarto.log.output(ref.id)
  end
end

It would help to have pandoc.utils.references, or a function in the quarto namespace, that returns the same references q2's citeproc reads, with at least their id.
Parsing the bibliography files from Lua is the only alternative, and that means support for BibTeX, CSL JSON and CSL YAML in each filter.

Related: https://github.com/quarto-dev/q2/discussions/1112

主要言語
Rust
スター
316
フォーク
23
平均マージ
11時間 49分
マージ済み PR(30日)
245

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/q2 のほかの issue

quarto-dev/q2 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。