-
Notifications
You must be signed in to change notification settings - Fork 100
Create two different api doc folders, one for Core and one for Express #1053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
189807e
Create two different api doc folders, one for Core and one for Express
jcheng5 45d35a6
ex(page_sidebar): remove `@output` decorator
gadenbuie b17f0f6
expressify: api-examples/page_sidebar
gadenbuie 37f1fe9
expressify: api-examples/sidebar
gadenbuie 5ff52bb
expressify: api-examples/layout_column_wrap
gadenbuie efd57b2
expressify: api-examples/layout_columns
gadenbuie 6c09496
expressify: api-examples/layout_sidebar
gadenbuie d941199
expressify: api-examples/markdown
gadenbuie 930759c
expressify: api-examples/panel_absolute
gadenbuie 81f0314
expressify: api-examples/panel_conditional
gadenbuie 4023397
Apply suggestions from code review
gadenbuie 4f602f8
Update shiny/api-examples/panel_conditional/app-express.py
gadenbuie 9c5a87c
Linting
e24d44e
expressify-input-examples (#1057)
147aaa3
Introduce a express/core specific quartodoc renderer
cpsievert fbe7726
First pass at grooming Express function reference
cpsievert a16fbd8
Merge branch 'main' into split-api-docs
cpsievert 3dd8257
Update `@add_examples()` to work with split core/express docs
gadenbuie 5dd552d
Merge branch 'main' into split-api-docs
cpsievert 2b77b14
Merge branch 'docs/expressify/api-examples' into add-examples-express…
gadenbuie c7b2c85
Update doc's `make quartodoc` to make a combined objects.json file
schloerke 42414f7
Merge branch 'split-api-docs' of https://github.com/posit-dev/py-shin…
schloerke c2c3f43
Add `@no_example_express()` re-decorator
gadenbuie 14b0836
Use `@no_example_express()` in a few places
gadenbuie 63b8bf2
Merge branch 'split-api-docs' into add-examples-express-split
gadenbuie f9c9ddd
Rename app.py examples to app-core.py (#1076)
4abf8f7
Expressify reactive examples (#1078)
524fb6a
temp: `add_examples()` warns about missing docs
gadenbuie 20b0dff
don't error in quarto build step if in express docs build
gadenbuie 0d30827
import os
gadenbuie 79543e8
Use shortened description; Only add `...` if title is too long
schloerke 8978926
Add old `output_transformer` to docs
schloerke dbf501a
docs: suspend_display -> ui.hold
schloerke 971b57e
Add docs for `as_fillable_container()`
schloerke 7bb5f33
fix comment
gadenbuie 36094cc
Use first paragraph for summary description
schloerke 03d1e69
don't need gha group around `quartodoc interlinks`
gadenbuie d827837
Merge remote-tracking branch 'origin/split-api-docs' into add-example…
gadenbuie b6c4435
Merge remote-tracking branch 'origin/main' into split-api-docs
gadenbuie 457020d
docs: consolidate renderer back into one file
gadenbuie dfc9a13
split quartodoc target into a series of smaller targets
gadenbuie dacd74e
Add create_doc_example_{core,express}_fixture()
gadenbuie cae09c4
tests: Test all example apps that are `app.py` or start with `app-*.py`
gadenbuie b1a6044
fix poll example
gadenbuie 5123342
temp: ignore sidebar max_height_mobile warning
gadenbuie 37bf76e
Apply suggestions from code review
gadenbuie 2bba14a
improve makefile target list a little more
gadenbuie c50fb2c
One `@no_example()` decorator
gadenbuie 9e53f64
update docstring
gadenbuie 8fd7e50
no_example: rename param `mode`
gadenbuie a119844
remove custom example (we'll come back to this)
gadenbuie 7f001bd
Update docs/_renderer.py
gadenbuie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ _sidebar.yml | |
/.quarto/ | ||
objects.json | ||
site_libs/ | ||
_objects_core.json | ||
_objects_express.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import json | ||
from dataclasses import asdict, dataclass | ||
from typing import Literal, TypedDict | ||
|
||
|
||
@dataclass | ||
class QuartodocObject: | ||
project: str | ||
version: str | ||
count: int | ||
items: list["QuartodocObjectItem"] | ||
|
||
|
||
@dataclass | ||
class QuartodocObjectItem: | ||
name: str | ||
domain: str | ||
|
||
# function: "shiny.ui.page_sidebar" | ||
# class: "shiny.render.renderer._renderer.Renderer" | ||
# attribute: "shiny.render.renderer._renderer.Renderer.output_id" | ||
role: Literal["function", "class", "attribute", "module"] | ||
priority: str | ||
uri: str | ||
dispname: str | ||
|
||
|
||
def read_objects_file(path: str) -> QuartodocObject: | ||
with open(path) as file: | ||
content = json.load(file) | ||
items = [QuartodocObjectItem(**item) for item in content.pop("items")] | ||
return QuartodocObject(**content, items=items) | ||
|
||
|
||
def write_objects_file(objects: QuartodocObject, path: str) -> None: | ||
with open(path, "w") as file: | ||
json.dump(objects, file, indent=4, default=lambda dc: dc.__dict__) | ||
|
||
|
||
print("\nCombining objects json files...") | ||
objects_core = read_objects_file("_objects_core.json") | ||
objects_express = read_objects_file("_objects_express.json") | ||
|
||
items_map: dict[str, QuartodocObjectItem] = {} | ||
|
||
for item in [*objects_core.items, *objects_express.items]: | ||
if item.name in items_map: | ||
continue | ||
items_map[item.name] = item | ||
|
||
objects_ret = QuartodocObject( | ||
project="shiny", | ||
version="1", | ||
count=len(items_map.values()), | ||
items=[*items_map.values()], | ||
) | ||
|
||
|
||
print("Core:", objects_core.count) | ||
print("Express:", objects_express.count) | ||
print("Combined:", objects_ret.count) | ||
|
||
# Save combined objects file info | ||
write_objects_file(objects_ret, "objects.json") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
quartodoc: | ||
style: pkgdown | ||
dir: api/express | ||
out_index: index.qmd | ||
package: shiny | ||
rewrite_all_pages: false | ||
sidebar: api/express/_sidebar.yml | ||
dynamic: true | ||
renderer: | ||
style: _renderer.py | ||
show_signature_annotations: false | ||
sections: | ||
- title: Input components | ||
desc: Gather user input. | ||
contents: | ||
- express.ui.input_select | ||
- express.ui.input_selectize | ||
- express.ui.input_slider | ||
- express.ui.input_date | ||
- express.ui.input_date_range | ||
- express.ui.input_checkbox | ||
- express.ui.input_checkbox_group | ||
- express.ui.input_switch | ||
- express.ui.input_radio_buttons | ||
- express.ui.input_numeric | ||
- express.ui.input_text | ||
- express.ui.input_text_area | ||
- express.ui.input_password | ||
- express.ui.input_action_button | ||
- express.ui.input_action_link | ||
- title: Output components | ||
desc: Reactively render output. | ||
contents: | ||
- express.render.plot | ||
- express.render.table | ||
- express.render.DataTable | ||
- express.render.data_frame | ||
- express.render.DataGrid | ||
- express.render.text | ||
- express.render.ui | ||
- express.render.download | ||
- express.render.image | ||
- express.render.express | ||
- title: Layouts and other UI tools | ||
desc: Tools for creating, arranging, and styling UI components. | ||
contents: | ||
- express.ui.page_opts | ||
- express.ui.sidebar | ||
- express.ui.layout_columns | ||
- express.ui.layout_column_wrap | ||
- express.ui.card | ||
- express.ui.card_header | ||
- express.ui.card_footer | ||
- express.ui.value_box | ||
- express.ui.value_box_theme | ||
- express.ui.popover | ||
- express.ui.tooltip | ||
- express.ui.accordion | ||
- express.ui.accordion_panel | ||
- express.ui.layout_sidebar | ||
- title: Navigate multiple panels | ||
desc: Create a set of panels that can be navigated between. | ||
contents: | ||
- express.ui.nav_panel | ||
- express.ui.navset_card_underline | ||
- express.ui.navset_card_tab | ||
- express.ui.navset_card_pill | ||
- express.ui.nav_spacer | ||
- express.ui.nav_menu | ||
- express.ui.nav_control | ||
- express.ui.navset_bar | ||
- express.ui.navset_tab | ||
- express.ui.navset_pill | ||
- express.ui.navset_underline | ||
- express.ui.navset_pill_list | ||
- express.ui.navset_hidden | ||
- title: Reactive programming | ||
desc: Create reactive functions and dependencies. | ||
contents: | ||
- reactive.calc | ||
- reactive.effect | ||
- reactive.value | ||
- reactive.event | ||
- reactive.isolate | ||
- reactive.invalidate_later | ||
- reactive.flush | ||
- reactive.poll | ||
- reactive.file_reader | ||
- reactive.lock | ||
- req | ||
- title: Reusable Express code | ||
desc: Create reusable Express code. | ||
contents: | ||
- express.ui.hold | ||
- express.expressify | ||
- title: Update inputs | ||
desc: Programmatically update input values. | ||
contents: | ||
- name: express.ui.update_select | ||
dynamic: true | ||
- name: express.ui.update_selectize | ||
dynamic: true | ||
- name: express.ui.update_slider | ||
dynamic: true | ||
- ui.update_date | ||
- name: express.ui.update_date_range | ||
dynamic: true | ||
- name: express.ui.update_checkbox | ||
dynamic: true | ||
- name: express.ui.update_checkbox_group | ||
dynamic: true | ||
- name: express.ui.update_switch | ||
dynamic: true | ||
- name: express.ui.update_radio_buttons | ||
dynamic: true | ||
- name: express.ui.update_numeric | ||
dynamic: true | ||
- ui.update_text | ||
- name: express.ui.update_text_area | ||
dynamic: "shiny.ui.update_text" | ||
- name: express.ui.update_navs | ||
dynamic: true | ||
- title: Update UI Layouts | ||
desc: "" | ||
contents: | ||
- express.ui.update_sidebar | ||
- express.ui.update_tooltip | ||
- express.ui.update_popover | ||
- express.ui.update_accordion | ||
- express.ui.update_accordion_panel | ||
- express.ui.insert_accordion_panel | ||
- express.ui.remove_accordion_panel | ||
- title: Display messages | ||
desc: Display messages to the user. | ||
contents: | ||
- express.ui.help_text | ||
- express.ui.notification_show | ||
- express.ui.notification_remove | ||
- express.ui.modal | ||
- express.ui.modal_show | ||
- express.ui.modal_remove | ||
- express.ui.modal_button | ||
- express.ui.Progress # uses class.rst | ||
- title: UI panels | ||
desc: Visually group together a section of UI components. | ||
contents: | ||
- express.ui.panel_absolute | ||
- express.ui.panel_fixed | ||
- express.ui.panel_title | ||
- express.ui.panel_well | ||
- title: Dynamic UI | ||
desc: Dynamically show/hide UI elements. | ||
contents: | ||
- express.ui.panel_conditional | ||
- express.ui.insert_ui | ||
- express.ui.remove_ui | ||
- title: UI as HTML | ||
desc: Tools for creating HTML/CSS/JS | ||
contents: | ||
- express.ui.markdown | ||
- express.ui.include_css | ||
- express.ui.include_js | ||
- express.ui.HTML # uses justattributes.rst template | ||
- name: express.ui.tags # uses tags.rst template | ||
children: embedded | ||
- express.ui.TagList # uses class.rst template | ||
# TODO: should these be included? | ||
# - express.ui.fill.as_fillable_container | ||
# - express.ui.fill.as_fill_item | ||
# - express.ui.fill.remove_all_fill | ||
# - express.ui.css.as_css_unit | ||
# - express.ui.css.as_css_padding | ||
- title: Express developer tooling | ||
desc: | ||
contents: | ||
- express.is_express_app | ||
- express.wrap_express_app |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@schloerke is it useful to keep these around? Or should we remove them as a part of
python _combine_objects_json.py
?