File tree Expand file tree Collapse file tree 3 files changed +50
-8
lines changed
components/api/x-sections
tests/dummy/app/pods/docs/quickstart Expand file tree Collapse file tree 3 files changed +50
-8
lines changed Original file line number Diff line number Diff line change 99 <div data-test-item>
1010 {{ #if (or item.isClass item.isComponent )}}
1111 <h3 id ={{ item.name }} data-test-item-header class =" item-section__class-header mb-1" >
12- {{ #link-to ' docs.api.item' (concat ' root /' item.id )}}
12+ {{ #link-to ' docs.api.item' (concat ' modules /' item.id )}}
1313 {{ #if (eq item.exportType ' default' )}}
1414 <span class =" item-section__default-label" >Default</span >
1515 {{ /if }}
Original file line number Diff line number Diff line change 1+ /** @documenter yuidoc */
2+
13import EmberRouter from '@ember/routing/router' ;
24import RouterScroll from 'ember-router-scroll' ;
35
6+ /**
7+ The AddonDocsRouter, which adds some extra functionality. This should be used
8+ instead of the standard EmberRouter class in your docs app.
9+
10+ ```js
11+ import AddonDocsRouter, { docsRoute } from 'ember-cli-addon-docs/router';
12+ import config from './config/environment';
13+
14+ const Router = AddonDocsRouter.extend({
15+ location: config.locationType,
16+ rootURL: config.rootURL,
17+ });
18+ ```
19+
20+ @class AddonDocsRouter
21+ @extends EmberRouter
22+ */
423export default EmberRouter . extend ( RouterScroll ) ;
524
25+ /**
26+ Creates the docs route and api docs routes. Can receive a callback with the
27+ routes you want to add to your docs.
28+
29+ ```js
30+ import AddonDocsRouter, { docsRoute } from 'ember-cli-addon-docs/router';
31+
32+ Router.map(function() {
33+ docsRoute(this, function() {
34+ this.route('usage');
35+ });
36+ });
37+ ```
38+
39+ @function docsRoute
40+ */
641export function docsRoute ( router , callback ) {
742 router . route ( 'docs' , function ( ) {
843 callback . apply ( this ) ;
Original file line number Diff line number Diff line change @@ -11,16 +11,23 @@ marketing/demo page you can use to promote your addon.
1111 ember install ember-cli-addon-docs
1212 ```
1313
14- 2 . ** Add the docs routes.** Open ` tests/dummy/app/router.js ` and add the
15- following route definitions to your main route.
14+ 2 . ** Add the docs routes.** Open ` tests/dummy/app/router.js ` and replace the
15+ standard EmberRouter with the AddonDocsRouter:
1616
1717 {{#docs-snippet name='quickstart-router.js' title='tests/dummy/app/router.js'}}
18- this.route('docs', function() { // docs homepage (required)
19- this.route('usage'); // docs subpage
20- this.route('api', function() { // autogenerated API homepage (required)
21- this.route('item', { path: '/* path' }); // autogenerated API subpages (required)
22- });
18+ import AddonDocsRouter, { docsRoute } from 'ember-cli-addon-docs/router';
19+ import config from './config/environment';
20+
21+ const Router = AddonDocsRouter.extend({
22+ location: config.locationType,
23+ rootURL: config.rootURL,
24+ });
25+
26+ Router.map(function() {
27+ docsRoute(this, function() { /* Your docs routes go here */ });
2328 });
29+
30+ export default Router;
2431 {{/docs-snippet}}
2532
26333 . ** Create your docs skeleton.** Create a new template for the ` docs ` route
You can’t perform that action at this time.
0 commit comments