Skip to content

Commit

Permalink
typos in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-krysiak committed Sep 13, 2019
1 parent 029c162 commit dfd137a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
1 change: 1 addition & 0 deletions .npmignore
@@ -0,0 +1 @@
./readme
41 changes: 26 additions & 15 deletions README.md
@@ -1,13 +1,24 @@
# better-docs

Beautiful and simple documentation template for JSDoc 3 with @category plugin.

<img src="./readme/class.png" />
<img src="./readme/with-mermaid.png" />
Beautiful and simple documentation template for JSDoc 3 with **@category** and **@component** plugins:

<table>
<tr>
<td style="width: 30%">
<a href='./readme/class.png'><img src="./readme/class.png" /></a>
</td>
<td style="width: 30%">
<a href='./readme/with-mermaid.png'><img src="./readme/with-mermaid.png" /></a>
</td>
<td style="width: 30%">
<a href='./readme/component.png'><img src="./readme/component.png" /></a>
</td>
</tr>
</table>

## Example

Simple example documentation can be found here: https://softwarebrothers.github.io/admin-bro-dev/index.html
Example documentation can be found here: https://softwarebrothers.github.io/admin-bro-dev/index.html

## Installation

Expand All @@ -19,7 +30,7 @@ npm install --save-dev better-docs

### With command line

Assuming that you have jsdoc installed globally:
Assuming that you have [jsdoc](https://github.com/jsdoc/jsdoc) installed globally:

```
jsdoc your-documented-file.js -t ./node_modules/better-docs
Expand All @@ -31,7 +42,7 @@ In your projects package.json file - add a new script:

```
"script": {
"docs": "node_modules/.bin/jsdoc -c jsdoc.json"
"docs": "jsdoc -c jsdoc.json"
}
```

Expand Down Expand Up @@ -107,7 +118,7 @@ yarn global add parcel-bundler

To document components simply add `@component` in your JSDoc documentation:

```
```jsx
/**
* Some documented component
*
Expand Down Expand Up @@ -155,15 +166,15 @@ export default {
</script>
```

Here props will be taken from `props` property.
In this case, props will be taken from `props` property.

### Preview

`@component` plugin also modifies the behaviour of `@example` tag in a way that it can generate an actual __component preview__. What you have to do is to add an `@example` tag and return component from it:

**React example:**

```javacript
```jsx
/**
* Some documented component
*
Expand All @@ -181,7 +192,7 @@ const Documented = (props) => {

**Vue example 1:**

```
```vue
<script>
/**
* @component
Expand All @@ -197,7 +208,7 @@ export default {

**Vue example 2:**

```
```vue
<script>
/**
* @component
Expand All @@ -219,7 +230,7 @@ export default {
</script>
```

You can put as many `@example` tags as you like in one component and name each of them like this:
You can put as many `@example` tags as you like in one component and "caption" each of them like this:

```javascript
/**
Expand Down Expand Up @@ -310,7 +321,7 @@ export default Component

### Styling React examples

Better-docs inserts all examples within an `iframe`. This results in following styling options:
Better-docs inserts all examples within an `iframe`. This results in the following styling options:

1. If you pass styles inline - they will work right away.

Expand Down Expand Up @@ -487,7 +498,7 @@ If you want to see how to setup jsdoc in your project - take a look at these bri

## License

better-docs is Copyright © 2019 SoftwareBrothers.co. It is free software and may be redistributed under the terms specified in the [LICENSE](LICENSE) file.
better-docs is Copyright © 2019 SoftwareBrothers.co. It is free software and may be redistributed under the terms specified in the [LICENSE](LICENSE) file - MIT.

## About SoftwareBrothers.co

Expand Down
Binary file added readme/component.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tmpl/container.tmpl
Expand Up @@ -40,7 +40,7 @@
<?js }) ?>
<?js } else if (doc.component) { ?>
<h2>
<?js= '&lt' + doc.name + ' ' + doc.component.props.map(p => '<i>' + p.name + '</i>').join(', ') + ' /&gt' ?>
<?js= '&lt' + doc.name + ' ' + doc.component.props.map(p => '<i>' + p.name + '</i>').join(' ') + ' /&gt' ?>
</h2>
<?js } ?>
</header>
Expand Down
2 changes: 1 addition & 1 deletion tmpl/method.tmpl
Expand Up @@ -18,7 +18,7 @@ var self = this;
<?js } ?>
<span class="code-name">
<?js if (data.component) { ?>
<?js= '&lt' + name + ' ' + data.component.props.map(p => '<i>' + p.name + '</i>').join(', ') + ' /&gt' ?>
<?js= '&lt' + name + ' ' + data.component.props.map(p => '<i>' + p.name + '</i>').join(' ') + ' /&gt' ?>
<?js } else { ?>
<?js= (kind === 'class' ? 'new ' : '') + name + (data.signature || '') ?>
<?js } ?>
Expand Down

0 comments on commit dfd137a

Please sign in to comment.