@@ -418,13 +418,29 @@ open scoped Bundle Manifold ContDiff
418418
419419open 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
423438scoped 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
428444open Bundle PrettyPrinter Delaborator SubExpr
429445
430446/-- Delaborator for `mvfderiv`. -/
0 commit comments