You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An interactive web application for importing, viewing, and exporting Nutrition Facts for [IgniteAI features](https://www.instructure.com/ignite-ai). Built with React, TypeScript, and Vite, it provides a modern UI for customizing Nutrition Facts, layouts, and exporting results in various formats.
5
7
6
-
## Features
8
+
###Features
7
9
8
10
-**Customizable Layouts**: Change the appearance of the Nutrition Facts, including revision, permissions, disclaimer, and copyright.
9
11
-**Import/Export**: Import products and export Nutrition Facts.
10
12
-**Modern UI**: Uses [@instructure/ui](https://github.com/instructure/instructure-ui) for a responsive and accessible interface.
11
13
-**Dark Mode Support**: Automatically adapts to your system's color scheme.
12
14
13
-
## Usage
15
+
###Usage
14
16
15
17
[View the tool on the web](https://instructure.ai/nutritionfacts) and select a feature to view its Nutrition Facts. You can:
16
18
@@ -19,30 +21,29 @@ An interactive web application for importing, viewing, and exporting Nutrition F
19
21
* Copy an iFrame embed code to your clipboard
20
22
* Copy the permalink to your clipboard
21
23
22
-
## Advanced Usage
24
+
###Advanced Usage
23
25
24
-
### Layout
26
+
####Layout
25
27
26
28
The page layout already includes mobile responsiveness, print styles, iFrame styles, and light and dark mode. Content layout can further be modified using the query parameter by setting `PageLayout` object key values explicitly to `false`:
Nutrition Facts provide two primary export methods: permalink & embed.
38
39
39
-
#### Permalink
40
+
#####Permalink
40
41
41
42
A permalink is an evergreen link to a specific feature's Nutrition Facts based on its unique id. Permalinks are structured as `ignite.ai/nutritionfacts/?id=<uid>`. When a permalink is accessed, the `uid` is used to fetch the latest revision of the Nutrition Facts and render them.
42
43
43
44
When viewing a Nutrition Facts page a "Copy permalink" helper is displayed in the header.
44
45
45
-
#### Embed
46
+
#####Embed
46
47
47
48
The Nutrition Facts pages can be embedded in other sites via iFrame. When embedded in an iFrame the page automatically applies styles to only display the content of the Nutrition Facts - not the header, background, or footer content.
48
49
@@ -53,116 +54,29 @@ The "Copy embed code" generates an iFrame that is sized to fit the content witho
53
54
> [!NOTE]
54
55
> Only the iFrame content is rendered dynamically. The copy of the product name / description are not dynamically updated and will need to be manually updated if either change significantly from the time the embed code is generated.
55
56
56
-
### JSON
57
-
58
-
When viewing a Nutrition Facts page a "Copy JSON Object" helper is displayed in the header. This object is for use with @instructure/ui AI Components. An sha256 and a last updated Epoch timestamp are included for easier update validation.
59
-
60
-
```JSON
61
-
{
62
-
"id": "<uid>",
63
-
"name": "<featureName>",
64
-
"sha256": "abc...xyz",
65
-
"lastUpdated": "1234567890",
66
-
"nutritionFacts": "<StrictNutritionFacts>",
67
-
"dataPermissionsLevel": "<AiPermissions>",
68
-
"AiInformation": "<StrictAiInformation>"
69
-
}
70
-
```
71
-
72
57
This makes outputting AI Components fairly simple, and standard.
modalLabel="This is a Data Permission Levels modal"
138
-
triggerText="Data Permission Levels"
139
-
/>
140
-
```
141
-
142
-
### Importing
143
-
144
-
You can import a Nutrition Facts object by referencing its unique id in the query parameter such as `?id=igniteAgent`. Parameter values are case insensitive. If an invalid ID is provided the default product (an empty~ish object) is returned.
145
-
146
-
## Getting Started
60
+
### Getting Started
147
61
148
62
> [!CAUTION]
149
63
> The rest of this readme is for developing the generator. If you need to generate nutrition facts, see 'Usage' above.
0 commit comments