Skip to content

Commit fd82aa8

Browse files
authored
Merge pull request #420 from jamiepratt/codex/article-controls-and-v2-explainers
Add source-owned article controls and v2 validation explainers
2 parents e98bd39 + 4e79049 commit fd82aa8

16 files changed

Lines changed: 2776 additions & 615 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ _site/
4141
!/site/_quarto.yml
4242
!/site/_extensions/
4343
!/site/_extensions/**
44+
!/site/language_learning/
45+
!/site/language_learning/vocabulary_estimation/
46+
/site/language_learning/vocabulary_estimation/*
47+
!/site/language_learning/vocabulary_estimation/_metadata.yml
4448

4549
# Janqua nREPL lifecycle files (created in the Quarto rendering directory)
4650
.jank-pid

resources/language_learning/vocabulary_estimation/article_controls.css

Lines changed: 215 additions & 0 deletions
Large diffs are not rendered by default.

resources/language_learning/vocabulary_estimation/math_explanations.js

Lines changed: 0 additions & 350 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
format:
2+
html:
3+
include-after-body:
4+
- ../../zulip_script.html
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
(ns language-learning.vocabulary-estimation.article-controls
2+
(:require [clojure.java.io :as io]
3+
[scicloj.kindly.v4.kind :as kind]))
4+
5+
(defn- resource-text [filename]
6+
(slurp
7+
(io/resource
8+
(str "language_learning/vocabulary_estimation/" filename))))
9+
10+
(defn- toolbar []
11+
[:div.article-explanations-toolbar
12+
{:role "region" :aria-labelledby "article-explanations-heading"}
13+
[:p
14+
[:strong#article-explanations-heading "Reading controls"]
15+
[:span#article-explanations-description.article-explanations-description
16+
"Open or close help, code, and equations. Choices for code and equations apply across this article namespace."]
17+
[:span#article-explanations-status.article-explanations-status
18+
{:aria-live "polite"}
19+
"Help is hidden."]]
20+
[:div#article-help-action.article-reading-action
21+
[:button#article-explanations-toggle.article-explanations-toggle
22+
{:type "button"
23+
:aria-pressed "false"
24+
:aria-describedby "article-explanations-description article-explanations-status"}
25+
"Show all help"]]
26+
[:div#article-code-action.article-reading-action
27+
[:button#article-code-toggle.article-code-toggle
28+
{:type "button"
29+
:aria-pressed "false"
30+
:aria-describedby "article-explanations-description article-code-status"}
31+
"Show all code"]
32+
[:span#article-code-status.article-code-status
33+
{:aria-live "polite"}
34+
"Code is hidden."]]
35+
[:div#article-equations-action.article-reading-action
36+
[:button#article-equations-toggle.article-equations-toggle
37+
{:type "button"
38+
:aria-pressed "true"
39+
:aria-describedby "article-explanations-description article-equations-status"}
40+
"Hide all equations"]
41+
[:span#article-equations-status.article-equations-status
42+
{:aria-live "polite"}
43+
"Equations are shown."]]])
44+
45+
(defn install
46+
"Install the controls stylesheet, explicit toolbar, and Scittle runtime."
47+
[]
48+
(kind/hiccup
49+
[:div.article-controls-installation
50+
[:style (resource-text "article_controls.css")]
51+
(toolbar)
52+
[:script {:type "application/x-scittle"
53+
:src "article_controls.cljs"}]]))

0 commit comments

Comments
 (0)