From bf98517220eaa1e340d4c50116d98adead8b9883 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 27 Aug 2024 17:17:48 -0400 Subject: [PATCH 1/4] docs: Add R package docs to shinymedia quarto website --- quarto/Makefile | 17 +- quarto/_quarto.yml | 20 +- quarto/_sidebar-python.yml | 10 + quarto/_sidebar-r.yml | 10 + quarto/_sidebar.yml | 10 - quarto/build-r-package-docs.R | 161 +++++++++++ quarto/index.qmd | 2 +- quarto/objects.json | 2 +- quarto/objects.txt | 8 +- quarto/reference/index.qmd | 32 ++- quarto/reference/python-logo.svg | 265 ++++++++++++++++++ .../reference/{ => python}/audio_spinner.qmd | 0 quarto/reference/python/index.qmd | 10 + .../{ => python}/input_video_clip.qmd | 0 quarto/reference/r-logo.svg | 14 + quarto/reference/r/audio_spinner.qmd | 67 +++++ quarto/reference/r/index.qmd | 10 + quarto/reference/r/input_video_clip.qmd | 39 +++ quarto/reference/r/multimodal_dep.qmd | 15 + quarto/styles.scss | 38 +++ 20 files changed, 700 insertions(+), 30 deletions(-) create mode 100644 quarto/_sidebar-python.yml create mode 100644 quarto/_sidebar-r.yml delete mode 100644 quarto/_sidebar.yml create mode 100755 quarto/build-r-package-docs.R create mode 100644 quarto/reference/python-logo.svg rename quarto/reference/{ => python}/audio_spinner.qmd (100%) create mode 100644 quarto/reference/python/index.qmd rename quarto/reference/{ => python}/input_video_clip.qmd (100%) create mode 100644 quarto/reference/r-logo.svg create mode 100644 quarto/reference/r/audio_spinner.qmd create mode 100644 quarto/reference/r/index.qmd create mode 100644 quarto/reference/r/input_video_clip.qmd create mode 100644 quarto/reference/r/multimodal_dep.qmd create mode 100644 quarto/styles.scss diff --git a/quarto/Makefile b/quarto/Makefile index 585fd91..ac05645 100644 --- a/quarto/Makefile +++ b/quarto/Makefile @@ -1,3 +1,16 @@ -docs: +docs: docs-python docs-r docs-render + +docs-python: quartodoc build - quarto render \ No newline at end of file + +docs-r: + ./build-r-package-docs.R + cp reference/python/index.qmd reference/r/index.qmd + @sed -i '' 's/Python Package/R Package/g' reference/r/index.qmd + @sed -i '' 's/#shinymedia[.][^)]+//g' reference/r/index.qmd + +docs-render: + quarto render + +docs-preview: docs-python docs-r + quarto preview diff --git a/quarto/_quarto.yml b/quarto/_quarto.yml index 676c75a..fbeb962 100644 --- a/quarto/_quarto.yml +++ b/quarto/_quarto.yml @@ -3,9 +3,11 @@ project: resources: - "lib/" - "mp3/" + - "r/" metadata-files: - - _sidebar.yml + - _sidebar-python.yml + - _sidebar-r.yml filters: - interlinks @@ -18,12 +20,22 @@ website: left: - text: "Home" href: index.qmd - - reference/index.qmd + - text: "Reference" + menu: + - text: "Python" + href: reference/python/index.qmd + - text: "R" + href: reference/r/index.qmd + right: - icon: github href: https://github.com/posit-dev/shinymedia aria-label: GitHub repository +format: + html: + theme: [default, styles.scss] + interlinks: fast: true sources: @@ -33,8 +45,10 @@ interlinks: quartodoc: package: shinymedia + dir: reference/python render_interlinks: true - sidebar: _sidebar.yml + sidebar: _sidebar-python.yml + title: "Python Package Reference" sections: - title: Media components desc: Components to be used with Shiny for media capture/playback. diff --git a/quarto/_sidebar-python.yml b/quarto/_sidebar-python.yml new file mode 100644 index 0000000..cd715ba --- /dev/null +++ b/quarto/_sidebar-python.yml @@ -0,0 +1,10 @@ +website: + sidebar: + - contents: + - reference/python/index.qmd + - contents: + - reference/python/input_video_clip.qmd + - reference/python/audio_spinner.qmd + section: Media components + id: reference/python + - id: dummy-sidebar diff --git a/quarto/_sidebar-r.yml b/quarto/_sidebar-r.yml new file mode 100644 index 0000000..83c42fc --- /dev/null +++ b/quarto/_sidebar-r.yml @@ -0,0 +1,10 @@ +website: + sidebar: + - contents: + - reference/r/index.qmd + - contents: + - reference/r/input_video_clip.qmd + - reference/r/audio_spinner.qmd + section: Media components + id: r + - id: dummy-sidebar diff --git a/quarto/_sidebar.yml b/quarto/_sidebar.yml deleted file mode 100644 index a19dbc4..0000000 --- a/quarto/_sidebar.yml +++ /dev/null @@ -1,10 +0,0 @@ -website: - sidebar: - - contents: - - reference/index.qmd - - contents: - - reference/input_video_clip.qmd - - reference/audio_spinner.qmd - section: Media components - id: reference - - id: dummy-sidebar diff --git a/quarto/build-r-package-docs.R b/quarto/build-r-package-docs.R new file mode 100755 index 0000000..9f9cf5e --- /dev/null +++ b/quarto/build-r-package-docs.R @@ -0,0 +1,161 @@ +#!/usr/bin/env Rscript + +stopifnot( + "Requires R 4.4.1+" = getRversion() >= package_version("4.4.0"), + "Requires the {pandoc} package" = requireNamespace("pandoc", quietly = TRUE), + "Requires the {rvest} package" = requireNamespace("rvest", quietly = TRUE), + "Requires the {xml2} package" = requireNamespace("xml2", quietly = TRUE), + "Requires the {yaml} package" = requireNamespace("yaml", quietly = TRUE) +) + +# Use new pkg2HTML() from R 4.4.1 to create a single-page reference doc +con <- textConnection("r_package_docs", open = "w") +tools::pkg2HTML( + "shinymedia", + "../r-package", + out = con, + toc_entry = "name", + include_description = FALSE, + prism = FALSE, + stylesheet = "" +) +close(con) + +collapse <- function(x) paste(x, collapse = "\n") + +# Move into XML so we can manipulate the singe-page docs. We're going to do a +# bit of cleanup to fixup the HTML, then go through several rounds of pandoc +# conversion to extract each function section individually. +html <- rvest::read_html(paste(r_package_docs, collapse = "\n")) + +# Remove empty elements +html |> + rvest::html_nodes("span[id^='topic']") |> + xml2::xml_remove() + +# Arguments in the argument tables have anchors, but they're include a mis-coded +# `":"`. Also pandoc does weird things with bar so we +# rewrite these as bar. +arg_blocks <- + html |> + rvest::html_nodes("code[id]") |> + xml2::xml_set_name("span") + +for (arg in arg_blocks) { + arg_id <- + arg |> + rvest::html_attr("id") |> + sub("_+3A_", "_", x = _, fixed = TRUE) |> + sub("...", "dotdotdot", x = _, fixed = TRUE) + + xml2::xml_set_attr(arg, "id", arg_id) + arg_text <- arg |> rvest::html_text() + xml2::xml_set_text(arg, "") + xml2::xml_add_child(arg, xml2::read_xml(sprintf("%s", arg_text))) +} + +# First round of HTML -> commonmark -> HTML to clean up the structure and to +# take advantage of pandoc's section divs feature. This wraps sections created +# by

