Skip to content

Commit

Permalink
fix: fix review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrTopi committed Nov 23, 2023
1 parent 9ecfd9a commit 47808b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions docs/contributor-docs/writing-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This page documents how to add and maintain documentation.

The documentation site is generated from the **source code** and the `.md` files. There are two types of `.md` files: `README.md` and `named-md-files.md`, under the `docs folder`.

The **source code** is parsed with [JSDoc](https://jsdoc.app/) and it inprocides `type` information for the docs.
The **source code** is parsed with [JSDoc](https://jsdoc.app/) with the exeption of react components, which are parsed by [react-docgen](https://react-docgen.dev/) and it provides `type` information for the docs.

The docs can be written in `markdown`, with some added flavor, so the docs can handle special code-display cases.

Expand Down Expand Up @@ -218,7 +218,7 @@ render(<Example />);

### 4. Multi example

If an example should be shown in `class` and `function` form as well, it needs to be written as a `list` with two items.
If an example should be shown in `class` and `function` form as well, it needs to be written as a `list` with two items. The first item will be the `class`, the second the `function`.

````md
---
Expand Down Expand Up @@ -247,7 +247,7 @@ type: code
}
}

render(<Exmple />)
render(<Example />)
```

- ```js
Expand All @@ -263,7 +263,7 @@ type: code
)
}

render(<Exmple />)
render(<Example />)
```
````

Expand Down
9 changes: 7 additions & 2 deletions packages/__docs__/src/Playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { Preview, PreviewErrorBoundary } from '../Preview'
import { CodeSandboxButton } from '../CodeSandboxButton'
import type { PlaygroundProps, PlaygroundState } from './props'
import { propTypes, allowedProps } from './props'
import type { MainDocsData } from '../../buildScripts/DataTypes.mjs'

/* eslint-disable max-len */
const codeIconPath = (
Expand Down Expand Up @@ -200,7 +201,11 @@ class Playground extends Component<PlaygroundProps, PlaygroundState> {
)
}

renderPreview = (code: any, themeKey: any, themes: any) => {
renderPreview = (
code: string,
themeKey: string,
themes: MainDocsData['themes']
) => {
const { fullscreen, rtl } = this.state

return (
Expand Down Expand Up @@ -280,7 +285,7 @@ class Playground extends Component<PlaygroundProps, PlaygroundState> {
) : this.mutliExample() ? (
this.renderTabPanel(themeKey, themes)
) : (
this.renderPreview(this.state.code, themeKey, themes)
this.renderPreview(this.state.code as string, themeKey, themes)
)}

{this.state.showCode && this.renderEditor()}
Expand Down
2 changes: 1 addition & 1 deletion packages/__docs__/src/Preview/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import type {
import PropTypes from 'prop-types'
import type { ComponentStyle, WithStyleProps } from '@instructure/emotion'

import type { MainDocsData } from '../../buildScripts/DataTypes.mts'
import type { MainDocsData } from '../../buildScripts/DataTypes.mjs'

type PreviewOwnProps = {
code: string
Expand Down

0 comments on commit 47808b9

Please sign in to comment.