CommunityProductivity & Collaborationgithub.com

hpt

Create and edit HPT (HTMLPoint) decks as offline, page-turnable 16:9 HTML slides. Use for HPT presentations and requests to record HPT design conventions.

What is hpt?

hpt is a Claude Code agent skill that create and edit HPT (HTMLPoint) decks as offline, page-turnable 16:9 HTML slides. Use for HPT presentations and requests to record HPT design conventions.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/WilliamRo/hpt/tree/HEAD

Installed? Explore more Productivity & Collaboration skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Preview

From the skill README

hpt preview

Documentation

HPT · HTMLPoint

1. Master

  • Use the blank master for a new deck. It fits a landscape 16:9 screen (height to width 9:16) and supports previous/next, a page count, and fullscreen.
  • Each slide has three vertically ordered regions: head, body, and foot. Keep all three in the markup even when a slide is blank.
  • Leave the foot empty unless its content is explicitly specified.
  • Give the rounded body container equal outer margins on all four sides. Measure the top gap from the lower edge of the head, the side gaps from the slide edges, and the bottom gap from the slide edge when the foot is empty. For example, use 1.1cqw for each gap (about 21 px on a 1920 px-wide slide).
  • Use Ctrl+Enter to enter or leave fullscreen. Keep editing shortcuts inside editable fields and dialogs.
  • In fullscreen, a short Escape closes the active pop or dialog first and keeps the deck fullscreen. The master requests Chromium Keyboard Lock for Escape. Chrome retains its long-press Escape exit. Chrome Keyboard Lock
  • Duplicate a blank slide to add a page. Put content only on the requested slides. Keep the deck usable offline.
  • For a standalone deck, place xxx.html beside an xxx/ folder with the same base name. Put its CSS, JavaScript, and media in that folder. Copy the blank master as a pair and update its relative resource paths to match the chosen name.
  • Copy the approved HPT favicon with the deck assets. Link it from the presentation HTML with <link rel="icon" type="image/svg+xml" href="xxx/favicon.svg">, adjusting the relative path for that page.
  • When embedding a deck in an existing site, use the site's navigation outside the presentation surface and scope HPT styles to the deck.

2. Templates and Components

  • Blank master is the default template.
  • Follow the HPT conventions for slide headings, navigation, Txt Tuner, textbox, LSR, imgpop, bibliography cards, and source saving.

2.1 Slide tabs

Place each slide's tabs across the top of its body. Use .hpt-tabs from the blank master's hpt.css for a wrapping tab row with rounded pale-blue buttons. The selected tab uses a darker blue fill and a blue bottom rule.

Copy this markup for each slide that needs tabs. Match the top-level data-hpt-tabs value to the slide ID, and give each button and panel a unique ID throughout the deck. The blank master's hpt.js wires the tabs and Contents.

<section class="hpt-slide" id="example-slide" aria-label="Example slide">
  <header class="hpt-head"></header>
  <div class="hpt-body hpt-tabbed-body">
    <div class="hpt-tabs" role="tablist" aria-label="Example slide tabs" data-hpt-tabs="example-slide">
      <button type="button" role="tab" id="example-overview-tab"
              aria-selected="true" aria-controls="example-overview">Overview</button>
      <button type="button" role="tab" id="example-details-tab" tabindex="-1"
              aria-selected="false" aria-controls="example-details">Details</button>
    </div>
    <div role="tabpanel" id="example-overview" aria-labelledby="example-overview-tab">Overview content</div>
    <div role="tabpanel" id="example-details" aria-labelledby="example-details-tab" hidden>Details content</div>
  </div>
  <footer class="hpt-foot"></footer>
</section>

Press Q for the previous tab and E for the next tab on the current slide. Selection wraps at either end. While a tab button has keyboard focus, Left/Right and Home/End change the selection within that tab row.

2.2 Subtabs

Use .hpt-subtabs for a tab row nested inside a parent tab panel, including the right pane of an LSR layout. Subtabs use the same responsive font size as the main tabs. They share a thin gray baseline and use transparent backgrounds and 7 px vertical by 12 px horizontal padding. The selected label is bold dark blue with a 2 px blue underline. Keyboard focus has a visible outline.

The master stylesheet contains the reusable .hpt-subtabs rules. For an existing standalone deck, copy those rules into its local HPT stylesheet. Paste the following markup inside the parent panel and give each group and tab its own stable ID. The existing HPT tab handler provides selection, arrow-key navigation, and restoration on reload.

<div class="hpt-subtabs" role="tablist" aria-label="Cases" data-hpt-tabs="cases">
  <button type="button" role="tab" id="case-a-tab" aria-controls="case-a" aria-selected="true">Case A</button>
  <button type="button" role="tab" id="case-b-tab" aria-controls="case-b" aria-selected="false" tabindex="-1">Case B</button>
</div>
<div role="tabpanel" id="case-a" aria-labelledby="case-a-tab">Case A content</div>
<div role="tabpanel" id="case-b" aria-labelledby="case-b-tab" hidden>Case B content</div>

2.3 Left-separator-right (LSR)

