From dde7df4604eafe62834969557a6727d5992e1356 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 15 Sep 2024 10:33:40 -0700 Subject: [PATCH] Update to new Bergamot version Signed-off-by: Danila Fedorin --- config.toml | 1 + content/blog/00_types_intro.md | 2 +- content/blog/01_types_basics.md | 8 ++-- content/blog/bergamot/index.md | 2 +- layouts/shortcodes/bergamot_js_css.html | 58 ++++++++++++++++++++++++- 5 files changed, 63 insertions(+), 8 deletions(-) diff --git a/config.toml b/config.toml index 791ddf1..97f0967 100644 --- a/config.toml +++ b/config.toml @@ -45,6 +45,7 @@ defaultContentLanguage = 'en' [params] bergamotJsUrl = "https://static.danilafe.com/bergamot/bergamot.js" +bergamotObjectLanguageJsUrl = "https://static.danilafe.com/bergamot/objectlang.js" katexJsUrl = "https://static.danilafe.com/katex/katex.min.js" plausibleAnalyticsDomain = "danilafe.com" githubUsername = "DanilaFe" diff --git a/content/blog/00_types_intro.md b/content/blog/00_types_intro.md index 751e748..d3ee8d4 100644 --- a/content/blog/00_types_intro.md +++ b/content/blog/00_types_intro.md @@ -171,7 +171,7 @@ to the tool than to type theory itself; I will denote these exercises as such wh possible. Also, whenever the context of the exercise can be loaded into Bergamot, I will denote this with a play button. -{{< bergamot_preset name="intro-preset" prompt="PromptConverter @ prompt(type(?term, ?t)) <- input(?term);" >}} +{{< bergamot_preset name="intro-preset" prompt="type(TERM, ?t)" >}} TNumber @ type(lit(?n), number) <- num(?n); TPlusI @ type(plus(?e_1, ?e_2), number) <- type(?e_1, number), type(?e_2, number); diff --git a/content/blog/01_types_basics.md b/content/blog/01_types_basics.md index a0738fe..7c6aa75 100644 --- a/content/blog/01_types_basics.md +++ b/content/blog/01_types_basics.md @@ -114,7 +114,7 @@ Another consequence of this is that not everyone agrees on notation; according to [this paper](https://labs.oracle.com/pls/apex/f?p=LABS:0::APPLICATION_PROCESS%3DGETDOC_INLINE:::DOC_ID:959), 27 different ways of writing down substitutions were observed in the POPL conference alone. -{{< bergamot_preset name="notation-preset" prompt="PromptConverter @ prompt(type(?term, ?t)) <- input(?term);" >}} +{{< bergamot_preset name="notation-preset" prompt="type(TERM, ?t)" >}} TNumber @ type(lit(?n), number) <- num(?n); {{< /bergamot_preset >}} @@ -317,7 +317,7 @@ This rule is read as follows: > If \(e_1\) and \(e_2\) have type \(\text{string}\), then \(e_1+e_2\) has type \(\text{string}\). -{{< bergamot_preset name="string-preset" prompt="PromptConverter @ prompt(type(?term, ?t)) <- input(?term);" query="\"hello\"+\"world\"">}} +{{< bergamot_preset name="string-preset" prompt="type(TERM, ?t)" query="\"hello\"+\"world\"">}} TNumber @ type(lit(?n), number) <- num(?n); TPlusI @ type(plus(?e_1, ?e_2), number) <- type(?e_1, number), type(?e_2, number); @@ -384,7 +384,7 @@ from the conversion rules. Chapter 15 of _Types and Programming Languages_ by Benjamin Pierce is a nice explanation, but the [Wikipedia page](https://en.wikipedia.org/wiki/Subtyping) ain't bad, either. -{{< bergamot_preset name="conversion-preset" prompt="PromptConverter @ prompt(type(?term, ?t)) <- input(?term);" >}} +{{< bergamot_preset name="conversion-preset" prompt="type(TERM, ?t)" >}} section "Conversion rules" { ConvertsIS @ converts(integer, string) <-; ConvertsIF @ converts(integer, float) <-; @@ -564,7 +564,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" query="" prompt="PromptConverter @ prompt(type(?term, ?t)) <- input(?term);" >}} +{{< bergamot_widget id="widget" query="" prompt="type(TERM, ?t)" >}} section "" { TNumber @ type(lit(?n), number) <- num(?n); TString @ type(lit(?s), string) <- str(?s); diff --git a/content/blog/bergamot/index.md b/content/blog/bergamot/index.md index 47215f6..fa0b1a4 100644 --- a/content/blog/bergamot/index.md +++ b/content/blog/bergamot/index.md @@ -261,7 +261,7 @@ It has two modes: `type(empty, ?e, tpair(number, string))` to search for expressions that have the type "a pair of a number and a string". -{{< bergamot_widget id="widget" query="" prompt="PromptConverter @ prompt(type(empty, ?term, ?t)) <- input(?term);" >}} +{{< bergamot_widget id="widget" query="" prompt="type(empty, TERM, ?t)" >}} section "" { TNumber @ type(?Gamma, lit(?n), number) <- num(?n); TString @ type(?Gamma, lit(?s), string) <- str(?s); diff --git a/layouts/shortcodes/bergamot_js_css.html b/layouts/shortcodes/bergamot_js_css.html index 0e9127d..affd6c8 100644 --- a/layouts/shortcodes/bergamot_js_css.html +++ b/layouts/shortcodes/bergamot_js_css.html @@ -1,4 +1,5 @@ + {{ $style := resources.Get "scss/bergamot.scss" | resources.ToCSS | resources.Minify }}