Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions builder/template.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ function renderFooterCustom(page, config) {
function renderEditAndOfflineBlock(page, config) {
const showEdit = config.gh_edit_link && config.gh_edit_link_text && config.gh_edit_repository
&& config.gh_edit_branch && config.gh_edit_view_mode;
const showOffline = config.gh_offline_link && config.gh_offline_link_text && config.gh_offline_link_url;
const showOffline = config.gh_offline_link && config.gh_offline_link_url;
const showLastModified = config.last_edit_timestamp && config.last_edit_time_format
&& page.frontmatter.last_modified_date;

Expand All @@ -755,9 +755,17 @@ function renderEditAndOfflineBlock(page, config) {
` </p>\n`;
}
if (showOffline) {
inner += ` <p class="text-small text-grey-dk-000 mb-0">\n` +
` <a href="${escAttr(String(config.gh_offline_link_url))}" id="download-offline">${escText(String(config.gh_offline_link_text))}</a>\n` +
` </p>\n`;
const pdfUrl = config.gh_pdf_link_url ? String(config.gh_pdf_link_url) : null;
const offlineHref = escAttr(String(config.gh_offline_link_url));
if (pdfUrl) {
inner += ` <p class="text-small text-grey-dk-000 mb-0">\n` +
` Download <a href="${offlineHref}" id="download-offline">Offline Copy</a> or <a href="${escAttr(pdfUrl)}" id="download-pdf">PDF</a>.\n` +
` </p>\n`;
} else {
inner += ` <p class="text-small text-grey-dk-000 mb-0">\n` +
` <a href="${offlineHref}" id="download-offline">Offline Copy</a>\n` +
` </p>\n`;
}
}

return ` <div class="d-flex mt-2">\n` + inner + ` </div>\n`;
Expand Down
2 changes: 1 addition & 1 deletion docs/Documentation/Tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The build pipeline also reads a handful of declarative files. They are not execu

| File | Effect |
|---|---|
| `docs/_config.yml` | Site config. `tbdocs` reads `url`, `baseurl`, `title`, `logo`, `also_build_offline`, `also_build_pdf`, `offline_exclude`, `exclude`, the footer / aux-link knobs, the GitHub edit-link knobs, and the offline-download-link knobs. Jekyll-only keys (`markdown`, `kramdown`, `theme`, `highlighter`, the `defaults` block, the `compress_html` block) are ignored. |
| `docs/_config.yml` | Site config. `tbdocs` reads `url`, `baseurl`, `title`, `logo`, `also_build_offline`, `also_build_pdf`, `offline_exclude`, `exclude`, the footer / aux-link knobs, the GitHub edit-link knobs, and the download-link knobs (`gh_offline_link`, `gh_offline_link_url`, `gh_pdf_link_url`). Jekyll-only keys (`markdown`, `kramdown`, `theme`, `highlighter`, the `defaults` block, the `compress_html` block) are ignored. |
| `docs/_book.yml` | The PDF book's chapter manifest. Entries are resolved to pages via the selector schema (`page` / `pages` / `nav_page` / `nav_pages` / `no_descent`) and control PDF outline behaviour via `landing_page:`, `landing_is_target:`, `no_outline_entry:`, `no_heading_shift:`, and `outline_closed:`. Full schema is documented in the file header. Phase 2 resolves chapter arrays; Phase 8 assembles `book.html`. |
| `builder/themes/Light.theme`, `Dark.theme`, `Classic.theme` | twinBASIC IDE theme files, vendored from the BETA installer. `builder/highlight-theme.mjs` parses them into a Symbol-keyed palette that drives both the renderer's scope-to-class mapping and the generated `tb-highlight.css`. Refresh from the installer when the IDE adds new palette entries. |
| `builder/twinbasic.tmLanguage.json` | TextMate grammar for the twinBASIC language. Shiki uses it to tokenise every ` ```tb ` code block. |
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ gh_edit_view_mode: "tree"
# it to fetch the offline copy, offline readers use it to refresh
# theirs against the latest release.
gh_offline_link: true
gh_offline_link_text: "Download offline copy"
gh_offline_link_url: "https://github.com/twinbasic/documentation/releases/latest/download/twinbasic-docs-offline.zip"
gh_pdf_link_url: "https://github.com/twinbasic/documentation/releases/latest/download/twinBASIC.Book.pdf"

# When true, tbdocs's Phase 7 writes a `file://`-browsable mirror of
# `_site/` to `_site-offline/` with every URL rewritten to a page-
Expand Down