Update for bergamot requiring an 'input program' too

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2023-12-22 16:04:33 -08:00
parent 0b8096f973
commit dc9dbe8a0f
2 changed files with 3 additions and 2 deletions

View File

@ -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) <-;

View File

@ -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" }}' }
});
</script>