Skip to content

Commit 61b0bcf

Browse files
Add ember data dependency to quickstart
1 parent ab3ab29 commit 61b0bcf

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

tests/dummy/app/templates/docs/quickstart.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
## 1. Install AddonDocs
44

5-
```
5+
```sh
66
ember install ember-cli-addon-docs
77
```
88

9+
[Ember Data](https://github.com/emberjs/data) is a required peer dependency, so if you're not already using it in your addon, you'll need to install it.
10+
11+
```sh
12+
ember install ember-data
13+
```
14+
915
## 2. Install ember-cli-addon-docs-yuidoc
1016

1117
API docs are autogenerated from comments in your source code, and require an additional plugin to be installed.
@@ -23,8 +29,8 @@ You can see an example of <DocsLink @route="sandbox.api.item" @model="components
2329
Open `tests/dummy/app/router.js` and replace the standard EmberRouter with the AddonDocsRouter:
2430

2531
<DocsSnippet @name="quickstart-router.js" @title="tests/dummy/app/router.js">
26-
import AddonDocsRouter, { docsRoute } from 'ember-cli-addon-docs/router';
27-
import config from './config/environment';
32+
import AddonDocsRouter, { docsRoute } from 'ember-cli-addon-docs/router';
33+
import config from './config/environment';
2834

2935
const Router = AddonDocsRouter.extend({
3036
location: config.locationType,
@@ -36,6 +42,7 @@ Open `tests/dummy/app/router.js` and replace the standard EmberRouter with the A
3642
});
3743

3844
export default Router;
45+
3946
</DocsSnippet>
4047

4148
## 4. Start developing your dummy app
@@ -45,9 +52,10 @@ AddonDocs uses your addon's dummy application, which is a full-fledged Ember app
4552
So let's start with the application template:
4653

4754
<DocsSnippet @name="quickstart-application.hbs" @title="tests/dummy/app/templates/application.hbs">
48-
<DocsHeader/>
55+
<DocsHeader/>
4956

5057
{{outlet}}
58+
5159
</DocsSnippet>
5260

5361
`<DocsHeader />` is an AddonDocs component that renders a header using data from your addon's `package.json`. It renders a homepage link, documentation link, version selector, search bar, and link to your GitHub repository. Check out <DocsLink @route="docs.components.docs-header">the guide</DocsLink> for more on the header.
@@ -59,7 +67,7 @@ At this point, fire up `ember s` and you should see your new docs site & header
5967
AddonDocs comes with some components to help you showcase your addon. Let's add them to your dummy app's index template:
6068

6169
<DocsSnippet @name="quickstart-marketing-index.hbs" @title="tests/dummy/app/templates/index.hbs">
62-
<DocsHero/>
70+
<DocsHero/>
6371

6472
<div style="max-width: 40rem; margin: 0 auto; padding: 0 1.5rem">
6573
<DocsDemo as |demo|>
@@ -80,16 +88,17 @@ AddonDocs is unopinionated about how you style your application, so you can use
8088
The `docs` route is the entry point for your guides and API docs. Create a new `docs.hbs` file for the `docs` route and add the `<DocsViewer />` component:
8189

8290
<DocsSnippet @name="quickstart-skeleton.hbs" @language="handlebars" @title="tests/dummy/app/templates/docs.hbs">
83-
<DocsViewer as |viewer|>
84-
<viewer.nav as |nav|>
85-
<nav.section @label="Introduction"/>
86-
</viewer.nav>
91+
<DocsViewer as |viewer|>
92+
<viewer.nav as |nav|>
93+
<nav.section @label="Introduction"/>
94+
</viewer.nav>
8795

8896
<viewer.main>
8997
{{outlet}}
9098
</viewer.main>
9199

92100
</DocsViewer>
101+
93102
</DocsSnippet>
94103

95104
If you visit `/docs` or click the Documentation link in the header, you should see the viewer's nav on the left-hand side and an area in the center where your guides content will go.
@@ -125,6 +134,7 @@ This will generate and modify the files for your `usage` docs page.
125134
# Usage
126135

127136
Usage content
137+
128138
</DocsSnippet>
129139

130140
Remember, the dummy site is a full Ember application and these components are just here to help you get going. Feel free to make other components to help you best document your library!
@@ -142,14 +152,15 @@ Just as with any Ember app, it's a good idea to add a 404 route for unmatched UR
142152
Add the following route to the end of your router and create the associated template.
143153

144154
<DocsSnippet @name="quickstart-404.js" @title="tests/dummy/app/router.js">
145-
this.route('not-found', { path: '/\*path' });
155+
this.route('not-found', { path: '/\*path' });
146156
</DocsSnippet>
147157

148158
<DocsSnippet @name="quickstart-404.hbs" @title="tests/dummy/app/templates/not-found.hbs">
149-
<div style="max-width: 40rem; margin: 0 auto; padding: 0 1.5rem">
150-
<h1>Not found</h1>
151-
<p>This page doesn't exist. <DocsLink @route="index">Head home?</DocsLink></p>
152-
</div>
159+
160+
<div style="max-width: 40rem; margin: 0 auto; padding: 0 1.5rem">
161+
<h1>Not found</h1>
162+
<p>This page doesn't exist. <DocsLink @route="index">Head home?</DocsLink></p>
163+
</div>
153164
</DocsSnippet>
154165

155166
---

0 commit comments

Comments
 (0)