@docfy/ember 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/addon-main.cjs +4 -0
- package/declarations/components/docfy-demo.d.ts +44 -0
- package/declarations/components/docfy-demo.d.ts.map +1 -0
- package/declarations/components/docfy-link.d.ts +23 -0
- package/declarations/components/docfy-link.d.ts.map +1 -0
- package/declarations/components/docfy-output.d.ts +24 -0
- package/declarations/components/docfy-output.d.ts.map +1 -0
- package/declarations/components/docfy-previous-and-next-page.d.ts +23 -0
- package/declarations/components/docfy-previous-and-next-page.d.ts.map +1 -0
- package/declarations/index.d.ts +7 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/routing.d.ts +3 -0
- package/declarations/routing.d.ts.map +1 -0
- package/{services → declarations/services}/docfy.d.ts +4 -8
- package/declarations/services/docfy.d.ts.map +1 -0
- package/declarations/template-registry.d.ts +11 -0
- package/declarations/template-registry.d.ts.map +1 -0
- package/dist/_app_/components/docfy-demo.js +1 -0
- package/dist/_app_/components/docfy-link.js +1 -0
- package/dist/_app_/components/docfy-output.js +1 -0
- package/dist/_app_/components/docfy-previous-and-next-page.js +1 -0
- package/dist/_app_/services/docfy.js +1 -0
- package/dist/components/docfy-demo.js +121 -0
- package/dist/components/docfy-demo.js.map +1 -0
- package/dist/components/docfy-link.js +58 -0
- package/dist/components/docfy-link.js.map +1 -0
- package/dist/components/docfy-output.js +43 -0
- package/dist/components/docfy-output.js.map +1 -0
- package/dist/components/docfy-previous-and-next-page.js +27 -0
- package/dist/components/docfy-previous-and-next-page.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +2 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +17 -0
- package/dist/output.js.map +1 -0
- package/dist/routing.js +29 -0
- package/dist/routing.js.map +1 -0
- package/dist/services/docfy.js +87 -0
- package/dist/services/docfy.js.map +1 -0
- package/dist/template-registry.js +2 -0
- package/dist/template-registry.js.map +1 -0
- package/package.json +91 -124
- package/-private/find-previous-or-next-page.d.ts +0 -2
- package/-private/flat-nested.d.ts +0 -2
- package/.docfy-config.js +0 -40
- package/addon/-private/find-previous-or-next-page.ts +0 -22
- package/addon/-private/flat-nested.ts +0 -18
- package/addon/components/docfy-demo/description.hbs +0 -26
- package/addon/components/docfy-demo/description.ts +0 -3
- package/addon/components/docfy-demo/example.hbs +0 -3
- package/addon/components/docfy-demo/example.ts +0 -3
- package/addon/components/docfy-demo/snippet.hbs +0 -8
- package/addon/components/docfy-demo/snippet.ts +0 -35
- package/addon/components/docfy-demo/snippets.hbs +0 -25
- package/addon/components/docfy-demo/snippets.ts +0 -27
- package/addon/components/docfy-demo.hbs +0 -10
- package/addon/components/docfy-demo.ts +0 -7
- package/addon/components/docfy-link.hbs +0 -8
- package/addon/components/docfy-link.ts +0 -54
- package/addon/components/docfy-output.hbs +0 -1
- package/addon/components/docfy-output.ts +0 -37
- package/addon/components/docfy-previous-and-next-page.hbs +0 -1
- package/addon/components/docfy-previous-and-next-page.ts +0 -20
- package/addon/helpers/docfy-eq.ts +0 -7
- package/addon/index.ts +0 -31
- package/addon/output.d.ts +0 -13
- package/addon/services/docfy.ts +0 -101
- package/app/components/docfy-demo/description.js +0 -1
- package/app/components/docfy-demo/example.js +0 -1
- package/app/components/docfy-demo/snippet.js +0 -1
- package/app/components/docfy-demo/snippets.js +0 -1
- package/app/components/docfy-demo.js +0 -1
- package/app/components/docfy-link.js +0 -1
- package/app/components/docfy-output.js +0 -1
- package/app/components/docfy-previous-and-next-page.js +0 -1
- package/app/helpers/docfy-eq.js +0 -1
- package/app/services/docfy.js +0 -1
- package/components/docfy-demo/description.d.ts +0 -3
- package/components/docfy-demo/example.d.ts +0 -3
- package/components/docfy-demo/snippet.d.ts +0 -13
- package/components/docfy-demo/snippets.d.ts +0 -11
- package/components/docfy-demo.d.ts +0 -7
- package/components/docfy-link.d.ts +0 -15
- package/components/docfy-output.d.ts +0 -16
- package/components/docfy-previous-and-next-page.d.ts +0 -12
- package/config/environment.js +0 -5
- package/docs/components/docfy-demo.md +0 -67
- package/docs/components/docfy-link-demo/anchor.md +0 -9
- package/docs/components/docfy-link-demo/simple.md +0 -7
- package/docs/components/docfy-link.md +0 -31
- package/docs/components/docfy-output-demo/edit-page.md +0 -54
- package/docs/components/docfy-output-demo/flat.md +0 -23
- package/docs/components/docfy-output-demo/on-this-page.md +0 -30
- package/docs/components/docfy-output-demo/sidebar.md +0 -45
- package/docs/components/docfy-output-demo/top-nav.md +0 -35
- package/docs/components/docfy-output.md +0 -34
- package/docs/components/docfy-previous-and-next-page-demo/scope.md +0 -26
- package/docs/components/docfy-previous-and-next-page-demo/simple.md +0 -24
- package/docs/components/docfy-previous-and-next-page.md +0 -21
- package/docs/configuration.md +0 -57
- package/docs/index.md +0 -165
- package/docs/writing-demos-demo/demo1.md +0 -18
- package/docs/writing-demos.md +0 -109
- package/dummy-docs/README.md +0 -140
- package/dummy-docs/github-icon.png +0 -0
- package/dummy-docs/installation.md +0 -14
- package/dummy-docs/introduction.md +0 -30
- package/dummy-docs/overview.md +0 -19
- package/dummy-docs/packages/core/helpers/genereate-flat-output.md +0 -10
- package/dummy-docs/packages/core/helpers/genereate-nested-output.md +0 -12
- package/dummy-docs/packages/core/overview.md +0 -19
- package/dummy-docs/packages/ember/components/docfy-link-demo/demo1.md +0 -26
- package/dummy-docs/packages/ember/components/docfy-link-demo/demo2.md +0 -20
- package/dummy-docs/packages/ember/components/docfy-link.md +0 -19
- package/dummy-docs/packages/ember/components/docfy-output.md +0 -32
- package/dummy-docs/packages/ember/components/docfy-with-hyphenated-number-2-demo/demo1.md +0 -25
- package/dummy-docs/packages/ember/components/docfy-with-hyphenated-number-2.md +0 -9
- package/dummy-docs/packages/ember/demo/my-ember-demo.md +0 -3
- package/dummy-docs/packages/ember/index.md +0 -23
- package/dummy-docs/packages/ember/installation.md +0 -14
- package/dummy-docs/packages/ember/plugins/manual-demo-insertion-demo/tomster.md +0 -15
- package/dummy-docs/packages/ember/plugins/manual-demo-insertion-demo/zoey.md +0 -9
- package/dummy-docs/packages/ember/plugins/manual-demo-insertion.md +0 -31
- package/dummy-docs/packages/ember/preview.md +0 -20
- package/ember-cli-addon.js +0 -3
- package/helpers/docfy-eq.d.ts +0 -7
- package/index.d.ts +0 -3
- package/lib/docfy-output-template.d.ts +0 -1
- package/lib/docfy-output-template.js +0 -23
- package/lib/get-config.d.ts +0 -7
- package/lib/get-config.js +0 -118
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -177
- package/lib/plugins/extract-demos-to-components.d.ts +0 -2
- package/lib/plugins/extract-demos-to-components.js +0 -149
- package/lib/plugins/preview-template.d.ts +0 -2
- package/lib/plugins/preview-template.js +0 -41
- package/lib/plugins/replace-internal-links-with-docfy-link.d.ts +0 -6
- package/lib/plugins/replace-internal-links-with-docfy-link.js +0 -44
- package/lib/plugins/types.d.ts +0 -29
- package/lib/plugins/types.js +0 -2
- package/lib/plugins/utils.d.ts +0 -31
- package/lib/plugins/utils.js +0 -142
- package/output.d.ts +0 -13
- package/src/docfy-output-template.ts +0 -20
- package/src/get-config.ts +0 -109
- package/src/index.ts +0 -229
- package/src/plugins/extract-demos-to-components.ts +0 -196
- package/src/plugins/preview-template.ts +0 -54
- package/src/plugins/replace-internal-links-with-docfy-link.ts +0 -61
- package/src/plugins/types.ts +0 -33
- package/src/plugins/utils.ts +0 -191
- package/src/tsconfig.json +0 -14
- package/src/types/broccoli-bridge.d.ts +0 -11
- package/src/types/broccoli-file-creator.d.ts +0 -11
- package/src/types/broccoli-funnel.d.ts +0 -19
- package/src/types/broccoli-merge-trees.d.ts +0 -13
- package/src/types/broccoli-source.d.ts +0 -9
- package/src/types/mdast-util-to-string.d.ts +0 -5
- package/src/types/unist-util-find.d.ts +0 -8
- package/tsconfig.json +0 -42
- package/types/dummy/index.d.ts +0 -0
- package/types/ember-get-config/index.d.ts +0 -9
- package/types/global.d.ts +0 -6
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
order: 1
|
|
3
|
-
category: components
|
|
4
|
-
title: <DocfyOutput>
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# {{"<DocfyOutput>"}}
|
|
8
|
-
|
|
9
|
-
This component exposes some of the result data from the build that you can use
|
|
10
|
-
to render, for example, a sidebar navigation, "on this page" section, and more.
|
|
11
|
-
|
|
12
|
-
Depending on the arguments you pass to the component, the output could be one of
|
|
13
|
-
the following values:
|
|
14
|
-
|
|
15
|
-
- `NestedPageMetadata`
|
|
16
|
-
- `PageMetadata[]`
|
|
17
|
-
- `PageMetadata`
|
|
18
|
-
- `undefined`
|
|
19
|
-
|
|
20
|
-
To learn more about each data type, please refer to the API docs.
|
|
21
|
-
|
|
22
|
-
Below you can see several examples of what is possible to build using this component.
|
|
23
|
-
|
|
24
|
-
# API
|
|
25
|
-
|
|
26
|
-
This component has a few different options that are used to filter what the
|
|
27
|
-
returning value should be. Here is the arguments this component accepts.
|
|
28
|
-
|
|
29
|
-
| Argument | Description | Type | Default Value |
|
|
30
|
-
| ----------------- | ----------------------------------------------------- | ------------------------ | ------------- |
|
|
31
|
-
| `@type` | If the result should be a flat list or nested | `'flat'` \| `'nested'` | `'nested'` |
|
|
32
|
-
| `@fromCurrentURL` | If the result should be filtered from the current URL | `boolean` \| `undefined` | |
|
|
33
|
-
| `@url` | Find the page definition for the given URL | `string` \| `undefined` | |
|
|
34
|
-
| `@scope` | If the result should be filtered by an scope name | `string` \| `undefined` | |
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# Scoping
|
|
2
|
-
|
|
3
|
-
This example passes the argument `@scope` to the component.
|
|
4
|
-
|
|
5
|
-
```hbs template
|
|
6
|
-
<DocfyPreviousAndNextPage @scope="docs" as |previous next|>
|
|
7
|
-
<div>
|
|
8
|
-
{{#if previous}}
|
|
9
|
-
<div class="text-sm">Previous</div>
|
|
10
|
-
|
|
11
|
-
<DocfyLink @to={{previous.url}} class="text-xl text-blue-500">
|
|
12
|
-
{{previous.title}}
|
|
13
|
-
</DocfyLink>
|
|
14
|
-
{{/if}}
|
|
15
|
-
</div>
|
|
16
|
-
<div>
|
|
17
|
-
{{#if next}}
|
|
18
|
-
<div class="text-sm">Next</div>
|
|
19
|
-
|
|
20
|
-
<DocfyLink @to={{next.url}} class="text-xl text-blue-500">
|
|
21
|
-
{{next.title}}
|
|
22
|
-
</DocfyLink>
|
|
23
|
-
{{/if}}
|
|
24
|
-
</div>
|
|
25
|
-
</DocfyPreviousAndNextPage>
|
|
26
|
-
```
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Simple usage
|
|
2
|
-
|
|
3
|
-
```hbs template
|
|
4
|
-
<DocfyPreviousAndNextPage as |previous next|>
|
|
5
|
-
<div>
|
|
6
|
-
{{#if previous}}
|
|
7
|
-
<div class="text-sm">Previous</div>
|
|
8
|
-
|
|
9
|
-
<DocfyLink @to={{previous.url}} class="text-xl text-blue-500">
|
|
10
|
-
{{previous.title}}
|
|
11
|
-
</DocfyLink>
|
|
12
|
-
{{/if}}
|
|
13
|
-
</div>
|
|
14
|
-
<div>
|
|
15
|
-
{{#if next}}
|
|
16
|
-
<div class="text-sm">Next</div>
|
|
17
|
-
|
|
18
|
-
<DocfyLink @to={{next.url}} class="text-xl text-blue-500">
|
|
19
|
-
{{next.title}}
|
|
20
|
-
</DocfyLink>
|
|
21
|
-
{{/if}}
|
|
22
|
-
</div>
|
|
23
|
-
</DocfyPreviousAndNextPage>
|
|
24
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
order: 3
|
|
3
|
-
category: components
|
|
4
|
-
title: <DocfyPreviousAndNextPage>
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# {{"<DocfyPreviousAndNextPage>"}}
|
|
8
|
-
|
|
9
|
-
This component yields the previous and next page (`PageMetadata`) if it exists.
|
|
10
|
-
The component accepts a single argument called `scope`. It is used to narrow the
|
|
11
|
-
pages that it can link as previous and next.
|
|
12
|
-
|
|
13
|
-
Scoping the pages is useful if you are building different sections of your docs site;
|
|
14
|
-
for example, one section is "Documentation", and another is "Tutorials". This feature
|
|
15
|
-
would prevent linking to a page in tutorials from a documentation page.
|
|
16
|
-
|
|
17
|
-
# API
|
|
18
|
-
|
|
19
|
-
| Argument | Description | Type | Default Value |
|
|
20
|
-
| -------- | ---------------------------- | ----------------------- | ------------- |
|
|
21
|
-
| `@scope` | Filter links by a scope name | `string` \| `undefined` | |
|
package/docs/configuration.md
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
order: 2
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Configuration
|
|
6
|
-
|
|
7
|
-
Docfy has a set of options you can configure and might have read about them
|
|
8
|
-
[here](../../../docs/configuration.md). You might have been wondering how
|
|
9
|
-
to set these options in the Ember app context.
|
|
10
|
-
|
|
11
|
-
The Docfy integration with Ember reads a file named `.docfy-config.js` from the
|
|
12
|
-
root of your app to set the config.
|
|
13
|
-
|
|
14
|
-
In this file, you can add any Remark Plugins, add markdown file sources, and more.
|
|
15
|
-
|
|
16
|
-
Below is a example of a configuration file.
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
// .docfy-config.js
|
|
20
|
-
|
|
21
|
-
const path = require('path');
|
|
22
|
-
const autolinkHeadings = require('remark-autolink-headings');
|
|
23
|
-
const highlight = require('remark-highlight.js');
|
|
24
|
-
const codeImport = require('remark-code-import');
|
|
25
|
-
|
|
26
|
-
module.exports = {
|
|
27
|
-
remarkPlugins: [
|
|
28
|
-
[autolinkHeadings, { behavior: 'wrap' }],
|
|
29
|
-
codeImport,
|
|
30
|
-
highlight
|
|
31
|
-
],
|
|
32
|
-
sources: [
|
|
33
|
-
{
|
|
34
|
-
root: path.resolve(__dirname, '../../../docs'),
|
|
35
|
-
pattern: '**/*.md',
|
|
36
|
-
urlSchema: 'manual',
|
|
37
|
-
urlPrefix: 'docs'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
root: path.join(__dirname, 'docs'),
|
|
41
|
-
pattern: '**/*.md',
|
|
42
|
-
urlSchema: 'manual',
|
|
43
|
-
urlPrefix: 'docs/ember'
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
labels: {
|
|
47
|
-
components: 'Components',
|
|
48
|
-
core: '@docfy/core',
|
|
49
|
-
ember: '@docfy/ember',
|
|
50
|
-
docs: 'Documentation'
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
> You are not required to create this file. If Docfy cannot find it, we will
|
|
56
|
-
> use a default configuration. By default markdown files are read from `docs`
|
|
57
|
-
> in the root of the Ember app.
|
package/docs/index.md
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
order: 1
|
|
3
|
-
title: Getting Started
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Getting Started with Ember
|
|
7
|
-
|
|
8
|
-
Let's get started by creating a new Ember app and adding Docfy to it. For adding
|
|
9
|
-
to existing apps, jump to the step after creating the app.
|
|
10
|
-
|
|
11
|
-
## Generate the App
|
|
12
|
-
|
|
13
|
-
There isn't anything special here; just create the ember app and remove the
|
|
14
|
-
`<WelcomePage />` from `application.hbs`.
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
ember new docfy-example
|
|
18
|
-
cd docfy-example
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Add Docfy dependency
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
yarn add -D @docfy/ember
|
|
25
|
-
// or
|
|
26
|
-
npm install --dev @docfy/ember
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Add Docfy Routes
|
|
30
|
-
|
|
31
|
-
Docfy has a function that adds all the routes to your Ember app. It understands
|
|
32
|
-
the output of Docfy Core and process all the page URLs to add their paths to the Ember app.
|
|
33
|
-
|
|
34
|
-
In your `app/router.js` import `import { addDocfyRoutes } from '@docfy/ember';`
|
|
35
|
-
then add `addDocfyRoutes(this)` to the Router Map. The final result looks like the following:
|
|
36
|
-
|
|
37
|
-
```js
|
|
38
|
-
import EmberRouter from '@ember/routing/router';
|
|
39
|
-
import config from './config/environment';
|
|
40
|
-
import { addDocfyRoutes } from '@docfy/ember';
|
|
41
|
-
|
|
42
|
-
export default class Router extends EmberRouter {
|
|
43
|
-
location = config.locationType;
|
|
44
|
-
rootURL = config.rootURL;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
Router.map(function () {
|
|
48
|
-
addDocfyRoutes(this);
|
|
49
|
-
});
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Add Markdown Files
|
|
53
|
-
|
|
54
|
-
Let's add some markdown files so that we can see it in our app.
|
|
55
|
-
|
|
56
|
-
Create a folder named `docs` in the root of your app then place the following content to `index.md`.
|
|
57
|
-
|
|
58
|
-
```md
|
|
59
|
-
# Hello from my docs site using Docfy
|
|
60
|
-
|
|
61
|
-
**Lorem Ipsum** is simply dummy text of the printing and typesetting industry.
|
|
62
|
-
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when
|
|
63
|
-
an unknown printer took a galley of type and scrambled it to make a type specimen book
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Let's add another file called `installation.md`.
|
|
67
|
-
|
|
68
|
-
```md
|
|
69
|
-
# Installation
|
|
70
|
-
|
|
71
|
-
Follow the steps below to install my app:
|
|
72
|
-
|
|
73
|
-
1. `yarn install`
|
|
74
|
-
2. `yarn start`
|
|
75
|
-
3. Done.
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Start the Server
|
|
79
|
-
|
|
80
|
-
You can now start the Ember server and visit the docs page.
|
|
81
|
-
|
|
82
|
-
```sh
|
|
83
|
-
ember serve
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
The server will be running on port `4200`, and the docs path will be `/docs`.
|
|
87
|
-
Here is the full URL: [http://localhost:4200/docs](http://localhost:4200/docs).
|
|
88
|
-
|
|
89
|
-
To visit the second document we created earlier, you can access
|
|
90
|
-
[http://localhost:4200/docs/installation](http://localhost:4200/docs/installation).
|
|
91
|
-
|
|
92
|
-
That's it, you now have a full working app with Docfy generating pages from
|
|
93
|
-
markdown files.
|
|
94
|
-
|
|
95
|
-
## Add a Sidebar
|
|
96
|
-
|
|
97
|
-
Docfy provides several low-level components that help you build the documentation site.
|
|
98
|
-
Docfy does not offer any styles by default; our philosophy is to provide all the
|
|
99
|
-
pieces for you to develop your docs site with your styles. This approach is perfect
|
|
100
|
-
for building design systems that use the styles from your design in your docs.
|
|
101
|
-
|
|
102
|
-
We can add a `docs` template that will be used when rendering any documentation
|
|
103
|
-
page because of Ember's routing and templating patterns.
|
|
104
|
-
|
|
105
|
-
In your `app/templates/docs.hbs` add the following:
|
|
106
|
-
|
|
107
|
-
```hbs
|
|
108
|
-
<DocfyOutput @scope="docs" as |node|>
|
|
109
|
-
<ul>
|
|
110
|
-
{{#each node.pages as |page|}}
|
|
111
|
-
<li>
|
|
112
|
-
<DocfyLink @to={{page.url}}>
|
|
113
|
-
{{page.title}}
|
|
114
|
-
</DocfyLink>
|
|
115
|
-
</li>
|
|
116
|
-
{{/each}}
|
|
117
|
-
</ul>
|
|
118
|
-
</DocfyOutput>
|
|
119
|
-
|
|
120
|
-
<div>
|
|
121
|
-
{{outlet}}
|
|
122
|
-
</div>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
This example uses two components, `DocfyOutput` and `DocfyLink`. It is also
|
|
126
|
-
the simplest navigation component we can build, ignoring any nested sections
|
|
127
|
-
you might define. You can learn more about these components and their capabilities
|
|
128
|
-
in their respective documentation page.
|
|
129
|
-
|
|
130
|
-
## Add Previous and Next Page Links
|
|
131
|
-
|
|
132
|
-
Documentation sites usually have a previous and next page link. Docfy provides a component that gives you the ability to add this feature.
|
|
133
|
-
|
|
134
|
-
At the end of the `docs.hbs` file, add the following:
|
|
135
|
-
|
|
136
|
-
```hbs
|
|
137
|
-
<DocfyPreviousAndNextPage as |previous next|>
|
|
138
|
-
<div>
|
|
139
|
-
{{#if previous}}
|
|
140
|
-
Previous:
|
|
141
|
-
|
|
142
|
-
<DocfyLink @to={{previous.url}}>
|
|
143
|
-
{{previous.title}}
|
|
144
|
-
</DocfyLink>
|
|
145
|
-
{{/if}}
|
|
146
|
-
</div>
|
|
147
|
-
<div>
|
|
148
|
-
{{#if next}}
|
|
149
|
-
Next:
|
|
150
|
-
|
|
151
|
-
<DocfyLink @to={{next.url}}>
|
|
152
|
-
{{next.title}}
|
|
153
|
-
</DocfyLink>
|
|
154
|
-
{{/if}}
|
|
155
|
-
</div>
|
|
156
|
-
</DocfyPreviousAndNextPage>
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
## Other Features
|
|
160
|
-
|
|
161
|
-
Docfy has other abilities that we haven't covered here. For example, we can build
|
|
162
|
-
a section that displays "on this page", which lists all the headings in the document.
|
|
163
|
-
Another example is adding a link to edit the markdown file on GitHub. Another
|
|
164
|
-
useful feature is the ability to demo components out of markdown files. These
|
|
165
|
-
features are covered throughout the docs.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Demo of Docfy Demos :D
|
|
2
|
-
|
|
3
|
-
This is a cool feature of Docfy. It is perfect for documenting design systems and
|
|
4
|
-
component libraries.
|
|
5
|
-
|
|
6
|
-
> Note that this text was extracted from the markdown demo file.
|
|
7
|
-
|
|
8
|
-
```hbs template
|
|
9
|
-
This is my Demo: <DocfyLink @to={{this.url}}>My Link</DocfyLink>
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
```js component
|
|
13
|
-
import Component from '@glimmer/component';
|
|
14
|
-
|
|
15
|
-
export default class MyDemo extends Component {
|
|
16
|
-
url = '/docs';
|
|
17
|
-
}
|
|
18
|
-
```
|
package/docs/writing-demos.md
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
order: 3
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Writing Demos
|
|
6
|
-
|
|
7
|
-
Docfy has a concept of "demo" markdown files. It allows you to write code in
|
|
8
|
-
markdown and have them be extracted as executable code in the host app. You can
|
|
9
|
-
learn more about the file location rules in [Writing Markdown - Demos](../../../docs/writing-markdown.md#demos).
|
|
10
|
-
|
|
11
|
-
In the context of Ember, all demos are extracted as components. These components
|
|
12
|
-
can have a template, component, and style code block. Components can also be
|
|
13
|
-
template only components by only specifying the HBS template.
|
|
14
|
-
|
|
15
|
-
> Note that styles will be extracted as a co-located file with the component,
|
|
16
|
-
> it would only work if your host app is using [Ember CSS Modules](https://github.com/salsify/ember-css-modules)
|
|
17
|
-
> or something similar.
|
|
18
|
-
|
|
19
|
-
Below you can see how a demo markdown file looks like.
|
|
20
|
-
|
|
21
|
-
```md file=writing-demos-demo/demo1.md
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The demo will be inserted into the owner file as a new section called "Examples";
|
|
26
|
-
you can see it below.
|
|
27
|
-
|
|
28
|
-
Please note that you must pass a metadata to the code block, it can be seen
|
|
29
|
-
after the file type in the example above. The meta is used to identify the purpose
|
|
30
|
-
of the code block. The possible values are `component`, `template`, and `styles`.
|
|
31
|
-
|
|
32
|
-
> You can write TypeScript for the component JS as well, if your host app is
|
|
33
|
-
> configured to support it.
|
|
34
|
-
|
|
35
|
-
## Preview Template
|
|
36
|
-
|
|
37
|
-
When writing documentation in Ember apps, we might want to write some template
|
|
38
|
-
code to demonstrate how to use a component whilst also having the code
|
|
39
|
-
executed to embed the same template into the rendered markdown. Creating a
|
|
40
|
-
demo markdown might be too much of an effort; for this purpose, Docfy has
|
|
41
|
-
another feature called `preview-template`. It will extract the template from
|
|
42
|
-
the markdown code block and create a component backed by an empty Glimmer
|
|
43
|
-
component class to provide a `this` context so helpers such as `mut` or `set`
|
|
44
|
-
can be used within the demonstration. It will also add the code snippet so
|
|
45
|
-
users can see the code.
|
|
46
|
-
|
|
47
|
-
Below is an example of how it works:
|
|
48
|
-
|
|
49
|
-
````md
|
|
50
|
-
```hbs preview-template
|
|
51
|
-
Click in the link to navigate to the home page: <DocfyLink @to="/">Home</DocfyLink>
|
|
52
|
-
```
|
|
53
|
-
````
|
|
54
|
-
|
|
55
|
-
And here you can see how it looks like when rendered:
|
|
56
|
-
|
|
57
|
-
```hbs preview-template
|
|
58
|
-
Click in the link to navigate to the home page: <DocfyLink @to="/">Home</DocfyLink>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Manual Insertion
|
|
62
|
-
|
|
63
|
-
To make getting started with Docfy as simple as possible, by default demos will
|
|
64
|
-
be automatically inserted into the owner file under a new section called
|
|
65
|
-
"Examples" before the second heading of the page.
|
|
66
|
-
|
|
67
|
-
If you want more control over how demos are inserted into the page, you can
|
|
68
|
-
declare `manualDemoInsertion` in a markdown page's frontmatter.
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
---
|
|
72
|
-
title: Document with many examples
|
|
73
|
-
manualDemoInsertion: true
|
|
74
|
-
---
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
When a page is using `manualDemoInsertion`, by default no demos are inserted
|
|
78
|
-
into the page. Instead, you must provide markers in your markdown that will be
|
|
79
|
-
replaced. They follow the form `[[demo:name-of-demo]]`.
|
|
80
|
-
|
|
81
|
-
```md
|
|
82
|
-
# Title here
|
|
83
|
-
|
|
84
|
-
The demo will be inserted after this line.
|
|
85
|
-
|
|
86
|
-
[[demo:demo1]]
|
|
87
|
-
|
|
88
|
-
And the prose of the document will continue exactly how the author wishes.
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Sometimes as an author, you want control over where in the page demos will be
|
|
92
|
-
inserted, but you don't need to control this location demo by demo. As a
|
|
93
|
-
shorthand, you can provide the `[[demos-all]]` marker to insert all demos.
|
|
94
|
-
|
|
95
|
-
```md
|
|
96
|
-
# Title here
|
|
97
|
-
|
|
98
|
-
All demos go here.
|
|
99
|
-
|
|
100
|
-
[[demos-all]]
|
|
101
|
-
|
|
102
|
-
Below is the equivalent if you had to mark all demos individually.
|
|
103
|
-
|
|
104
|
-
[[demo:demo1]]
|
|
105
|
-
|
|
106
|
-
[[demo:demo2]]
|
|
107
|
-
|
|
108
|
-
[[demo:demo3]]
|
|
109
|
-
```
|
package/dummy-docs/README.md
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
# Welcome to Docfy
|
|
2
|
-
|
|
3
|
-
This project is on GitHub.
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
## h2 Heading
|
|
8
|
-
|
|
9
|
-
### h3 Heading
|
|
10
|
-
|
|
11
|
-
#### h4 Heading
|
|
12
|
-
|
|
13
|
-
##### h5 Heading
|
|
14
|
-
|
|
15
|
-
###### h6 Heading
|
|
16
|
-
|
|
17
|
-
## Paragraphs
|
|
18
|
-
|
|
19
|
-
I really like using Markdown.
|
|
20
|
-
|
|
21
|
-
I think I'll use it to format all of my documents from now on.
|
|
22
|
-
|
|
23
|
-
"Smartypants, double quotes" and 'single quotes'
|
|
24
|
-
|
|
25
|
-
## Emphasis
|
|
26
|
-
|
|
27
|
-
**This is bold text**
|
|
28
|
-
|
|
29
|
-
**This is bold text**
|
|
30
|
-
|
|
31
|
-
_This is italic text_
|
|
32
|
-
|
|
33
|
-
_This is italic text_
|
|
34
|
-
|
|
35
|
-
~~Strikethrough~~
|
|
36
|
-
|
|
37
|
-
## Blockquotes
|
|
38
|
-
|
|
39
|
-
> Dorothy followed her through many of the beautiful rooms in her castle.
|
|
40
|
-
|
|
41
|
-
### Blockquotes with Multiple Paragraphs
|
|
42
|
-
|
|
43
|
-
> Dorothy followed her through many of the beautiful rooms in her castle.
|
|
44
|
-
>
|
|
45
|
-
> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
|
|
46
|
-
|
|
47
|
-
### Nested Blockquotes
|
|
48
|
-
|
|
49
|
-
> Dorothy followed her through many of the beautiful rooms in her castle.
|
|
50
|
-
>
|
|
51
|
-
> > The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
|
|
52
|
-
|
|
53
|
-
## Lists
|
|
54
|
-
|
|
55
|
-
Unordered
|
|
56
|
-
|
|
57
|
-
- Create a list by starting a line with `+`, `-`, or `*`
|
|
58
|
-
- Sub-lists are made by indenting 2 spaces:
|
|
59
|
-
- Marker character change forces new list start:
|
|
60
|
-
- Ac tristique libero volutpat at
|
|
61
|
-
* Facilisis in pretium nisl aliquet
|
|
62
|
-
- Nulla volutpat aliquam velit
|
|
63
|
-
- Very easy!
|
|
64
|
-
|
|
65
|
-
Ordered
|
|
66
|
-
|
|
67
|
-
1. Lorem ipsum dolor sit amet
|
|
68
|
-
2. Consectetur adipiscing elit
|
|
69
|
-
3. Integer molestie lorem at massa
|
|
70
|
-
|
|
71
|
-
4. You can use sequential numbers...
|
|
72
|
-
5. ...or keep all the numbers as `1.`
|
|
73
|
-
|
|
74
|
-
Start numbering with offset:
|
|
75
|
-
|
|
76
|
-
57. foo
|
|
77
|
-
1. bar
|
|
78
|
-
|
|
79
|
-
## Code
|
|
80
|
-
|
|
81
|
-
Inline `code`
|
|
82
|
-
|
|
83
|
-
Indented code
|
|
84
|
-
|
|
85
|
-
// Some comments
|
|
86
|
-
line 1 of code
|
|
87
|
-
line 2 of code
|
|
88
|
-
line 3 of code
|
|
89
|
-
|
|
90
|
-
Block code "fences"
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
Sample text here...
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Syntax highlighting
|
|
97
|
-
|
|
98
|
-
```js
|
|
99
|
-
var foo = function (bar) {
|
|
100
|
-
return bar++;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
console.log(foo(5));
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Tables
|
|
107
|
-
|
|
108
|
-
| Option | Description |
|
|
109
|
-
| ------ | ------------------------------------------------------------------------- |
|
|
110
|
-
| data | path to data files to supply the data that will be passed into templates. |
|
|
111
|
-
| engine | engine to be used for processing templates. Handlebars is the default. |
|
|
112
|
-
| ext | extension to be used for dest files. |
|
|
113
|
-
|
|
114
|
-
Right aligned columns
|
|
115
|
-
|
|
116
|
-
| Option | Description |
|
|
117
|
-
| -----: | ------------------------------------------------------------------------: |
|
|
118
|
-
| data | path to data files to supply the data that will be passed into templates. |
|
|
119
|
-
| engine | engine to be used for processing templates. Handlebars is the default. |
|
|
120
|
-
| ext | extension to be used for dest files. |
|
|
121
|
-
|
|
122
|
-
## Links
|
|
123
|
-
|
|
124
|
-
[link text](http://dev.nodeca.com)
|
|
125
|
-
|
|
126
|
-
[link with title](http://nodeca.github.io/pica/demo/ 'title text!')
|
|
127
|
-
|
|
128
|
-
Autoconverted link https://github.com/nodeca/pica (enable linkify to see)
|
|
129
|
-
|
|
130
|
-
## Images
|
|
131
|
-
|
|
132
|
-

|
|
133
|
-
|
|
134
|
-
Like links, Images also have a footnote style syntax
|
|
135
|
-
|
|
136
|
-
![Alt text][id]
|
|
137
|
-
|
|
138
|
-
With a reference later in the document defining the URL location:
|
|
139
|
-
|
|
140
|
-
[id]: https://octodex.github.com/images/dojocat.jpg 'The Dojocat'
|
|
Binary file
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
order: 0
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Introduction
|
|
6
|
-
|
|
7
|
-
Lorem markdownum animaeque obsedit adversam, saevi sed resupina tenuesque levius
|
|
8
|
-
tenenti utque. Cornibus et opes crudelia primus procul alvum exit: dum frondes!
|
|
9
|
-
Cornibus e, putat procul nostro erat cunctantem munus inventus quod.
|
|
10
|
-
|
|
11
|
-
- Unus frondes
|
|
12
|
-
- Gelida vos cultus vada dicta sunt lacerto
|
|
13
|
-
- Utque meum referam
|
|
14
|
-
|
|
15
|
-
## How it works
|
|
16
|
-
|
|
17
|
-
Poterisne perque Threiciis angue adlevat, parari non canisve mane opemque et
|
|
18
|
-
inpar corpora suspiria traxit Teucri vulgique monte?
|
|
19
|
-
|
|
20
|
-
## Show me some code
|
|
21
|
-
|
|
22
|
-
Byblis vobisque me venerisque possem **una** nihil volui desiderioque quam
|
|
23
|
-
parilique quosque victor contingere urbem monendo. Meae est precor moenibus.
|
|
24
|
-
|
|
25
|
-
1. Suis cum ille
|
|
26
|
-
2. Recipit precor in opus quam Philyreia potest
|
|
27
|
-
|
|
28
|
-
```js
|
|
29
|
-
import Docfy from '@docfy/core';
|
|
30
|
-
```
|
package/dummy-docs/overview.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
order: 2
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Overview
|
|
6
|
-
|
|
7
|
-
Byblis vobisque me venerisque possem **una** nihil volui desiderioque quam
|
|
8
|
-
parilique quosque victor contingere urbem monendo. Meae est precor moenibus.
|
|
9
|
-
|
|
10
|
-
1. Suis cum ille
|
|
11
|
-
2. Repperit undique sic aras ad passu vocant
|
|
12
|
-
3. Recipit precor in opus quam Philyreia potest
|
|
13
|
-
4. Sparsas temptat peregit susceptaque femori ferox grande
|
|
14
|
-
|
|
15
|
-
Sed ver Eumenidum in duorum quis anhelatos, currum voce? **Thracum** servabat
|
|
16
|
-
matris cornua positis certo.
|
|
17
|
-
|
|
18
|
-
Please check the [introduction on how it
|
|
19
|
-
works `inline code`](./introduction.md#how-it-works).
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
category: core
|
|
3
|
-
subcategory: helpers
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# genereateFlatOutput
|
|
7
|
-
|
|
8
|
-
Lorem markdownum animaeque obsedit adversam, saevi sed resupina tenuesque levius
|
|
9
|
-
tenenti utque. Cornibus et opes crudelia primus procul alvum exit: dum frondes!
|
|
10
|
-
Cornibus e, putat procul nostro erat cunctantem munus inventus quod.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
category: core
|
|
3
|
-
subcategory: helpers
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# genereateNestedOutput
|
|
7
|
-
|
|
8
|
-
[Link](../overview.md).
|
|
9
|
-
|
|
10
|
-
Lorem markdownum animaeque obsedit adversam, saevi sed resupina tenuesque levius
|
|
11
|
-
tenenti utque. Cornibus et opes crudelia primus procul alvum exit: dum frondes!
|
|
12
|
-
Cornibus e, putat procul nostro erat cunctantem munus inventus quod.
|