Created
February 26, 2023 17:20
Revisions
-
jthomasmock revised this gist
Feb 26, 2023 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -20,3 +20,5 @@ all_tags[all_tags != "All"] |> ``` # Gist URL https://gist.github.com/10e217dab119bccb7df8d6d0aa483dab # Code image at: ![](https://i.imgur.com/jAQJlNS.png) -
jthomasmock revised this gist
Feb 26, 2023 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -17,4 +17,6 @@ all_tags <- sapply(seq_len(length_tags), function(x){ all_tags[all_tags != "All"] |> write_lines(here::here("_data/unique_categories.txt")) ``` # Gist URL https://gist.github.com/10e217dab119bccb7df8d6d0aa483dab -
jthomasmock created this gist
Feb 26, 2023 .There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ ```{r write-tags} #| echo: false library(rvest) library(xml2) raw_html <- read_html(here::here("_site/index.html")) length_tags <- raw_html |> html_nodes("#quarto-margin-sidebar > div > div") |> length() all_tags <- sapply(seq_len(length_tags), function(x){ html_nodes(raw_html, xpath = glue::glue('//*[@id="quarto-margin-sidebar"]/div/div[{x}]/text()')) |> html_text(trim = TRUE) }) all_tags[all_tags != "All"] |> write_lines(here::here("_data/unique_categories.txt")) ```