h2oai/wave

Add @app to the Page Guide

Aberta

#581 aberto em 19 de fev. de 2021

 (3 comentários) (0 reação) (0 responsável)Python (279 forks)batch import
docsgood first issue

Métricas do repositório

Stars
 (3.677 estrelas)
Métricas de merge de PR
 (Mesclagem média 2m) (1 fundiu PR em 30d)

Description

Is your feature request related to a problem? Please describe

The @app('/') feature is explained in the API section of the docs (https://wave.h2o.ai/docs/api/server#app), but is only really find-able if someone is looking for it. When users are on the Pages section of the Guide (https://wave.h2o.ai/docs/pages/) it might be nice for them to explicitly learn about @app() as this is a shortcut for sending apps to a specific page.

Describe the solution you'd like

Add a brief sentence and code snippet to the Pages Guide: https://wave.h2o.ai/docs/pages/

Right after the code for To reference the current page in a Wave app, use q.page.. Here is a first-pass suggestion

image

To reference a specific page in a Wave app, use the `@app(/foo)` decorator

~
@app('/foo')
async def serve(q: Q):
    page = q.page
~

Guia do colaborador