Skip to content

Commit 5dd8503

Browse files
committed
doesn't work yet because of Lean core bug
1 parent 9dcaa53 commit 5dd8503

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,13 +418,29 @@ open scoped Bundle Manifold ContDiff
418418

419419
open Lean Meta Elab Tactic
420420

421+
open Doc
422+
@[doc_command] def foobar (n : Ident) : DocM <| Block ElabInline ElabBlock := do
423+
let doc ← realizeGlobalConstNoOverloadWithInfo n
424+
let some docStr ← findDocString? (← getEnv) doc
425+
| throwError "No doc-string for `{.ofConstName doc}`"
426+
-- Future: once there is a better auto-converter between markdown and verso doc-strings,
427+
-- rewrite this code accordingly!
428+
-- Perhaps, it could be nice to write .verso here.
429+
return .para #[.text docStr]
430+
431+
set_option doc.verso true in
432+
set_option doc.verso.suggestions false in
421433
/-- `d% f x` (scoped to the `Manifold` namespace) elaborates to `mvfderiv I J f x`,
422-
trying to determine `I` and `J` from the local context. -/
434+
trying to determine `I` and `J` from the local context.
435+
436+
{foobar} -/
437+
-- goal: now insert the doc-string of mvfderiv
423438
scoped elab:max "d%" ppSpace t:term:arg : term => do
424439
let e ← ensureIsFunction <| ← Term.elabTerm t none
425440
let (srcI, _tgtI) ← findModels e none
426441
mkAppM ``mvfderiv #[srcI, e]
427442

443+
#exit
428444
open Bundle PrettyPrinter Delaborator SubExpr
429445

430446
/-- Delaborator for `mvfderiv`. -/

0 commit comments

Comments
 (0)