|
1 |
| -### Demo sites |
| 1 | +--- |
| 2 | +jupyter: |
| 3 | + kernel: python3 |
| 4 | +--- |
2 | 5 |
|
3 |
| -| style | source | layout | |
4 |
| -| ----- | ------ | ------ | |
5 |
| -| [pkgdown] | [github][pkgdown-code] | Index page with a title and short description for functions listed in each section. Each function gets its own documentation page. | |
6 |
| -| [single-page] | [github][sp-code] | Index page has function documentation embedded on it. | |
| 6 | +:::::: {.column-page } |
7 | 7 |
|
8 |
| -### Packages using quartodoc |
9 | 8 |
|
| 9 | +```{python} |
| 10 | +#| output: asis |
| 11 | +#| echo: false |
10 | 12 |
|
11 |
| -| package | source | about | |
12 |
| -| ----- | ------ | ------ | |
13 |
| -| [siuba] | [github][sb-code] | Data analysis library. | |
14 |
| -| [shiny][shiny] | | Dashboarding framework. | |
15 |
| -| [vetiver][vetiver] | [github][vt-code] | A tool to version, share, deploy and monitor ML models. | |
| 13 | +def gallery(entries): |
| 14 | + combined = "\n\n".join(entries) |
16 | 15 |
|
17 |
| -: {tbl-colwidths="[20, 20, 60]"} |
| 16 | + return f":::::: {{.gallery .list .grid}}\n{combined}\n::::::" |
18 | 17 |
|
19 |
| -[pkgdown]: /examples/pkgdown/reference |
20 |
| -[pkgdown-code]: https://github.com/machow/quartodoc/tree/main/examples/pkgdown |
21 |
| -[single-page]: /examples/single-page/reference |
22 |
| -[sp-code]: https://github.com/machow/quartodoc/tree/main/examples/single-page |
23 |
| -[shiny]: https://shiny.rstudio.com/py/api/ |
24 |
| -[vetiver]: https://rstudio.github.io/vetiver-python/stable/reference/ |
25 |
| -[vt-code]: https://github.com/rstudio/vetiver-python |
26 |
| -[siuba]: https://siuba.org/api/ |
27 |
| -[sb-code]: https://github.com/machow/siuba.org |
| 18 | +
|
| 19 | +def gallery_entry(src_thumbnail: str, href: str, title: str, href_ref=None, href_source=None): |
| 20 | + href_ref = href if href_ref is None else href_ref |
| 21 | + href_source = href if href_source is None else href_source |
| 22 | +
|
| 23 | + return f""" |
| 24 | +<div class="card border-2 rounded-3 g-col-12 g-col-sm-12 g-col-md-6 g-col-lg-4 mb-2"> |
| 25 | +<a class="gallery-href" href="{href}"> |
| 26 | + <div class="card-header py-1 px-2 border-bottom border-1 bg-light"> |
| 27 | + <h6>{title}</h6> |
| 28 | + </div> |
| 29 | + <div class="gallery-card-body"> |
| 30 | + <img src="{src_thumbnail}"> |
| 31 | + </div> |
| 32 | + <ul class="gallery-links"> |
| 33 | + <li> |
| 34 | + <a class="view-reference" href="{href_ref}">Reference Page</a> |
| 35 | + </li> |
| 36 | + <li> |
| 37 | + <a class="view-source" href="{href_source}">Source</a> |
| 38 | + </li> |
| 39 | + </ul> |
| 40 | +</a> |
| 41 | +</div> |
| 42 | +""" |
| 43 | +
|
| 44 | +def gallery_entry_cta(): |
| 45 | + href = "https://github.com/machow/quartodoc/discussions/new?category=general&title=New%20Doc%20Site:" |
| 46 | + return f""" |
| 47 | +<div class="gallery-card-cta card border-2 rounded-3 g-col-12 g-col-sm-12 g-col-md-6 g-col-lg-4 mb-2"> |
| 48 | +<a class="gallery-href" href="{href}" target="_blank"> |
| 49 | + Get help creating documentation ⚡️ |
| 50 | +</a> |
| 51 | +</div> |
| 52 | +""" |
| 53 | +
|
| 54 | +print( |
| 55 | + gallery([ |
| 56 | + gallery_entry( |
| 57 | + "images/siuba-home.jpeg", |
| 58 | + "https://siuba.org", |
| 59 | + "Siuba", |
| 60 | + href_ref = "https://siuba.org/api", |
| 61 | + href_source = "https://github.com/machow/siuba.org", |
| 62 | + ), |
| 63 | + gallery_entry( |
| 64 | + "images/pins-home.jpeg", |
| 65 | + "https://rstudio.github.io/pins-python", |
| 66 | + "Pins", |
| 67 | + href_ref = "https://rstudio.github.io/pins-python/reference", |
| 68 | + href_source = "http://github.com/rstudio/pins-python", |
| 69 | + ), |
| 70 | + gallery_entry( |
| 71 | + "images/vetiver-home.jpeg", |
| 72 | + "https://rstudio.github.io/vetiver-python", |
| 73 | + "Vetiver", |
| 74 | + href_ref = "https://rstudio.github.io/vetiver-python/stable/reference", |
| 75 | + href_source = "https://github.com/rstudio/vetiver-python", |
| 76 | + ), |
| 77 | + gallery_entry( |
| 78 | + "images/shiny-home.jpeg", |
| 79 | + "https://shiny.rstudio.com/py/", |
| 80 | + "Shiny", |
| 81 | + href_ref = "https://shiny.rstudio.com/py/api", |
| 82 | + href_source = "https://github.com/rstudio/py-shiny", |
| 83 | + ), |
| 84 | + gallery_entry( |
| 85 | + "images/shinyswatch-home.jpeg", |
| 86 | + "https://rstudio.github.io/py-shinyswatch/", |
| 87 | + "Shinyswatch", |
| 88 | + href_ref = "https://rstudio.github.io/py-shinyswatch/reference", |
| 89 | + href_source = "https://github.com/rstudio/py-shinyswatch", |
| 90 | + ), |
| 91 | + gallery_entry_cta() |
| 92 | + ]) |
| 93 | +) |
| 94 | +``` |
| 95 | + |
| 96 | + |
| 97 | +:::::: |
0 commit comments