live

filters.live

Pandoc filter for the live dashboard only available in development mode.

Demo

Currently there is no demo avaiable.

Use

For now, all pages in development mode will atleast have the toolbar available. To run in development mode, just use acederbergio serve dev.

Classes

Name Description
FilterLive Since intercepting main an modifying its content is not really
LiveServerConfig Configuration for the server logs page.

FilterLive

filters.live.FilterLive(self, doc=None)

Since intercepting main an modifying its content is not really possible (its parent does not contain the body, and it will be tricky to hunt that down), this filter looks for a div with id=quarto-overlay and replaces it with the full div and some scripts.

Hydrated output should look something like

    <div id='quarto-overlay' class='overlay'>
      <div class='overlay-content'>
        <div id='quarto-overlay-content' class='p-3' >
        </div>
      </div>
    </div>
    <script>...</script>

A few importants notes are:

  • The script will only work if blog/js/live.js is included in the headers.
  • This filter should only modify the content when in dev mode.
  • Metadata providing the filepath should be injected on render from acederbergio/api/quarto.py:Handler.render_qmd.
  • Additional files to watch can be specified in depends_on of the metadata.

The desired functionality is that:

  • The error overlay shows up for failed renders.
  • A banner showing the last render is added for successful renders.
  • The page does not attempt websocket connections in production, since these websockets will not be available.

LiveServerConfig

filters.live.LiveServerConfig()

Configuration for the server logs page.