leanprover / leanprover/verso

lean code block and `variable` command

Open
#145 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
384
Forks
124
Avg merge
22h 28m
Merged PRs (30d)
10

Description

Code block ```lean ... ``` and inline {lean}`...` does not see identifiers introduced by variable command.

For inline code, I'm suspecting that Elab.Term.elabTerm stx none is missing some version of runTermElabM.
I'm expecting that this should work

      discard <| Lean.Elab.Command.runTermElabM (fun _ => Elab.Term.elabTerm stx none)

but there is no lift from CommandElabM to DocElabM

mwe where import DemoTextbook.Exts.Exercises should probably be replaces with import Manual.Meta:

import Verso.Genre.Manual
import DemoTextbook.Exts.Exercises
open Verso.Genre Manual

open DemoTextbook.Exts (lean)

variable (X : Type)

#doc (Manual) "Test" =>

Array {lean}`Array X`

```lean
#check X
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MWE in the issue and inspect Manual/Meta.lean, especially Elab.Term.elabTerm and the surrounding DocElabM handling. Compare the inline and ```lean code-block paths with Lean.Elab.Command.runTermElabM. Done means both forms can resolve identifiers introduced by variable, including X in the example.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.