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
{{ message }}
Repository navigation
Commit 1a4a537
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/h5p-build-page.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
The source is not uploaded: the package is built in the browser. A link can carry the source in its fragment, which no server sees: `/h5p/build/#source=<base64url>`, the bytes being the source's JSON as UTF-8, or that JSON compressed with raw deflate (Node's `zlib.deflateRawSync`, Python's `zlib.compressobj(wbits=-15)`) to keep the link short. A linked source is built at once, unless it names files of its own, which only the person can choose. A page opened by such a link keeps the fragment in step with the source as the person changes it, so the address can be copied to send the changed source on ([below](#the-source-editor)). A source that names a picture by web address gets it only where that host allows CORS.
6
6
7
+
For a person with no source yet, the page gives a prompt to copy into a chat. It carries the address of [the skill page](h5p-skill.md) whole, which a chat's fetch tool needs, and `site.js` gives it a Copy button as it does a code block. Under the steps, and there before anything is built, the page says where a package plays with no H5P site, in a paragraph with two links: [h5p-offline-player](https://github.com/missing-elements/h5p-offline-player), the player it plays in here, is set up on a site of one's own (its setup guide), or is an app that plays with no network. Under that is where to say how it went, in two ways, since a teacher may have no GitHub account. The first is an email, which asks for none, to the address h5p-offline-player's code of conduct and security policy give. The second is a new discussion in h5p-offline-player, where the author is made, which is public. `buildFeedback` in [src/_data/site.js](../src/_data/site.js) writes both addresses, each with the same title and two questions to start from.
8
+
7
9
| File | What it holds |
8
10
| --- | --- |
9
11
|[src/h5p/build/index.njk](../src/h5p/build/index.njk)| The page's markup, in the site's layout, and its Content-Security-Policy: GitHub Pages cannot send a Content-Security-Policy header for a site, so a `<meta>` tag is the only policy it gets |
Copy file name to clipboardExpand all lines: e2e/build.spec.ts
+38Lines changed: 38 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,44 @@ test('a pasted source builds, plays and downloads', async ({ page, baseURL }) =>
118
118
expect(problems,problems.join('\n')).toEqual([])
119
119
})
120
120
121
+
test('before anything is built the page gives a prompt to try, and says where a package plays and where to say how it went',async({ page, context, baseURL })=>{
// The prompt carries the skill's page at its whole address, which a chat's fetch tool needs, and its button copies it.
126
+
constprompt=page.locator('pre.prompt')
127
+
awaitexpect(prompt).toHaveText('Read https://missing-elements.github.io/h5p/skill/ and follow it to make an H5P quiz with five questions about the rivers of Europe.')
// With no H5P site: the player this page plays it in, in two links in a paragraph, to how to set it
132
+
// up on a site of one's own and to its app, offline.
133
+
constplays=page.getByRole('region',{name: 'Play it without an H5P site'})
134
+
awaitexpect(plays.locator('p a')).toHaveCount(2)
135
+
awaitexpect(plays.getByRole('link',{name: 'on a site of your own'})).toHaveAttribute('href','https://github.com/missing-elements/h5p-offline-player/blob/main/docs/setup.md')
136
+
awaitexpect(plays.getByRole('link',{name: 'offline, in its app'})).toHaveAttribute('href','https://h5p-offline-player.vercel.app/app/')
137
+
138
+
// Feedback asks for no account: an email, with a subject and two questions to start from.
139
+
constfeedback=page.getByRole('region',{name: 'How did it go?'})
expect(letter.searchParams.get('subject')).toBe('Feedback on the H5P build page')
146
+
expect(letter.searchParams.get('body')).toBe('What I made (the content type, and the chat that wrote the source):\r\n\r\n\r\nWhat went well, or wrong:\r\n\r\n')
147
+
// And for someone with a GitHub account, a new discussion where the author is made, which starts the same.
148
+
constdiscussion=newURL((awaitfeedback.getByRole('link',{name: 'Discuss on GitHub'}).getAttribute('href'))!)
site takes. Nothing is uploaded: the package is built in your browser, from the libraries this
28
28
site serves.
29
29
</p>
30
-
{#- The skill's page at its whole address, which a person gives the chat as it is. -#}
30
+
{#- A prompt to copy, which site.js gives a Copy button as it does a code block. It carries the
31
+
skill's page at its whole address, which a chat's fetch tool needs. -#}
31
32
<p>
32
-
No source yet? Give the chat <ahref="{{ site.url }}/h5p/skill/">{{site.url}}/h5p/skill/</a>
33
-
and ask it for an activity: the h5p-author skill there tells it how to write one.
33
+
<strong>No source yet?</strong> Paste this into an AI chat, with a subject of your own. It
34
+
sends the chat to <ahref="/h5p/skill/">the h5p-author skill's page</a>, which tells it how
35
+
to write an activity.
34
36
</p>
37
+
<preclass="language-text prompt"data-label="Prompt">Read {{site.url}}/h5p/skill/ and follow it to make an H5P quiz with five questions about the rivers of Europe.</pre>
35
38
</header>
36
39
37
40
{#- The steps are drawn as a timeline by site.css: a marker for each, on a rail that runs on to
0 commit comments