elements in a
and we'll use this to easily +# split up the single-page doc into multiple pages. +html_text <- + html |> + rvest::html_node("body") |> + rvest::html_children() |> + as.character() + +html_pandoc <- + pandoc::pandoc_convert( + text = html_text, + from = "html", + to = "commonmark_x" + ) |> + pandoc::pandoc_convert( + text = _, + from = "commonmark_x", + to = "html5", + args = c("--section-divs") + ) + +# Now we can separate the single-page doc into one page per function/topic. +html_sections <- + html_pandoc |> + collapse() |> + rvest::read_html() |> + rvest::html_nodes("section.level2:not(#contents)") + +for (section in html_sections) { + # Extract the section ID and title from the
and

element, then + # discard them. + section_id <- section |> rvest::html_attr("id") + section_title <- section |> rvest::html_node("h2") |> rvest::html_text() + + section |> rvest::html_node("h2") |> xml2::xml_remove() + section |> rvest::html_nodes("hr") |> xml2::xml_remove() + + for (node in rvest::html_nodes(section, "div.sourceCode")) { + # replace "div.sourceCode#cbN" blocks with their children + after <- node + for (child_node in xml2::xml_children(node)) { + xml2::xml_add_sibling(after, child_node) + after <- child_node + } + xml2::xml_remove(node) + } + + for (node in rvest::html_nodes(section, ".sourceCode")) { + # Clean up .sourceCode elements for nicer markdown + xml2::xml_set_attr( + node, + "class", + sub("sourceCode", "", xml2::xml_attr(node, "class")) + ) + } + + # We used

