QuorumSite

Package: Libraries.Web.Quorum · Inherits from: Libraries.Network.NetworkExchangeListener, Libraries.Web.WebSite, Libraries.Language.Object

QuorumSite is the Quorum website's frame and course navigation, for any site in the Quorum look (such as the website, or the library's documentation). It is a WebSite that puts every page in the site's frame: the navigation bar, sign-in, the course's contents on the left, "On this page" on the right, and the footer, with its looks from QuorumSiteOptions. Each series of pages is a course: each of its pages gets breadcrumbs and Back and Next links that keep a reader in the course they are following, and its breadcrumbs are described to search engines (structured data). Pages a server builds when asked get the same frame (FinishServedPage). A site with more to add, such as reports built from every page, does it in a subclass (FinishSitePages, FinishSitePage). The frame's icons are read from a folder the site sets (SetIconFolder). Everything general stays in WebSite.

Example Code

use Libraries.Web.Quorum.QuorumSite
use Libraries.Web.Quorum.QuorumSiteOptions

QuorumSiteOptions options
QuorumSite site
site:SetFolder("html")
site:SetStyleOptions(options)
site:SetIconFolder("html/media/userInterface/SVG/")

Actions

AddCourseData(Libraries.Web.Page.WebPage page, Libraries.Web.Series.PageSeries course)

Adds a Course to a course overview page's structured data: its name, description, address, provider, and its lessons in order.

Parameters

AddStructuredDataScript(Libraries.Web.Page.WebPage page, Libraries.Data.Formats.JavaScriptObjectNotation data)

too.

Parameters

FinishContent()

Once every page is set up: fills in the pages' standards lists, then builds a report page for each set. WebSite calls this before building the stylesheet, so the reports are styled and written like any other page.

FinishServedPage(Libraries.Web.Page.WebPage page)

Puts a page the server built when asked (a reader's projects or project, a password reset) in the site's frame, at the whole width (as UseFullWidth), as WebSite:PrepareServedPage asks. Its settings are kept only while the frame is built, so serving pages doesn't fill the site's tables.

Parameters

FinishSitePage(Libraries.Web.Page.WebPage page, Libraries.Containers.Array<Libraries.Web.Series.PageSeries> pageCourses)

Called for each page that isn't plain, after its course navigation and before its frame, for a subclass to add to it, such as structured data describing a lesson. It does nothing here.

Parameters

FinishSitePages()

Called once, before the course navigation and the frame are added, for a subclass to add pages built from the site's other pages (such as a report or an overview for each course) and to fill in parts of pages that need every page (such as lists of what covers what). Pages it adds get the navigation and frame like any other. It does nothing here.

GetCourseAddress(text location, Libraries.Web.Series.PageSeries course)

Returns the address of a page that keeps the reader in a course: the page's address with the course's key added, such as "/tutorials/Scenes/intro.html?course=scenes". Every link a course writes uses this, so following Next or a course's lesson list keeps the reader in that course.

Parameters

Returns

text: The address.

GetIconFolder()

Returns the folder the frame's icons are read from (SetIconFolder).

Returns

text: The folder.

GetLink(Libraries.Web.Page.WebPage page, text words, text address, Libraries.Web.Styles.WebTextStyle style)

A link with its own look, its words and address made safe.

Parameters

Returns

Libraries.Web.Page.Link

GetMark(text mark)

A mark, such as an arrow, that screen readers skip.

Parameters

  • mark text

Returns

Libraries.Web.Page.Span

HideOnThisPage(Libraries.Web.Page.WebPage page)

Leaves out a page's "On this page", for a page too short to need it, such as a track page with a single section. Its text takes the room instead.

Parameters

PartOf(Libraries.Web.Series.PageSeries unit, text courseName, text courseLocation)

Records that a series is one part of a larger course, such as a unit of a track, so the breadcrumbs read Home › the course › the series › the lesson.

Parameters

  • unit Libraries.Web.Series.PageSeries: The series.
  • courseName text: The larger course's name, such as "Computer Science Principles".
  • courseLocation text: The larger course's page, such as "lessons/code.html".

ResponseReceived(Libraries.Network.NetworkExchange exchange)

Answers a request as WebSite does, and logs it to the console: its path, who asked, when, and how long it took. If answering fails, it logs the stack trace and answers with an error (500), so one failed request doesn't stop the server.

Parameters

SetIcon(text name, text svg)

Sets one of the frame's icons as its SVG, used instead of the file of that name in the icon folder, for a site with no folder of icons, such as the library's documentation.

Parameters

  • name text: The icon's file name, such as "hamburger.svg".
  • svg text: The icon's SVG.

SetIconFolder(text folder)

Sets the folder the frame's icons are read from, such as "html/media/userInterface/SVG/": the navigation bar's menu, search and Discord icons, and the sign-in dialog's. The website sets it to its own folder of icons.

Parameters

  • folder text: The folder, ending with a slash.

SetOnThisPageOnLeft(Libraries.Web.Page.WebPage page)

Puts a page's "On this page" in the left column, where a course's lessons would go, instead of the right. For a page in no course whose contents are its main way around, such as the release notes, listed by year.

Parameters

SetScriptVersions(text language, text script, text highlighter, text load)

Sets the version queries added to the addresses of the scripts the frame loads, so browsers fetch a script again when it changes.

Parameters

  • language text: The query for the Quorum standard library's script.
  • script text: The query for the site's own script.
  • highlighter text: The query for the code highlighter's script.
  • load text: The query for the script that loads Quorum programs.

Example

VersionHelper versions
QuorumSite site
site:SetScriptVersions(versions:GetLanguageVersionQuery(), versions:GetScriptVersionQuery(), versions:GetPrismVersionQuery(), versions:GetLoadVersionQuery())

UseEdgeToEdgeBanner(Libraries.Web.Page.WebPage page)

Lets a page's title banner span the window, edge to edge, while the page keeps its columns (its course's contents on the left), as the practice problems' header did. The rest of the page is set in from the edges.

Parameters

UseFullBleedBanner(Libraries.Web.Page.WebPage page)

Gives a page the whole width (as UseFullWidth) and lets its title banner span the window, edge to edge, as the Download page's old header did. The banner stays the first thing in the main area; the rest of the page is set in from the edges instead.

Parameters

UseFullWidth(Libraries.Web.Page.WebPage page)

Gives a page the whole width: no course contents on the left and no "On this page", so wide parts such as the home page's block editor have the room. For pages in no course.

Parameters

Inherited Actions

3 actions from Libraries.Language.Object
39 actions from Libraries.Web.WebSite