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
pageLibraries.Web.Page.WebPage: The page, set up.
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
pageLibraries.Web.Page.WebPage: The page.pageCoursesLibraries.Containers.Array<Libraries.Web.Series.PageSeries>: The courses (series) it is in.
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
locationtext: The page's location on the site.courseLibraries.Web.Series.PageSeries: The course the reader is following.
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
pageLibraries.Web.Page.WebPagewordstextaddresstextstyleLibraries.Web.Styles.WebTextStyle
Returns
GetMark(text mark)
A mark, such as an arrow, that screen readers skip.
Parameters
marktext
Returns
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
pageLibraries.Web.Page.WebPage: A page on the site.
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
unitLibraries.Web.Series.PageSeries: The series.courseNametext: The larger course's name, such as "Computer Science Principles".courseLocationtext: 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
exchangeLibraries.Network.NetworkExchange
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
nametext: The icon's file name, such as "hamburger.svg".svgtext: 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
foldertext: 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
pageLibraries.Web.Page.WebPage: A page on the site, in no course.
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
languagetext: The query for the Quorum standard library's script.scripttext: The query for the site's own script.highlightertext: The query for the code highlighter's script.loadtext: 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
pageLibraries.Web.Page.WebPage: A page on the site, with a banner (such as ColorBanner).
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
pageLibraries.Web.Page.WebPage: A page on the site, with a banner (such as ProductBanner).
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
pageLibraries.Web.Page.WebPage: A page on the site.
Inherited Actions
3 actions from Libraries.Language.Object
39 actions from Libraries.Web.WebSite
- AddLookSample(Libraries.Web.Page.WebPage page)
- AddPage(Libraries.Web.Page.WebPage page)
- AddPlainPage(Libraries.Web.Page.WebPage page, text location)
- AddPlainPage(Libraries.Web.Page.WebPage page)
- AddResponder(Libraries.Web.ServerResponder responder)
- AddSeries(Libraries.Web.Series.PageSeries series)
- AddSitemapFolder(text location)
- GetAddress()
- GetFolder()
- GetHomeSeries(Libraries.Web.Page.WebPage page)
- GetLibraryCodeAddress(text className)
- GetPage(text location)
- GetPageIterator()
- GetPublicAddress(text location)
- GetRelativeFile(text location)
- GetRelativeFolder()
- GetResponder(text location)
- GetSeriesList()
- GetSeriesOf(Libraries.Web.Page.WebPage page)
- GetSiteName()
- GetStyleOptions()
- HasAccessibilityChecks()
- IsPlainPage(Libraries.Web.Page.WebPage page)
- PrepareServedPage(Libraries.Web.Page.WebPage page)
- Serve(integer port)
- SetAccessibilityChecks(boolean value)
- SetAddress(text value)
- SetDefaultShareImage(text location, text imageDescription)
- SetFolder(text folder)
- SetHomeLocation(text location)
- SetLibraryCodeFolder(text location)
- SetRelativeFolder(text location)
- SetRobotsLocation(text location)
- SetSiteName(text value)
- SetSitemapLocation(text location)
- SetStyleOptions(Libraries.Web.Styles.StyleOptions options)
- SetStyleSheetLocation(text location)
- SetTitleEnding(text value)
- Write()