From dc9dbe8a0f6f0a34d83ddc85c138481510f1c6ca Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 22 Dec 2023 16:04:33 -0800 Subject: [PATCH] Update for bergamot requiring an 'input program' too Signed-off-by: Danila Fedorin --- content/blog/01_types_basics.md | 2 +- layouts/shortcodes/bergamot_widget.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/content/blog/01_types_basics.md b/content/blog/01_types_basics.md index bf42207..17119b8 100644 --- a/content/blog/01_types_basics.md +++ b/content/blog/01_types_basics.md @@ -441,7 +441,7 @@ and already be up-to-speed on a big chunk of the content. | {{< latex >}}\frac{e_1 : \text{number}\quad e_2 : \text{number}}{e_1+e_2 : \text{number}} {{< /latex >}}| Adding numbers gives a number | #### Playground -{{< bergamot_widget id="widget-one" query="" >}} +{{< bergamot_widget id="widget-one" query="" prompt="PromptConverter @ prompt(type(empty, ?term, ?t)) <- input(?term);" >}} section "" { TNumber @ type(?Gamma, intlit(?n), number) <-; TString @ type(?Gamma, strlit(?s), string) <-; diff --git a/layouts/shortcodes/bergamot_widget.html b/layouts/shortcodes/bergamot_widget.html index eb130e5..087805c 100644 --- a/layouts/shortcodes/bergamot_widget.html +++ b/layouts/shortcodes/bergamot_widget.html @@ -35,8 +35,9 @@ LatexSym @ latex(?s, ?l) <- sym(?s), tostring(?s, ?l_1), join(["\\\\text{", ?l_1,"}"], ?l); LatexCall @ latex(?c, ?l) <- call(?c, ?n, ?ts), nonempty(?ts), latexlist(?ts, ?lts_1), intercalate(", ", ?lts_1, ?lts_2), join(?lts_2, ?lts_3), join(["\\\\text{", ?n, "}", "(", ?lts_3, ")"], ?l); `; + const inputRules = `{{ .Get "prompt" }}`; var app = Elm.Main.init({ node: document.getElementById('{{ .Get "id" }}'), - flags: { renderRules, rules: '{{- strings.Trim .Inner " \\n" -}}', query: '{{ .Get "query" }}' } + flags: { renderRules, inputRules, rules: '{{- strings.Trim .Inner " \\n" -}}', query: '{{ .Get "query" }}' } });