Add data-hpt-lsr to a tab panel with two direct child elements, left content first and right content second. The blank master bundles lsr.css, lsr.js, and control-wheel.js in assets/blank/. Copy them into the deck's adjacent asset folder (or point to a shared asset copy when maintaining multiple linked decks in one site).

<div role="tabpanel" id="example-overview" aria-labelledby="example-overview-tab" data-hpt-lsr>
  <section aria-label="Overview text">...</section>
  <figure>...</figure>
</div>

The initial left:right split is 1:1.618. Hover over the gap to drag the divider. Choose the top left-pointing chevrons to maximize the right region or the bottom right-pointing chevrons to maximize the left. Double-click the divider to restore the default split from any position. With keyboard focus on the separator, Left/Right adjust the split, Home/End move it to an edge, and Enter restores the default.

2.4 Restore the current slide and tab

Save the current slide ID and the selected tab ID for each tab group in browser local storage whenever navigation changes. Restore both during initialization so refresh reopens the same slide and tab. Use the deck path to scope the saved state and give slides, tab groups, and tab buttons stable IDs. Use the deck's default slide or tab when a saved ID is unavailable.

2.5 Textbox

  • The blank master loads textbox.css, edit-history.js, textbox-editor.js, and textbox.js. Copy these assets with the master. In an embedded deck, keep copies alongside the deck and use local relative paths. Load edit history and the whole-box editor before the textbox script.
  • Use <div class="hpt-textbox" data-hpt-textbox="unique-id" role="region" aria-label="Section name" tabindex="-1">...</div> inside the slide body. Give the textbox a bounded height through its layout. Assign a stable ID to retain formatting, zoom, and scroll position in browser local storage.
  • Select text to format it.
  • To edit the whole textbox, clear the selection, right-click anywhere inside the box, and choose Edit. The source editor fills the box, with Save and Cancel along the bottom. Scroll over Text size to resize the editor font, or hold Ctrl (Command also works on Mac) and scroll over the draft. Plain scrolling over the draft moves through the text. The browser remembers the editor size for this deck. Save applies the draft as one undoable change and remembers it in this browser. Cancel or Escape discards the draft. Use the deck's Ctrl + S after leaving the editor to write the HTML file.
  • The whole-box editor shows popup formatting in the source. Bold uses **text**. Underline uses <u>text</u>, and font color uses inline HTML such as <span style="color: #9b242c">text</span>. Adding or removing these markers and choosing Save updates the slide and the popup controls.
  • Keep the template assets and working deck copies in sync when the textbox style or behavior changes.

2.6 Textbox itemized lists

Start each item on its own line with a hyphen and a space (- ). A pasted bullet and a space (• ) also work. Consecutive items render as a bulleted list. Wrapped lines align with the first word of each item. The textbox retains the typed markers for editing and saving.

2.7 Textbox headings

Start a textbox line with one to three hash marks. Each heading renders as its own bold line, and the hash marks stay in the editable text.

#1 Heterogeneous yet night-to-night stable distribution
## Night-to-night similarities
### Example subject
  • # renders a section heading in dark orange at 1.35x the body text size.
  • ## renders a subsection heading in deep blue at 1.17x.
  • ### renders a third-level heading in deep blue at 1.08x.
  • A space after the marks is optional. Type the number as part of the title when numbering sections. Edit heading markers in the whole-box editor.

2.8 imgpop

  • The blank master loads imgpop.css and imgpop.js. Copy both into the deck's asset folder alongside the other blank assets.
  • By default, clicking (or pressing Enter/Space on) any <img> inside <figure> in a slide opens a large rounded-corner modal <dialog class="hpt-imgpop-dialog"> (calc(100vw - 64px) x calc(100dvh - 64px), 14px border radius, small margin to the viewport border) mounted inside .hpt-viewer, initially fitted to 100% of the popup's width or height (whichever fills first). Mark non-popup images with data-hpt-imgpop="false", or opt in other slide images with data-hpt-imgpop.
  • Inside the popup, mouse wheel zooms 100%-800% around the pointer across the full rounded popup window, dragging pans when zoomed, double-click toggles 100% / 250%, 1:1 resets the view, and outer backdrop click, close button, or short Escape closes the dialog and resets zoom and pan (while preserving HPT fullscreen mode).
  • Copyable template: imgpop-template.html.
<link rel="stylesheet" href="xxx/imgpop.css">
<script src="xxx/imgpop.js"></script>

<figure>
  <img src="xxx/figs/fig1.png" alt="Figure 1 description">
  <figcaption><strong>Fig. 1 | Caption text.</strong></figcaption>
</figure>

2.9 Reference slide and bib-item

  • By default, Slide 2 (s2, id="references") is the deck's reference slide (02 References, Bibliography tab, scrollable .hpt-bib-list), pre-wired in blank.html and copyable from reference-slide-template.html.
  • Load bib-item.css alongside imgpop.css / imgpop.js, and populate .hpt-bib-list with bib-item cards from bib-item-template.html. Put the DOI hyperlink ONLY on [1] inside .hpt-bib-num so clicking [1] opens the DOI while clicking the plain .hpt-bib-cite row expands the card, nested Abstract, and Fig. N subpanels.
