@lincyaw/slidev-addon-code
v1.0.0-rc.0
Published
Presmium plugin: code references into a git repository: region and syntax anchors, locked commits, links, drift checks and step highlights
Readme
@lincyaw/slidev-addon-code
Code references into a git repository: region, symbol and pattern anchors, pinned commits with permanent links, drift checks and step-by-step highlights.
Part of Presmium, which turns lectures written in MyST Markdown into web pages, slides, Jupyter notebooks and narrated lectures.
Install
pnpm add -D @lincyaw/slidev-addon-codeList it in the headmatter of the documents that use it:
plugins:
- '@lincyaw/slidev-addon-code'It is a Presmium plugin and a Slidev addon: its components work on the web page and in the slides. It needs @lincyaw/cli and the renderers in the same project, and declares the Presmium packages it shares with them as peer dependencies (Presmium 1.x).
What it provides
{code-ref}: quote code byregion:<file>#<name>,symbol:<file>#<Class.method>orpattern:<file>#<ast-grep pattern>, with:pin:,:steps:,:variants:and:run:.presmium checkreports moved, ambiguous and lost anchors and drift since the pinned commit;presmium check --update-lockrewrites.presmium/anchors.lock.json.
Configuration
presmium.code.repo: the repository URL of permanent links (per section with {config}).
Documentation
- Author guide (Chinese:
site/guide/lecture.md) - Directive reference (Chinese): every directive with its options and an example
License
Apache-2.0
