Skip to content

Commit

Permalink
fix: Quote <body> and <div> string appearing in List docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilzyla committed Jan 17, 2023
1 parent 08204d1 commit ff7db0c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion R/documentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 <body> element as the scrollable element. If you contain List within a scrollable <div> 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 `<body>` element as the scrollable element. If you contain List within a scrollable `<div>` 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?
#'
Expand Down
2 changes: 1 addition & 1 deletion man/List.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions scrape-docs/README.md
Original file line number Diff line number Diff line change
@@ -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.
13 changes: 9 additions & 4 deletions scrape-docs/makeDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@ const REPLACE_MAP = [
regex: /@name pickers/gm,
replacement: '@name Pickers',
},
// Quote <body> and <div> (appearing in List documentation).
{
regex: /(<body>|<div>)/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() {
Expand Down

0 comments on commit ff7db0c

Please sign in to comment.