<section class="hpt-slide" id="references" aria-label="References" hidden>
  <header class="hpt-head">
    <h1 class="hpt-slide-title" data-hpt-font="references-title:100"><span class="hpt-title-text"><span class="hpt-title-line"><span class="hpt-slide-number" aria-hidden="true">02</span><span class="hpt-title-label">References</span></span></span></h1>
    <p class="hpt-deck-title" data-hpt-font="deck-title:100"><span class="hpt-title-text"><span class="hpt-title-line">Deck Title</span></span></p>
  </header>
  <div class="hpt-body hpt-tabbed-body">
    <div class="hpt-tabs" role="tablist" aria-label="References tabs" data-hpt-tabs="references">
      <button type="button" role="tab" id="references-bibliography-tab" aria-selected="true" aria-controls="references-bibliography">Bibliography</button>
    </div>
    <div class="hpt-bib-list" role="tabpanel" id="references-bibliography" aria-labelledby="references-bibliography-tab" data-hpt-panel-scroll tabindex="-1">
      <details class="hpt-bib-item" id="ref-author2026">
        <summary>
          <span class="hpt-bib-num"><a href="https://doi.org/10.xxxx/xxxxx" target="_blank" rel="noopener" title="Open DOI">[1]</a></span>
          <span class="hpt-bib-tag">author2026</span>
          <span class="hpt-bib-cite">Author, A. et al. Paper title. <i>Journal Name</i> <strong>Vol</strong>, 1-10 (2026).</span>
          <strong class="hpt-bib-if" title="Journal Impact Factor">IF=0.0</strong>
        </summary>
        <div class="hpt-bib-body">
          <details class="hpt-bib-sub" id="ref-author2026-abstract">
            <summary>Abstract</summary>
            <div class="hpt-bib-sub-body"><p>Verbatim abstract text.</p></div>
          </details>
          <details class="hpt-bib-sub" id="ref-author2026-fig1">
            <summary>Fig. 1 | Figure title</summary>
            <div class="hpt-bib-sub-body">
              <figure class="hpt-bib-fig">
                <img src="xxx/figs/fig1.png" alt="Fig. 1 | Figure title" loading="lazy">
                <figcaption><strong>Fig. 1 | Figure title.</strong> Verbatim caption text.</figcaption>
              </figure>
            </div>
          </details>
        </div>
      </details>
    </div>
  </div>
  <footer class="hpt-foot"></footer>
</section>

2.10 Offline KaTeX

The blank master includes KaTeX, its stylesheet, and WOFF2 fonts under blank/katex. Copy the entire directory with the deck's assets and keep fonts/ beside katex.min.css. The files load locally when the deck opens over file://.

For an existing standalone HPT, copy the KaTeX directory, textbox-editor.js, and the current textbox.js and textbox.css. Add these lines to the HTML head. Replace example with the deck's asset folder.

<link rel="stylesheet" href="example/katex/katex.min.css">
<script defer src="example/katex/katex.min.js"></script>

In a textbox, write $x_t$ for inline math and $$p(x_{t+1}\mid x_t)$$ for display math. Keep each equation within one text block. Edit the LaTeX delimiters and expression in the whole-box editor. The source is retained for undo, reload, and Ctrl + S.

2.11 Ctrl + S source saving

Open the original HTML in desktop Chrome or Edge. The first Ctrl + S opens a dialog to copy the current path and choose the original file. Grant write access to save. Later saves reuse the remembered file handle, with the chooser available when the file moves or the browser loses the handle.

Copy source-save.js and source-save.css into the deck's adjacent asset folder. Paste this into the HTML head before the title and textbox scripts. Replace example with the actual asset folder and example-hpt with a unique, stable deck ID. The blank master already includes this wiring.

<link rel="stylesheet" href="example/source-save.css">
<script type="application/json" id="hpt-source-settings" data-hpt-deck="example-hpt">{"titles":{},"textboxes":{}}</script>
<script src="example/source-save.js"></script>
  • Give each textbox a stable data-hpt-textbox ID. The master textbox script exports the original text, edits, formatting, zoom, and scroll position through hpt-collect-textbox-settings. Title tuners use stable data-hpt-font="title-id:100" IDs and read restored sizes from window.hptSourceSettings.titles.
  • Validate the chosen filename, deck ID, existing settings, and original title and textbox sources. The saving script replaces only the JSON settings block and reports success after the write completes.
  • Verify with a refresh in the same browser and with the saved HTML opened in a browser profile without local edits. See the source-saving conventions for the permission and recovery behavior.

3. Default Title Sizes

  • At a 1920 px slide width, use 51 px for the slide title and 44 px for the HPT title. Scale both proportionally at smaller slide widths.
  • Prefix content-slide titles with a two-digit yellow (#facc15) slide number. Size it at 78% of the slide title, approximately 40 px at full size. Leave the cover unnumbered visually.

4. Updating This Skill

When the user writes ->hpt: XXX, record the design or authoring rule in references/conventions.md in English. Update the relevant template and assets too if the rule changes behavior.

Check a new deck in a browser at 16:9. Verify slide order, page controls, and fullscreen.

Related Skills