Skip to content
CCinder
Tagging a Page

Guides

Tagging a Page

A practical guide to adding semantic tags to a real browser surface.

Semantic tagging should describe business meaning, not visual styling.

Start with one real route and one real context

html
5 lines
<section cinder-route="reports" data-cinder-path="/reports">
  <div cinder-context="crop-prices">
    ...
  </div>
</section>

A route gives the runtime a navigation destination and route-aware reasoning anchor. A context gives related controls and outputs a shared semantic boundary.

Add fields, filters, actions, and outputs inside the right region

html
5 lines
<label for="crop-filter">Crop</label>
<select id="crop-filter" cinder-filter="crop"></select>

<button cinder-action="search">Search</button>
<div tabindex="0" cinder-output="price"></div>

Full small example

html
12 lines
<section cinder-route="reports" data-cinder-path="/reports">
  <div cinder-context="crop-prices">
    <label for="crop-filter">Crop</label>
    <select id="crop-filter" cinder-filter="crop"></select>

    <label for="state-filter">State</label>
    <select id="state-filter" cinder-filter="state"></select>

    <button cinder-action="search">Search</button>
    <div tabindex="0" cinder-output="price"></div>
  </div>
</section>

Practical tagging rules

  • use stable lowercase semantic keys
  • prefer meaning over implementation names
  • keep the first tagged surface small and understandable
  • tag important app surfaces, not every node
  • give repeated regions distinct route/context boundaries
  • use standard DOM semantics where possible so tag-only execution stays strong

Useful metadata hints

You can strengthen tag-only behavior with practical DOM hints like:

  • data-cinder-path
  • data-cinder-route-selector
  • aria-current
  • data-cinder-submit="true"
  • accessible labels and placeholders

Common mistakes

Avoid vague keys and weak boundaries

Do not use unstable names like component-4 or styling names like green-button. Also avoid repeated action/output keys across app regions without clear route/context structure.

After tagging

Once the page is tagged:

  1. call await Cinder.scan(document)
  2. inspect Cinder.lastScan()
  3. inspect Cinder.graph()
  4. run a first command before adding bindings or fallback

Continue reading