Support autocomplete of citations and cross-references
A user would like to insert citations similar to that of PandocCiter:
Broadly, it is possible to support bibliographic references. Here's what it would entail:
- Decide on the syntax for citations.
- Create a general-purpose context menu that can suggest spelling fixes, grammar fixes, bibliography entries, cross-references, etc.
- Use events to populate the context menu, which could include complete tear-down to support autocomplete
- Point to a bibliography database in the workspace
- Load the bibliography using JBibTeX.
The context menu could be populated by:
-
[@bib:
-- bibliographic references -
[@fig:
-- figure references -
[@eq:
-- equation references -
[@alg:
-- equation references
The references must be dynamic within the document. That is, the user could define a reference such as {#図版:...}
. When the user starts to type [@図版:
, the context menu displays a short list of matches, filtering as the user continues to type.
Additionally, for cross-references and citations, a window shows the context for the selected item. The window contains additional information about the active menu item in the context menu. For tables, the table description is shown. For figures, the figure title (or alt text). For bibliographies, various database fields.
Additional details
See the proposed change to the CommonMark specification for ideas on syntax.