Skip to content

Slides Reports

The slides pipeline produces presentation deliverables in six variants, defined by presentationTypeEnum:

  • slides_executive / slides_executive_html - Executive Overview
  • slides_wcag / slides_wcag_html - Detail Review by WCAG
  • slides_scenario / slides_scenario_html - Review by Scenario

The *_html variants are standalone styled HTML files instead of Google Slides decks.

Because the Slides API cannot create styled charts, the project keeps a separate charts spreadsheet with a pre-built template sheet of manually styled charts. Per audit, that template is copied into an auch_<md5> sheet, issue counts are written into the backing tables, and the resulting chart IDs are embedded into the decks.

Reports_slides.js

Holds the slide configuration (template presentation file ID, charts spreadsheet config, Slides object-ID map, brand colors, character limits), the top-level dispatcher, and the HTML presentation generator.

Function Description Facing
doGenerateSlides_(...) Entry point for all slide output. Builds the Sheets charts once via createSheetsChartsForSlides_, recovering from the chart-overflow error by calling fixUnexpectedErrorSlidesCharts_, then loops the six presentation types and calls the Google Slides or HTML generator for each selected one. Internal (driven by sidebar selection)
doCreateSlidesHTMLPresentationType_(...) Builds an HTML presentation by concatenating slide templates (title, agenda, context, summary of issues, issues by severity with a Cheerio-built chart, issues by scenario, one slide per issue, post-audit support, thank you) and writes the result to the audit reports folder. Internal
getSlidesRequestForStyleFromMD(objId, slideMdRes) Converts markdown parse output into Slides API updateTextStyle and createParagraphBullets requests, including a font-size workaround for bullet lists. Internal
isAuditChartsSheetDataFresh_(sheet, computed, selectedOptions) Compares the digest developer metadata on the audit's charts sheet with a freshly computed digest to decide whether cached charts can be reused. Internal
getAuditChartsDataDigest_(computed, selectedOptions) MD5 fingerprint of issues-by-status, issues-by-criteria-by-status, and issues-by-scenario-by-status; the charts cache key. Internal
slidesErrorMeaningfulMessage(err, requestsArr) Turns a raw Slides API batch error into an actionable message; for image requests it names the image URL and explains the likely format or sharing-permission cause. Internal
getReplacementsForSlides_(slideType, ...) Builds the {{TAG}} → value map for a deck: deck title plus company, product, deliver date, and project name. Internal
getReplacementsRequestsForSlides_(replacementsData) Converts the replacement map into Slides API replaceAllText requests. Internal
computeDigest_(message) Hex MD5 digest of a string. Internal
getAuditChartsSheetName_(data) Charts-sheet name for the audit: auch_ plus the MD5 of the spreadsheet ID (keeps names within the 50-character limit). Internal
fixLowValuesForChart_(sheet, charts, chartId, maxValueNum) Cosmetic fix for charts whose maximum value is 0-2, adjusting gridlines and axis bounds so tiny charts render sensibly. Internal

Constants: presentationTemplateFileId, chartsSpreadsheet, presentationTypeEnum, slidesRGBColors, slidesObjIds, charLimits.

Reports_slides_doCreateSlidesType.js

The heavy lifting for real Google Slides decks.

Function Description Facing
doCreateSlidesType_(slideType, ...) Creates one complete deck of the given type. Copies the template via replaceReportPresentation_, maps the 18 template slides by index, removes unused agenda slides, injects the high-level summary and top-3 failing issues, builds the scenarios table, adds per-criteria (WCAG deck) or per-scenario (Scenario deck) chart slides, emits all issue slides via editSlidesByIssue, deletes leftover template slides, then runs the layout batch followed by a separate image batch (images fail most often, so they are retried separately). Returns {files: [...]} with any per-file errors. Internal
editSlidesByIssue(issues, ...) Appends the Slides requests for each issue slide. For the Executive deck it filters to "Featured" issues per scenario (falling back to the algorithmically chosen most important issue). Picks the layout based on the asset orientation, adds title, notes, text, and image, builds repro steps in speaker notes, sets or removes the tutorial link, and inserts status and third-party icons. Internal
addToSlideRequestBatch(requests, ...requestsToAdd) Pushes requests onto a batch array with debug logging. Internal

Create_charts_for_slides.js

Function Description Facing
createSheetsChartsForSlides_(data, computed, selectedOptions) Returns {summary, scenarios, criterias} chart IDs. Reuses the cached auch_<md5> sheet when its digest still matches; otherwise deletes the stale sheet, copies the template, fills Blocking/Major/Minor/Advisory counts for the summary, each scenario, and each criterion, applies fixLowValuesForChart_, and stores a fresh digest as developer metadata. Internal

Reports_slides_helper_functions.js

Maintenance and utility functions for the slides pipeline.

Function Description Facing
doResetTemplateChartsSheet_() Rebuilds the charts template sheet from scratch: deletes all generated auch_* sheets, rewrites placeholder tables, recreates the stacked column and bar charts, applies axis text fixes, and re-applies protection. Run manually from the Apps Script editor when the chart count needs to change. Developer maintenance
fixUnexpectedErrorSlidesCharts_() Recovery routine when the charts spreadsheet hits its chart limit: keeps the charts sheets for the most recently modified audits and deletes every other auch_* sheet. Called automatically from doGenerateSlides_ on error. Internal (auto-invoked)
sanitizeSlidesObjectId_(text) Coerces text into a valid Slides API object ID. Internal
removeNewLinesMdCode(mdText) Strips line breaks inside markdown inline-code spans so the Slides markdown parser does not choke. Internal
extractMd2SlidesSafe(issueId, markdownText) Wraps the markdown parser so failures are re-thrown with the issue ID and a helpful hint. Internal