to define the page-level heading, so move all others up one, + # i.e.

-->

, etc. + heading_levels <- c("h2", "h3", "h4", "h5", "h6") + for (i in seq_along(heading_levels)[-1]) { + h_up <- heading_levels[i] + h_down <- heading_levels[i - 1] + heading_nodes <- rvest::html_nodes(section, h_up) + for (node in heading_nodes) { + xml2::xml_set_name(node, h_down) + } + } + + # Now we'll get rid of the
containers since they've served their + # purpose and would otherwise clutter the markup with unnecessary divs. + contents <- xml2::xml_new_document() + for (node in rvest::html_nodes(section, "section")) { + for (child_node in rvest::html_children(node)) { + xml2::xml_add_child(contents, child_node) + } + } + + # Final conversion to markdown (commonmark_x == commonmark with extensions) + section_pandoc <- + pandoc::pandoc_convert( + text = as.character(contents), + from = "html", + to = "commonmark_x" + ) + + if (!dir.exists("reference/r")) { + dir.create("reference/r", FALSE, recursive = TRUE) + } + + writeLines( + c( + "---", + yaml::as.yaml(list( + title = sprintf("`%s`", section_id), + subtitle = section_title + )), + "---", + "", + section_pandoc + ), + paste0("reference/r/", section_id, ".qmd") + ) +} \ No newline at end of file diff --git a/quarto/index.qmd b/quarto/index.qmd index e0d218e..8b7a7fd 100644 --- a/quarto/index.qmd +++ b/quarto/index.qmd @@ -121,7 +121,7 @@ audio_spinner( ::: -There are many options for customizing the appearance and behavior of the spinner. Here is an example with a dark background, faster rotation, more blades, and a thinner stroke. See the [reference docs](reference/audio_spinner.qmd) for more information on these and other options. +There are many options for customizing the appearance and behavior of the spinner. Here is an example with a dark background, faster rotation, more blades, and a thinner stroke. See the reference docs for [Python](reference/python/audio_spinner.qmd) or [R](reference/r/audio_spinner.qmd) for more information on these and other options. ::: {.panel-tabset group="lang"} diff --git a/quarto/objects.json b/quarto/objects.json index a26fbfd..2adf03c 100644 --- a/quarto/objects.json +++ b/quarto/objects.json @@ -1 +1 @@ -{"project": "shinymedia", "version": "0.0.9999", "count": 4, "items": [{"name": "shinymedia.input_video_clip", "domain": "py", "role": "function", "priority": "1", "uri": "reference/input_video_clip.html#shinymedia.input_video_clip", "dispname": "-"}, {"name": "shinymedia.ui.input_video_clip", "domain": "py", "role": "function", "priority": "1", "uri": "reference/input_video_clip.html#shinymedia.input_video_clip", "dispname": "shinymedia.input_video_clip"}, {"name": "shinymedia.audio_spinner", "domain": "py", "role": "function", "priority": "1", "uri": "reference/audio_spinner.html#shinymedia.audio_spinner", "dispname": "-"}, {"name": "shinymedia.ui.audio_spinner", "domain": "py", "role": "function", "priority": "1", "uri": "reference/audio_spinner.html#shinymedia.audio_spinner", "dispname": "shinymedia.audio_spinner"}]} \ No newline at end of file +{"project": "shinymedia", "version": "0.0.9999", "count": 4, "items": [{"name": "shinymedia.input_video_clip", "domain": "py", "role": "function", "priority": "1", "uri": "reference/python/input_video_clip.html#shinymedia.input_video_clip", "dispname": "-"}, {"name": "shinymedia.ui.input_video_clip", "domain": "py", "role": "function", "priority": "1", "uri": "reference/python/input_video_clip.html#shinymedia.input_video_clip", "dispname": "shinymedia.input_video_clip"}, {"name": "shinymedia.audio_spinner", "domain": "py", "role": "function", "priority": "1", "uri": "reference/python/audio_spinner.html#shinymedia.audio_spinner", "dispname": "-"}, {"name": "shinymedia.ui.audio_spinner", "domain": "py", "role": "function", "priority": "1", "uri": "reference/python/audio_spinner.html#shinymedia.audio_spinner", "dispname": "shinymedia.audio_spinner"}]} \ No newline at end of file diff --git a/quarto/objects.txt b/quarto/objects.txt index 21a81af..dae1d56 100644 --- a/quarto/objects.txt +++ b/quarto/objects.txt @@ -2,7 +2,7 @@ # Project: shinymedia # Version: 0.0.9999 # The remainder of this file is compressed using zlib. -shinymedia.input_video_clip py:function 1 reference/input_video_clip.html#shinymedia.input_video_clip - -shinymedia.ui.input_video_clip py:function 1 reference/input_video_clip.html#shinymedia.input_video_clip shinymedia.input_video_clip -shinymedia.audio_spinner py:function 1 reference/audio_spinner.html#shinymedia.audio_spinner - -shinymedia.ui.audio_spinner py:function 1 reference/audio_spinner.html#shinymedia.audio_spinner shinymedia.audio_spinner +shinymedia.input_video_clip py:function 1 reference/python/input_video_clip.html#shinymedia.input_video_clip - +shinymedia.ui.input_video_clip py:function 1 reference/python/input_video_clip.html#shinymedia.input_video_clip shinymedia.input_video_clip +shinymedia.audio_spinner py:function 1 reference/python/audio_spinner.html#shinymedia.audio_spinner - +shinymedia.ui.audio_spinner py:function 1 reference/python/audio_spinner.html#shinymedia.audio_spinner shinymedia.audio_spinner diff --git a/quarto/reference/index.qmd b/quarto/reference/index.qmd index 46072de..287d163 100644 --- a/quarto/reference/index.qmd +++ b/quarto/reference/index.qmd @@ -1,10 +1,24 @@ -# Function reference {.doc .doc-index} +--- +title: Function Reference +--- -## Media components - -Components to be used with Shiny for media capture/playback. - -| | | -| --- | --- | -| [input_video_clip](input_video_clip.qmd#shinymedia.input_video_clip) | A video clip input control that records short videos from webcam. | -| [audio_spinner](audio_spinner.qmd#shinymedia.audio_spinner) | Create an audio spinner. | \ No newline at end of file +```{=html} +
+
+ + + + +
+
+``` \ No newline at end of file diff --git a/quarto/reference/python-logo.svg b/quarto/reference/python-logo.svg new file mode 100644 index 0000000..467b07b --- /dev/null +++ b/quarto/reference/python-logo.svg @@ -0,0 +1,265 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/quarto/reference/audio_spinner.qmd b/quarto/reference/python/audio_spinner.qmd similarity index 100% rename from quarto/reference/audio_spinner.qmd rename to quarto/reference/python/audio_spinner.qmd diff --git a/quarto/reference/python/index.qmd b/quarto/reference/python/index.qmd new file mode 100644 index 0000000..d6e0e2b --- /dev/null +++ b/quarto/reference/python/index.qmd @@ -0,0 +1,10 @@ +# Python Package Reference {.doc .doc-index} + +## Media components + +Components to be used with Shiny for media capture/playback. + +| | | +| --- | --- | +| [input_video_clip](input_video_clip.qmd#shinymedia.input_video_clip) | A video clip input control that records short videos from webcam. | +| [audio_spinner](audio_spinner.qmd#shinymedia.audio_spinner) | Create an audio spinner. | \ No newline at end of file diff --git a/quarto/reference/input_video_clip.qmd b/quarto/reference/python/input_video_clip.qmd similarity index 100% rename from quarto/reference/input_video_clip.qmd rename to quarto/reference/python/input_video_clip.qmd diff --git a/quarto/reference/r-logo.svg b/quarto/reference/r-logo.svg new file mode 100644 index 0000000..78281f7 --- /dev/null +++ b/quarto/reference/r-logo.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/quarto/reference/r/audio_spinner.qmd b/quarto/reference/r/audio_spinner.qmd new file mode 100644 index 0000000..0d551b9 --- /dev/null +++ b/quarto/reference/r/audio_spinner.qmd @@ -0,0 +1,67 @@ +--- +title: '`audio_spinner`' +subtitle: Create an audio spinner + +--- + +## Description + +Create an audio spinner + +## Usage + +``` R +audio_spinner( + ..., + src = NULL, + con = NULL, + rpm = 10, + gap = pi/5, + stroke = 2.5, + min_radius = 30, + radius_compression = 0.8, + radius_overscan = 1.1, + steps = 2, + blades = 3, + width = "125px", + height = "125px", + autoplay = TRUE, + autodismiss = FALSE, + class = "mx-auto" +) +``` + +## Arguments + +| | | +|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [`...`]{#audio_spinner_dotdotdot} | Additional attributes for the spinner, to be added directly to the `⁠⁠`{style="white-space: pre;"} element. | +| [`src`]{#audio_spinner_src} | The source URL or URI for the audio file. This should be used for remote resources or data URIs. If provided, this takes precedence over `con`. | +| [`con`]{#audio_spinner_con} | An optional connection object or file path for local audio files. This is ignored if `src` is provided. Use this for reading local files securely. | +| [`rpm`]{#audio_spinner_rpm} | The speed of the spinner, in clockwise revolutions per minute. Default is 10 RPM. Use 0 to disable rotation, or a negative value to rotate counter-clockwise. | +| [`gap`]{#audio_spinner_gap} | The gap between the blades of the spinner, in radians. Default is pi/5, or 36°. | +| [`stroke`]{#audio_spinner_stroke} | The stroke thickness of the individual arcs that make up each blade of the spinner, in pixels. Default is 2.5. | +| [`min_radius`]{#audio_spinner_min_radius} | The radius of the spinner when there is only silence, in pixels. Default is 30. | +| [`radius_compression`]{#audio_spinner_radius_compression} | The raw `⁠[-1, 1]⁠`{style="white-space: pre;"} amplitude of the audio is compressed using `x^radius_compression` to make the spinner more responsive to quiet sounds. Default is 0.8. Set to 1.0 to disable compression. (Note that this only affects the visualization, not the audio playback.) | +| [`radius_overscan`]{#audio_spinner_radius_overscan} | Use this parameter to set the maximum possible radius of the spinner, relative to the width/height of the container. Default is 1.1, meaning the spinner radius will be scaled such that at maximum amplitude, it will be 10% larger than the container (the spinner blades will be clipped). Use larger values if you\'re expecting generally quiet audio. | +| [`steps`]{#audio_spinner_steps} | The number of concentric arcs that make up each blade of the spinner, not including the central circle. Default is 2. | +| [`blades`]{#audio_spinner_blades} | The number of blades in the spinner. Default is 3. Set to 0 to use concentric circles instead of blades. | +| [`width`]{#audio_spinner_width} | The width of the spinner in CSS units. Default is \"125px\". | +| [`height`]{#audio_spinner_height} | The height of the spinner in CSS units. Default is \"125px\". | +| [`autoplay`]{#audio_spinner_autoplay} | Whether to autoplay the audio. Default is TRUE. Note that many browsers will not allow autoplaying audio without user interaction; if autoplay fails, the spinner will show a tooltip instructing the user to tap or click to start the audio. | +| [`autodismiss`]{#audio_spinner_autodismiss} | Whether to remove the spinner after the audio finishes playing. Default is FALSE. | +| [`class`]{#audio_spinner_class} | The class of the spinner. Default is \"mx-auto\" which horizontally centers the element inside its container (assuming Bootstrap is loaded). | + +## Value + +An HTML tag object representing the audio spinner. + +## Examples + +``` R +# Using a URL +audio_spinner(src = "https://example.com/audio.mp3", rpm = 15, width = "200px", height = "200px") + +# Using a local file +audio_spinner(con = "path/to/local/audio.mp3", rpm = 20, width = "150px", height = "150px") +``` diff --git a/quarto/reference/r/index.qmd b/quarto/reference/r/index.qmd new file mode 100644 index 0000000..062e729 --- /dev/null +++ b/quarto/reference/r/index.qmd @@ -0,0 +1,10 @@ +# R Package Reference {.doc .doc-index} + +## Media components + +Components to be used with Shiny for media capture/playback. + +| | | +| --- | --- | +| [input_video_clip](input_video_clip.qmd#shinymedia.input_video_clip) | A video clip input control that records short videos from webcam. | +| [audio_spinner](audio_spinner.qmd#shinymedia.audio_spinner) | Create an audio spinner. | \ No newline at end of file diff --git a/quarto/reference/r/input_video_clip.qmd b/quarto/reference/r/input_video_clip.qmd new file mode 100644 index 0000000..25ce14b --- /dev/null +++ b/quarto/reference/r/input_video_clip.qmd @@ -0,0 +1,39 @@ +--- +title: '`input_video_clip`' +subtitle: |- + A video clip input control that records short videos from + webcam + +--- + +## Description + +A video clip input control that records short videos from webcam + +## Usage + +``` R +input_video_clip( + inputId, + reset_on_record = TRUE, + mime_type = NULL, + video_bits_per_second = NULL, + audio_bits_per_second = NULL, + ... +) +``` + +## Arguments + +| | | +|--------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [`inputId`]{#input_video_clip_inputid} | The input slot that will be used to access the value. | +| [`reset_on_record`]{#input_video_clip_reset_on_record} | Whether to reset the video clip input value when recording starts. If TRUE, the video clip input value will become NULL at the moment the Record button is pressed; if FALSE, the value will not change until the user stops recording. Default is TRUE. | +| [`mime_type`]{#input_video_clip_mime_type} | The MIME type of the video clip to record. By default, this is NULL, which means the browser will choose a suitable MIME type for video recording. Common MIME types include \'video/webm\' and \'video/x-matroska\'. | +| [`video_bits_per_second`]{#input_video_clip_video_bits_per_second} | The target video bitrate in bits per second. By default, this is NULL, which means the browser will choose a suitable bitrate for video recording (according to the spec, 2,500,000). This is only a suggestion; the browser may choose a different bitrate. | +| [`audio_bits_per_second`]{#input_video_clip_audio_bits_per_second} | The target audio bitrate in bits per second. By default, this is NULL, which means the browser will choose a suitable bitrate for audio recording. This is only a suggestion; the browser may choose a different bitrate. | +| [`...`]{#input_video_clip_dotdotdot} | Additional parameters to pass to the underlying HTML tag. | + +## Value + +A video clip input control that can be added to a UI definition. diff --git a/quarto/reference/r/multimodal_dep.qmd b/quarto/reference/r/multimodal_dep.qmd new file mode 100644 index 0000000..6bc4cc3 --- /dev/null +++ b/quarto/reference/r/multimodal_dep.qmd @@ -0,0 +1,15 @@ +--- +title: '`multimodal_dep`' +subtitle: Create HTML dependency for multimodal component + +--- + +## Description + +Create HTML dependency for multimodal component + +## Usage + +``` R +multimodal_dep() +``` diff --git a/quarto/styles.scss b/quarto/styles.scss new file mode 100644 index 0000000..369bf02 --- /dev/null +++ b/quarto/styles.scss @@ -0,0 +1,38 @@ +/*-- scss:rules --*/ +.card.card-as-link { + position: relative; + + /* Expand the link to fill the entire card */ + a.card-primary-link:before { + content: ""; + position: absolute; + top: 0; + bottom: 0; + right: 0; + left: 0; + } + + // NOTE: maybe should swap :before and :after to ensure the arrow is + // top-aligned when used in headers. + a.card-primary-link:after { + content: ' \2192'; + display: inline-block; + margin-left: 0.25rem; + transition: transform 200ms ease-in-out; + } + + a.card-primary-link.card-header-link:after { + position: absolute; + right: var(--bs-card-spacer-x, 1rem); + } + + &:hover a.card-primary-link:after { + transform: translateX(5px); + } +} + +.card-img-logo { + margin-inline: auto; + max-height: 200px; + max-width: 200px; +} \ No newline at end of file From 229a4e5bd6c65adc9cf3e9a8bd8c01b4c9779cdb Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 27 Aug 2024 20:19:51 -0400 Subject: [PATCH 2/4] chore: move docs to `docs/` folder --- .github/workflows/publish.yml | 2 +- {quarto => docs}/.gitignore | 0 {quarto => docs}/Makefile | 0 .../_extensions/machow/interlinks/.gitignore | 0 .../_extensions/machow/interlinks/_extension.yml | 0 .../_extensions/machow/interlinks/interlinks.lua | 0 {quarto => docs}/_quarto.yml | 0 {quarto => docs}/_sidebar-python.yml | 0 {quarto => docs}/_sidebar-r.yml | 0 {quarto => docs}/build-r-package-docs.R | 0 {quarto => docs}/index.qmd | 0 {quarto => docs}/lib/shinymedia/index.css | 0 {quarto => docs}/lib/shinymedia/index.js | 0 ...essaisurlesrevolutions_00_chateaubriand_64kb.mp3 | Bin {quarto => docs}/objects.json | 0 {quarto => docs}/objects.txt | 0 {quarto => docs}/reference/index.qmd | 0 {quarto => docs}/reference/python-logo.svg | 0 {quarto => docs}/reference/python/audio_spinner.qmd | 0 {quarto => docs}/reference/python/index.qmd | 0 .../reference/python/input_video_clip.qmd | 0 {quarto => docs}/reference/r-logo.svg | 0 {quarto => docs}/reference/r/audio_spinner.qmd | 0 {quarto => docs}/reference/r/index.qmd | 0 {quarto => docs}/reference/r/input_video_clip.qmd | 0 {quarto => docs}/reference/r/multimodal_dep.qmd | 0 {quarto => docs}/styles.scss | 0 27 files changed, 1 insertion(+), 1 deletion(-) rename {quarto => docs}/.gitignore (100%) rename {quarto => docs}/Makefile (100%) rename {quarto => docs}/_extensions/machow/interlinks/.gitignore (100%) rename {quarto => docs}/_extensions/machow/interlinks/_extension.yml (100%) rename {quarto => docs}/_extensions/machow/interlinks/interlinks.lua (100%) rename {quarto => docs}/_quarto.yml (100%) rename {quarto => docs}/_sidebar-python.yml (100%) rename {quarto => docs}/_sidebar-r.yml (100%) rename {quarto => docs}/build-r-package-docs.R (100%) rename {quarto => docs}/index.qmd (100%) rename {quarto => docs}/lib/shinymedia/index.css (100%) rename {quarto => docs}/lib/shinymedia/index.js (100%) rename {quarto => docs}/mp3/essaisurlesrevolutions_00_chateaubriand_64kb.mp3 (100%) rename {quarto => docs}/objects.json (100%) rename {quarto => docs}/objects.txt (100%) rename {quarto => docs}/reference/index.qmd (100%) rename {quarto => docs}/reference/python-logo.svg (100%) rename {quarto => docs}/reference/python/audio_spinner.qmd (100%) rename {quarto => docs}/reference/python/index.qmd (100%) rename {quarto => docs}/reference/python/input_video_clip.qmd (100%) rename {quarto => docs}/reference/r-logo.svg (100%) rename {quarto => docs}/reference/r/audio_spinner.qmd (100%) rename {quarto => docs}/reference/r/index.qmd (100%) rename {quarto => docs}/reference/r/input_video_clip.qmd (100%) rename {quarto => docs}/reference/r/multimodal_dep.qmd (100%) rename {quarto => docs}/styles.scss (100%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9fa61c2..ae79534 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,6 +43,6 @@ jobs: uses: quarto-dev/quarto-actions/publish@v2 with: target: gh-pages - path: quarto + path: docs env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/quarto/.gitignore b/docs/.gitignore similarity index 100% rename from quarto/.gitignore rename to docs/.gitignore diff --git a/quarto/Makefile b/docs/Makefile similarity index 100% rename from quarto/Makefile rename to docs/Makefile diff --git a/quarto/_extensions/machow/interlinks/.gitignore b/docs/_extensions/machow/interlinks/.gitignore similarity index 100% rename from quarto/_extensions/machow/interlinks/.gitignore rename to docs/_extensions/machow/interlinks/.gitignore diff --git a/quarto/_extensions/machow/interlinks/_extension.yml b/docs/_extensions/machow/interlinks/_extension.yml similarity index 100% rename from quarto/_extensions/machow/interlinks/_extension.yml rename to docs/_extensions/machow/interlinks/_extension.yml diff --git a/quarto/_extensions/machow/interlinks/interlinks.lua b/docs/_extensions/machow/interlinks/interlinks.lua similarity index 100% rename from quarto/_extensions/machow/interlinks/interlinks.lua rename to docs/_extensions/machow/interlinks/interlinks.lua diff --git a/quarto/_quarto.yml b/docs/_quarto.yml similarity index 100% rename from quarto/_quarto.yml rename to docs/_quarto.yml diff --git a/quarto/_sidebar-python.yml b/docs/_sidebar-python.yml similarity index 100% rename from quarto/_sidebar-python.yml rename to docs/_sidebar-python.yml diff --git a/quarto/_sidebar-r.yml b/docs/_sidebar-r.yml similarity index 100% rename from quarto/_sidebar-r.yml rename to docs/_sidebar-r.yml diff --git a/quarto/build-r-package-docs.R b/docs/build-r-package-docs.R similarity index 100% rename from quarto/build-r-package-docs.R rename to docs/build-r-package-docs.R diff --git a/quarto/index.qmd b/docs/index.qmd similarity index 100% rename from quarto/index.qmd rename to docs/index.qmd diff --git a/quarto/lib/shinymedia/index.css b/docs/lib/shinymedia/index.css similarity index 100% rename from quarto/lib/shinymedia/index.css rename to docs/lib/shinymedia/index.css diff --git a/quarto/lib/shinymedia/index.js b/docs/lib/shinymedia/index.js similarity index 100% rename from quarto/lib/shinymedia/index.js rename to docs/lib/shinymedia/index.js diff --git a/quarto/mp3/essaisurlesrevolutions_00_chateaubriand_64kb.mp3 b/docs/mp3/essaisurlesrevolutions_00_chateaubriand_64kb.mp3 similarity index 100% rename from quarto/mp3/essaisurlesrevolutions_00_chateaubriand_64kb.mp3 rename to docs/mp3/essaisurlesrevolutions_00_chateaubriand_64kb.mp3 diff --git a/quarto/objects.json b/docs/objects.json similarity index 100% rename from quarto/objects.json rename to docs/objects.json diff --git a/quarto/objects.txt b/docs/objects.txt similarity index 100% rename from quarto/objects.txt rename to docs/objects.txt diff --git a/quarto/reference/index.qmd b/docs/reference/index.qmd similarity index 100% rename from quarto/reference/index.qmd rename to docs/reference/index.qmd diff --git a/quarto/reference/python-logo.svg b/docs/reference/python-logo.svg similarity index 100% rename from quarto/reference/python-logo.svg rename to docs/reference/python-logo.svg diff --git a/quarto/reference/python/audio_spinner.qmd b/docs/reference/python/audio_spinner.qmd similarity index 100% rename from quarto/reference/python/audio_spinner.qmd rename to docs/reference/python/audio_spinner.qmd diff --git a/quarto/reference/python/index.qmd b/docs/reference/python/index.qmd similarity index 100% rename from quarto/reference/python/index.qmd rename to docs/reference/python/index.qmd diff --git a/quarto/reference/python/input_video_clip.qmd b/docs/reference/python/input_video_clip.qmd similarity index 100% rename from quarto/reference/python/input_video_clip.qmd rename to docs/reference/python/input_video_clip.qmd diff --git a/quarto/reference/r-logo.svg b/docs/reference/r-logo.svg similarity index 100% rename from quarto/reference/r-logo.svg rename to docs/reference/r-logo.svg diff --git a/quarto/reference/r/audio_spinner.qmd b/docs/reference/r/audio_spinner.qmd similarity index 100% rename from quarto/reference/r/audio_spinner.qmd rename to docs/reference/r/audio_spinner.qmd diff --git a/quarto/reference/r/index.qmd b/docs/reference/r/index.qmd similarity index 100% rename from quarto/reference/r/index.qmd rename to docs/reference/r/index.qmd diff --git a/quarto/reference/r/input_video_clip.qmd b/docs/reference/r/input_video_clip.qmd similarity index 100% rename from quarto/reference/r/input_video_clip.qmd rename to docs/reference/r/input_video_clip.qmd diff --git a/quarto/reference/r/multimodal_dep.qmd b/docs/reference/r/multimodal_dep.qmd similarity index 100% rename from quarto/reference/r/multimodal_dep.qmd rename to docs/reference/r/multimodal_dep.qmd diff --git a/quarto/styles.scss b/docs/styles.scss similarity index 100% rename from quarto/styles.scss rename to docs/styles.scss From d50030bc8537befc53ace73ed9464f5994385bc6 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 27 Aug 2024 20:22:40 -0400 Subject: [PATCH 3/4] ci: save a step by installing r package in setup-r-dependencies --- .github/workflows/publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ae79534..1164740 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,17 +27,16 @@ jobs: - name: Install R uses: r-lib/actions/setup-r@v2 - - name: Install R dependencies + - name: Install R package and dependencies uses: r-lib/actions/setup-r-dependencies@v2 with: working-directory: ./r-package extra-packages: + local::. any::knitr any::rmarkdown any::reticulate install-quarto: false - - run: /usr/local/bin/R CMD INSTALL . - working-directory: ./r-package - name: Render and Publish uses: quarto-dev/quarto-actions/publish@v2 From f77fdb7c05dfadf596d4077a3083def3b18b6ee4 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Wed, 28 Aug 2024 09:57:49 -0400 Subject: [PATCH 4/4] restyle input_video_clip() R code --- docs/index.qmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.qmd b/docs/index.qmd index 8b7a7fd..a523305 100644 --- a/docs/index.qmd +++ b/docs/index.qmd @@ -74,10 +74,10 @@ input_video_clip( library(shinymedia) input_video_clip( - "clip1", - video_bits_per_second=256000, - audio_bits_per_second=64000, - style="width: 400px; max-width: 100%;", + "clip1", + video_bits_per_second = 256000, + audio_bits_per_second = 64000, + style = "width: 400px; max-width: 100%;", ) ```