- );
-}
-
-export default DoenetInternal;
diff --git a/packages/docs-nextra/components/doenetml-example.tsx b/packages/docs-nextra/components/doenetml-example.tsx
deleted file mode 100644
index 4985f4061..000000000
--- a/packages/docs-nextra/components/doenetml-example.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import React from "react";
-import { IframeDoenetML } from "./iframe-doenetml";
-import { Tabs } from "nextra/components";
-
-/**
- * Render DoenetML as an example in documentation.
- */
-export function DoenetMLExample({ children }: React.PropsWithChildren<{}>) {
- if (typeof children !== "string") {
- console.error(
- "Error with DoenetML component. Expected a string child containing DoenetML source code, but found",
- children,
- );
- return (
-
- Error with DoenetML component. Expected a string child
- containing DoenetML source code, but found {typeof children}.
- Check the console for details
-
- );
-}
diff --git a/packages/docs-nextra/components/iframe-doenetml.tsx b/packages/docs-nextra/components/iframe-doenetml.tsx
deleted file mode 100644
index 7677965fc..000000000
--- a/packages/docs-nextra/components/iframe-doenetml.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import React from "react";
-import { DoenetViewer } from "@doenet/doenetml-iframe";
-import "@doenet/virtual-keyboard/style.css";
-
-/**
- * Render DoenetML in an iframe so that its styling/state is completely isolated from the page.
- */
-export function IframeDoenetML({ children }: React.PropsWithChildren<{}>) {
- if (typeof children !== "string") {
- console.error(
- "Error with DoenetML component. Expected a string child containing DoenetML source code, but found",
- children,
- );
- return (
-
- Error with DoenetML component. Expected a string child
- containing DoenetML source code, but found {typeof children}.
- Check the console for details
-
- );
- }
- return ;
-}
diff --git a/packages/docs-nextra/components/index.ts b/packages/docs-nextra/components/index.ts
index b9c1ce464..cfcddad52 100644
--- a/packages/docs-nextra/components/index.ts
+++ b/packages/docs-nextra/components/index.ts
@@ -1,2 +1,3 @@
-export * from "./doenetml-example";
+export * from "./doenet-example";
export * from "./props-display";
+export * from "./doenet";
diff --git a/packages/docs-nextra/next.config.mjs b/packages/docs-nextra/next.config.mjs
index 76671ee12..1c8b2108e 100644
--- a/packages/docs-nextra/next.config.mjs
+++ b/packages/docs-nextra/next.config.mjs
@@ -1,5 +1,11 @@
import nextraConfig from "nextra";
-import { autoInsertAttrPropDescriptions } from "./dist/index.js";
+import {
+ autoInsertAttrPropDescriptions,
+ wrapDoenetExample,
+ wrapDoenetEditor,
+ wrapDoenetEditorHorizontal,
+ wrapDoenetViewer,
+} from "./dist/index.js";
import { getHighlighter, bundledLanguages, bundledThemes } from "shiki";
import fs from "node:fs";
@@ -58,7 +64,13 @@ const withNextra = nextraConfig({
return await highlighter;
},
},
- remarkPlugins: [autoInsertAttrPropDescriptions],
+ remarkPlugins: [
+ autoInsertAttrPropDescriptions,
+ wrapDoenetExample,
+ wrapDoenetEditor,
+ wrapDoenetEditorHorizontal,
+ wrapDoenetViewer,
+ ],
rehypePlugins: [
/**
* Add any data in `extraSearchData` to `structurizedData` so that it shows up in the search box.
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/abs.mdx b/packages/docs-nextra/pages/reference/doenetML_components/abs.mdx
index f8840be15..76f572011 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/abs.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/abs.mdx
@@ -1,4 +1,4 @@
-import { DoenetML} from "../../../components/doenet"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
# ``
@@ -18,7 +18,7 @@ The `` component has no attibutes or properties.
### Example: Render the absolute value of a math expression
-```html
+```doenet
|5 - 8| = 5 - 8
```
The `` component is used to render the absolute value of a math expression. Test code [here](https://www.doenet.org/portfolioeditor/_J1J2N530LyIvVWx64xB8V/_AgzWwqGV6Yy9DfqMyGlFm).
@@ -26,7 +26,7 @@ The `` component is used to render the absolute value of a math expression.
### Example: Absolute value of ``
-```html
+```doenet
Type any number:
|$userN| = $userN
```
@@ -34,7 +34,7 @@ The `` component is used to render the absolute value of a named `
### Example: Absolute value of numerical properties
-```html {5}
+```doenet {5}
Move the point in the third quadrant.
(-5,-5)
@@ -47,7 +47,7 @@ Children of the `` component can include references to `` values
### Example: Absolute value of a function
-```html {4}
+```doenet {4}
(1/4)x^2 - 4
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/alert.mdx b/packages/docs-nextra/pages/reference/doenetML_components/alert.mdx
index 18ff90417..d7a018266 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/alert.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/alert.mdx
@@ -1,4 +1,4 @@
-import { DoenetML} from "../../../components/doenet"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
# ``
@@ -10,14 +10,11 @@ The `` component has no attributes or properties.
### Example: Basic use
-```html
+```doenet
Take the right turn.
```
### Test Code
-
-{`
-
-
-`}
-
\ No newline at end of file
+```doenet-editor
+
+```
\ No newline at end of file
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/and.mdx b/packages/docs-nextra/pages/reference/doenetML_components/and.mdx
index 8bf372e83..311cf6d65 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/and.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/and.mdx
@@ -1,4 +1,4 @@
-import { DoenetML} from "../../../components/doenet"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
# ``
@@ -15,7 +15,7 @@ The `` component has no attributes or properties.
### Example: `` in a ``
-```html {10}
+```doenet {10}
Enter a number between 5 and 10, excluding 7:
@@ -33,7 +33,7 @@ The `` component functions as the boolean operator `and` or `&`, and checks
### Example: `` in an ``
-```html {18}
+```doenet {18}
Move the point to the intersection of the circle and the line in the
first quadrant. (Scroll down to check work.)
@@ -69,7 +69,7 @@ An `` component is used to construct a compound boolean from three referenc
### Example: An alternative to ``
-```html {9}
+```doenet {9}
Enter a number between 5 and 10, excluding 7:
@@ -85,9 +85,6 @@ The word `and` may be typed directly within any component that takes a boolean e
### Test Code
-
-{`
-
-
-`}
-
\ No newline at end of file
+```doenet-editor
+
+```
\ No newline at end of file
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/angle.mdx b/packages/docs-nextra/pages/reference/doenetML_components/angle.mdx
index b1e8f2466..01ae5de29 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/angle.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/angle.mdx
@@ -1,4 +1,4 @@
-import { DoenetML} from "../../../components/doenet"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
import { AttrDisplay, PropDisplay } from "../../../components"
# `{:dn}`
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/animateFromSequence.mdx b/packages/docs-nextra/pages/reference/doenetML_components/animateFromSequence.mdx
index 83895aa6d..1fcb76035 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/animateFromSequence.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/animateFromSequence.mdx
@@ -1,7 +1,6 @@
-import { DoenetML} from "../../../components/doenet"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
-
-{`
+```doenet-viewer
animateFromSequence
@@ -344,5 +343,4 @@ n = 0
-`}
-
+```
\ No newline at end of file
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/answer.mdx b/packages/docs-nextra/pages/reference/doenetML_components/answer.mdx
index f4df42996..18a0b1d68 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/answer.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/answer.mdx
@@ -1,4 +1,4 @@
-import { DoenetML} from "../../../components/doenet"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
# ``
@@ -8,13 +8,10 @@ import { DoenetML} from "../../../components/doenet"
## Basic usage examples
### Example:
-
-{`
-
+```doenet-editor
-`}
-
+```
+
brief expo.
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/boolean.mdx b/packages/docs-nextra/pages/reference/doenetML_components/boolean.mdx
index 98c1cdaf1..5e2b83b98 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/boolean.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/boolean.mdx
@@ -1,4 +1,4 @@
-import { DoenetMLExample } from "../../../components"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
# ``
@@ -9,24 +9,18 @@ The `` component renders the boolean value of `true` or `false` of the
### Example: Check if an equation is `true` or `false`
-
-{`
-
+```doenet-editor
The following equation is 1 + 1 = $input.
1 + 1 =
-
-`}
-
+```
A `` component is used to render whether an equation is `true` or `false` for a user-supplied response.
### Example: Boolean value of a geometric property
-
-{`
-
+```doenet-editor
The slope of the line is greater than or equal to 1:$line1.slope >= 1
@@ -34,9 +28,7 @@ A `` component is used to render whether an equation is `true` or `fals
(-4,-4)
-
-`}
-
+```
A `` component is used to render whether a statement regarding the geometric slope of a named `` is `true` or `false`. Drag the point to adjust the slope of the line which in turn will affect the value of the ``.
@@ -44,9 +36,7 @@ A `` component is used to render whether a statement regarding the geom
### Example: Constructing compound booleans
-
-{`
-
+```doenet-editor
Enter a number that is less than 100, greater than 20, and divisible by 3.
@@ -58,9 +48,7 @@ A `` component is used to render whether a statement regarding the geom
$userNumber could be the number...
$lessThan100 and $greaterThan20 and $divisibleBy3
!
-
-`}
-
+```
References to `boolean` components can be combined with logical operators to create more complex boolean expressions.
@@ -83,15 +71,11 @@ References to `boolean` components can be combined with logical operators to cre
### Example: `symbolicEquality` attribute
-
-{`
-
+```doenet-editor
Enter x^2 + 2x + 1 exactly:
$mi = x^2 + 2x + 1
Now, enter (x + 1)^2 instead...
-
-`}
-
+```
Comparing two values with the `symbolicEquality` attribute
switches the default comparison method to one which demands exact syntactical equality. Without this attribute, a value of `true` would be returned both for `x^2 + 2x + 1` as well as `(x + 1)^2`.
@@ -99,14 +83,10 @@ switches the default comparison method to one which demands exact syntactical eq
### Example: `expandOnCompare` attribute
-
-{`
-
+```doenet-editor
Enter (x + 1)^2:
$mi = x^2 + 2x + 1
-
-`}
-
+```
Comparing two values with the `expandOnCompare` and
`symbolicEquality` attributes allows expressions that are
@@ -115,15 +95,11 @@ equivalent after expanding to evaluate to `true`. It is a partial relaxation of
### Example: `simplifyOnCompare` attribute
-
-{`
-
+```doenet-editor
Enter x*x + x + x + 1:
$mi = x^2 + 2x + 1
-
-`}
-
+```
Comparing two values with the `simplifyOnCompare` and
`symbolicEquality` attributes allows expressions that are
@@ -131,51 +107,39 @@ equivalent after simplifying to evaluate to `true`. It is a partial relaxation o
### Example: `unorderedCompare` attribute
-
-{`
-
+```doenet-editor
Enter 1,2,3,4,5 in that exact order:
$mi = 1 2 3 4 5
Enter 1,2,3,4,5 in mixed-up order:
$mi2 = 1 2 3 4 5
-
-`}
-
+```
When multiple values are compared within a single ``tag, the default behavior is to match the order of the listed values. If order is irrelevant, use the `unorderedCompare` attribute.
### Example: `matchByExactPositions` attribute
-
-{`
-
+```doenet-editor
Enter 1,2,3 in that exact order:
, ,
($mi1, $mi2, $mi3) = (1, 2, 3)
Now, observe what happens when you switch the order
-
-`}
-
+```
When multiple responses are evaluated by comparison with a vector of correct values inside a ``, the `matchByExactPositions` attribute enforces a strict order onto the validation. Only correct values in the correct answer blanks will allow the `` to evaluate to `true`.
### Example: `allowedErrorInNumbers` and `allowedErrorIsAbsolute` attributes
-
-{`
-
+```doenet-editor
Enter a number within 10\% of 100:
$mi1 = 100
Enter a number within 0.1 of 100:
$mi2 = 100
-
-`}
-
+```
The `allowedErrorInNumbers` attribute may be used to specify the acceptable error of an approximate response when comparing numerical values. By default, the error is specified as a fractional value.
@@ -184,17 +148,13 @@ To specify an allowed error with a specific numerical value (rather than as a fr
### Example: `caseInsensitiveMatch` attribute
-
-{`
-
+```doenet-editor
Enter tTkLp:
tTkLp = $ti1
Enter tTkLp with any capitalization:
tTkLp = $ti2
-
-`}
-
+```
Use the `caseInsensitiveMatch` attribute if capitalization
is not relevant for comparison.
@@ -202,18 +162,14 @@ is not relevant for comparison.
### Example: `matchBlanks` attribute
-
-{`
-
+```doenet-editor
Compare two expressions with blanks
=
$mi = /x
Comparing without the matchBlanks attribute:
$mi = /x
-
-`}
-
+```
Use the `matchBlanks` attribute to accurately compare two expressions containing blanks.
@@ -228,39 +184,29 @@ Use the `matchBlanks` attribute to accurately compare two expressions containing
### Example: `text` property
-
-{`
-
+```doenet-editor
Enter "1" for true, not "1" for false:
1 = $mi
text = $bool.text
-
-`}
-
+```
The `text` property of a named `` returns the
value of "true" or "false" as a string.
### Example: `value` property
-
-{`
-
+```doenet-editor
Enter "1" for true, not "1" for false:
1 = $mi
value = $bool.value
-
-`}
-
+```
The `value` property of a named `` returns its
value of `true` or `false`.
### Example: Attributes as properties
-
-{`
-
+```doenet-editor
=
@@ -273,9 +219,7 @@ value of `true` or `false`.
-
-`}
-
+```
All attributes of a `` are also available
as properties.
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/componentIndex.mdx b/packages/docs-nextra/pages/reference/doenetML_components/componentIndex.mdx
index 4285d6de1..3c4550ca3 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/componentIndex.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/componentIndex.mdx
@@ -1,4 +1,4 @@
-import { DoenetML} from "../../../components/doenet"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
# Alphabetical Component Index
diff --git a/packages/docs-nextra/pages/reference/doenetML_components/mathInput.mdx b/packages/docs-nextra/pages/reference/doenetML_components/mathInput.mdx
index 168af5292..d92f77004 100644
--- a/packages/docs-nextra/pages/reference/doenetML_components/mathInput.mdx
+++ b/packages/docs-nextra/pages/reference/doenetML_components/mathInput.mdx
@@ -1,4 +1,4 @@
-import { DoenetML} from "../../../components/doenet"
+import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components"
# ``
@@ -41,7 +41,7 @@ In addition, a `` cannot function if nested within any [Display Math
### Example: Assign a name to user-input math expression
-```html {2}
+```doenet {2}
Type x^2 + sqrt4 - 1/y:
You've typed: $userExpression
@@ -50,7 +50,7 @@ A `` renders an input field for storing and naming user-provided mat
### Example: Do some math with user-input
-```html {3}
+```doenet {3}
Enter pi/4:
=
@@ -62,7 +62,7 @@ A named `` can be referenced within a `