From ff7db0c99ee3f23a93181111ebb9be0fdf4a9a84 Mon Sep 17 00:00:00 2001 From: Kamil Zyla Date: Tue, 17 Jan 2023 12:11:23 +0100 Subject: [PATCH] fix: Quote and
string appearing in List docs --- R/documentation.R | 2 +- man/List.Rd | 2 +- scrape-docs/README.md | 6 ++++-- scrape-docs/makeDocs.ts | 13 +++++++++---- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/R/documentation.R b/R/documentation.R index 6ed833e7..42c47ab6 100644 --- a/R/documentation.R +++ b/R/documentation.R @@ -2049,7 +2049,7 @@ NULL #' #' Add the data-is-scrollable="true" attribute to your scrollable element containing the List. #' -#' By default, the List will use the  element as the scrollable element. If you contain List within a scrollable 
 using overflow: auto or scroll, List needs to listen for scroll events on that element instead. On initialization, List will traverse up the DOM looking for the first element with the data-is-scrollable attribute to know which element to listen to for knowing when to re-evaulate the visible window. +#' By default, the List will use the `` element as the scrollable element. If you contain List within a scrollable `
` using overflow: auto or scroll, List needs to listen for scroll events on that element instead. On initialization, List will traverse up the DOM looking for the first element with the data-is-scrollable attribute to know which element to listen to for knowing when to re-evaulate the visible window. #' #' #### My list isn't re-rendering when I mutate its items, what should I do? #' diff --git a/man/List.Rd b/man/List.Rd index 31559632..27e6f05c 100644 --- a/man/List.Rd +++ b/man/List.Rd @@ -75,7 +75,7 @@ you need to work using the original docs to achieve the desired result. Add the data-is-scrollable="true" attribute to your scrollable element containing the List. -By default, the List will use the \if{html}{\out{}} element as the scrollable element. If you contain List within a scrollable \if{html}{\out{
}} using overflow: auto or scroll, List needs to listen for scroll events on that element instead. On initialization, List will traverse up the DOM looking for the first element with the data-is-scrollable attribute to know which element to listen to for knowing when to re-evaulate the visible window. +By default, the List will use the \verb{} element as the scrollable element. If you contain List within a scrollable \verb{
} using overflow: auto or scroll, List needs to listen for scroll events on that element instead. On initialization, List will traverse up the DOM looking for the first element with the data-is-scrollable attribute to know which element to listen to for knowing when to re-evaulate the visible window. } \subsection{My list isn't re-rendering when I mutate its items, what should I do?}{ diff --git a/scrape-docs/README.md b/scrape-docs/README.md index 19900967..456053b5 100644 --- a/scrape-docs/README.md +++ b/scrape-docs/README.md @@ -1,3 +1,5 @@ ### Scrape Fluent UI docs -Run `yarn install` followed by: -* `yarn ts-node makeDocs` to generate `fluent-docs.json` and `../R/documentation.R`. + +* `yarn install`: Install dependencies. +* `yarn ts-node makeDocs`: Gnerate `fluent-docs.json` and `../R/documentation.R`. +* `yarn lint [--fix]`: Lint code. diff --git a/scrape-docs/makeDocs.ts b/scrape-docs/makeDocs.ts index 783beb80..1efb8c7d 100644 --- a/scrape-docs/makeDocs.ts +++ b/scrape-docs/makeDocs.ts @@ -26,21 +26,26 @@ const REPLACE_MAP = [ regex: /@name pickers/gm, replacement: '@name Pickers', }, + // Quote and
(appearing in List documentation). + { + regex: /(|
)/gm, + replacement: '`$1`', + }, // Quote empty markdown links, e.g. "[Object]" as it throws roxygen warning about missing url { regex: /(\[(\w+\s?\w+)\])(?!\(.*\))/gm, - replacement: '`\$1`', // eslint-disable-line + replacement: '`$1`', }, // Quote regexes in text { regex: /(\[(0-9|a-zA-Z|a-zA-Z0-9)\])/gm, - replacement: '`\$1`', // eslint-disable-line + replacement: '`$1`', }, // Remove empty @details { regex: /#'\s+@details[\n\s]+#'[\n\s]+#'[\n\s]+\\itemize\{\n#'\s\}/gm, - replacement: '#\'' - } + replacement: '#\'', + }, ]; async function main() {