Expand description
Preview links that show a page as staged without logging in.
Modules§
Structs§
- Page
Preview - What the preview of a staged page, or of a published one, renders.
- Preview
Claim - What a valid preview token lets its holder read without logging in: one page of a course, or
all of its pages, as
changeset_idstages them or as published. - Preview
Exercise - An exercise of a previewed page.
- Preview
Page - A page as students see it before answering anything. The preview needs no login, so exercise specs, model solutions and review settings other than the instructions are left out.
- Preview
Page Link - A page a preview can switch to.
- Preview
Reference - A bibliography entry the page’s citations refer to.
- Preview
Token - A preview link’s token and when it stops working.
Functions§
- changed_
page_ links - The pages
changesetadds or changes, in the order the staged course structure shows them. - mint_
preview_ token - Mints a short-lived preview token for the page
page_idof the course, or for all its pages withNone, aschangeset_idstages them or published without one. Also deletes expired tokens. - preview_
path - Path of the main frontend page that previews the staged changeset, for a token from
mint_preview_token. - resolve_
changeset_ preview - What the preview link of the whole
changesetrenders:page_id, or the first changed page without one, with the changed pages to switch between. The caller checks the same things as forresolve_preview. Errors withNotFoundalso if the changeset changes no pages andpage_idisNone. - resolve_
preview - What a preview link of
page_idinchangesetrenders. The caller checks that the changeset is the link’s user’s and that they may still edit its course. Errors withNotFoundif the changeset is no longer open or if the page does not exist in it or live. - resolve_
published_ course_ preview - What the preview link of the whole published course renders:
page_id, or the first page without one, with all pages to switch between. The caller checks the same things as forresolve_published_preview. - resolve_
published_ preview - What a preview link of the published
page_idofcourse_idrenders. The caller checks that the link’s user may still edit the course. Errors withNotFoundif the page is not in the course. - validate_
preview_ token - Looks up an unexpired token. Errors with
PreconditionFailedfor an unknown or expired one.