Skip to content

Commit

Permalink
refactor(many): fix readme formatting, fix docs parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
matyasf committed Nov 25, 2024
1 parent 09d45e0 commit 3c41a55
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/__docs__/src/compileMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function trimIndent(str: string) {
let indent = ''
lines.forEach((line, _i) => {
// matches whitespace at the end of a string
line.replace(/\s*$/, '')
// eslint-disable-next-line no-param-reassign
line = line.replace(/\s*$/, '')
if (indentFound === false) {
if (line === '') {
return
Expand Down
13 changes: 13 additions & 0 deletions packages/babel-plugin-transform-imports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,29 @@ category: packages
This will convert any non-default imports that are referencing the package only to reference the full path to the module instead. For example:

```js
---
type: code
---
// a named member import:
import { Text } from '@instructure/ui-elements'
```

would be converted to

```js
---
type: code
---
// a named import using the full module path:
import { Text } from '@instructure/ui-elements/lib/Text'
```

Note that any default imports you are currently using will not be transformed:

```js
---
type: code
---
// a default import using the full path (will not be transformed):
import Text from '@instructure/ui-elements/lib/Text'
```
Expand Down
3 changes: 3 additions & 0 deletions packages/ui-form-field/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ npm install @instructure/ui-form-field
### Usage

```js
---
type: code
---
import React from 'react'
import { FormField } from '@instructure/ui-form-field'

Expand Down
5 changes: 4 additions & 1 deletion packages/ui-test-locator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ npm install @instructure/ui-test-locator

### Usage

```javascript
```js
---
type: code
---
// MyComponent.js
import { testable } from '@instructure/ui-testable'

Expand Down
3 changes: 3 additions & 0 deletions packages/ui-tooltip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ npm install @instructure/ui-tooltip
### Usage

```js
---
type: code
---
import React from 'react'
import { Tooltip } from '@instructure/ui-tooltip'

Expand Down

0 comments on commit 3c41a55

Please sign in to comment.