Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add back/prev button in generator documentation #1178

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pages/docs/tools/generator/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,20 @@ const content = await Generator.getTemplateFile('@asyncapi/html-template', 'part
const Generator = require('@asyncapi/generator');
const content = await Generator.getTemplateFile('@asyncapi/html-template', 'partials/content.html', '~/my-templates');
```

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/versioning',
title: 'Generator version vs template version',
type:'back',
},
{
href: '/docs/tools/generator/template-development',
title: 'Template development',
type:'next',
}
]}
/>
17 changes: 17 additions & 0 deletions pages/docs/tools/generator/asyncapi-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,20 @@ In the sample code snippet below, notice how you can access the contents of the
```

> To learn about the various instances you can use to access the documents' content, look at the API of the AsyncAPI JavaScript Parser and the structure of [AsyncAPIDocument](https://github.com/asyncapi/parser-js/blob/master/API.md#module_@asyncapi/parser+AsyncAPIDocument)

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/usage',
title: 'Usage',
type:'back',
},
{
href: '/docs/tools/generator/template',
title: 'Template',
type:'next',
}
]}
/>
16 changes: 16 additions & 0 deletions pages/docs/tools/generator/configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,20 @@ There are some template parameters that have a special meaning:
|---|---|
|`server`| It is used to let the template know which server from the AsyncAPI specification file you want to use. In some cases, this may be required. For instance, when generating code that connects to a specific server. Use this parameter in case your template relies on users' information about what server from the specification file they want to use during generation. You also need this parameter if you want to use `server.protocol` notation within `conditionalFiles` configuration option. Once you decide to specify this parameter for your template, it is recommended you make it a mandatory parameter otherwise a feature like `conditionalFiles` is not going to work if your users do not use this parameter obligatory.

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/template-development',
title: 'Template development',
type:'back',
},
{
href: '/docs/tools/generator/template-context',
title: 'Template context',
type:'next',
}
]}
/>

19 changes: 18 additions & 1 deletion pages/docs/tools/generator/file-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,21 @@ export default function({ asyncapi }) {
<File name={`file2.html`}>Content</File>
]
}
```
```

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/hooks',
title: 'Hooks',
type:'back',
},
{
href: '/docs/tools/generator/typescript-support',
title: 'TypeScript support',
type:'next',
}
]}
/>
19 changes: 18 additions & 1 deletion pages/docs/tools/generator/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,21 @@ module.exports = {
return currentFilename.replace('-', '_')
};
};
```
```

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/nunjucks-render-engine',
title: 'Nunjucks render engine',
type:'back',
},
{
href: '/docs/tools/generator/file-templates',
title: 'File templates',
type:'next',
}
]}
/>
19 changes: 18 additions & 1 deletion pages/docs/tools/generator/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,21 @@ graph LR
D --> J[Java Spring Boot]
D --> K[Anything else]
```
**`params`** are template-specific options passed to the `asyncapi generate fromTemplate` CLI command to customize the generated output.
**`params`** are template-specific options passed to the `asyncapi generate fromTemplate` CLI command to customize the generated output.

---

<DocsButton
suggestions={[
{
href: '/docs/tools/',
title: 'Overview',
type:'back',
},
{
href: '/docs/tools/generator/installation-guide',
title: 'Installation guide',
type:'next',
}
]}
/>
17 changes: 17 additions & 0 deletions pages/docs/tools/generator/installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,20 @@ npm uninstall @asyncapi/cli -g
Use the generator library in your Node.js projects by installing it via the following command: `npm install @asyncapi/generator`.

> Don't include the `-g` flag in the installation command above since you're not installing the generator library globally but in your Node.js project.

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/',
title: 'Introduction',
type:'back',
},
{
href: '/docs/tools/generator/usage',
title: 'Usage',
type:'next',
}
]}
/>
16 changes: 16 additions & 0 deletions pages/docs/tools/generator/nunjucks-render-engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,20 @@ async function asyncCamelCase(str, callback) {

In case you have more than one template and want to reuse filters, you can put them in a single library. You can configure such a library in the template configuration under `filters` property. You can also use the official AsyncAPI [filters library](https://github.com/asyncapi/generator-filters). To learn how to add such filters to configuration [read more about the configuration file](#configuration-file).

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/react-render-engine',
title: 'React render engine',
type:'back',
},
{
href: '/docs/tools/generator/hooks',
title: 'Hooks',
type:'next',
}
]}
/>

16 changes: 16 additions & 0 deletions pages/docs/tools/generator/parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,19 @@ graph TD

> To learn more about the Parser and access all of its features, check out the AsyncAPI [Parser’s GitHub repository](https://github.com/asyncapi/parser-js).

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/template',
title: 'Template',
type:'back',
},
{
href: '/docs/tools/generator/versioning',
title: 'Generator version vs template version',
type:'next',
}
]}
/>
17 changes: 17 additions & 0 deletions pages/docs/tools/generator/react-render-engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,21 @@ With React, it enables you to debug your templates. For Visual Studio Code, we h

Now replace `./asyncapi.yml` with your document of choice. Replace `./template` with the path to your React template. You can now debug your template by adding any breakpoints you want and inspect your code.

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/template-context',
title: 'Template context',
type:'back',
},
{
href: '/docs/tools/generator/nunjucks-render-engine',
title: 'Nunjucks render engine',
type:'next',
}
]}
/>


19 changes: 18 additions & 1 deletion pages/docs/tools/generator/template-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,21 @@ The extra context passed to the render engine during the generation process and

- **`originalAsyncAPI`** is a stringified version of the original AsyncAPI document that the user passed to the Generator.
- **`asyncapi`** is a parsed AsyncAPI document with helper functions and properties. You should use it to access document contents e.g `asyncapi.title`.
- **`params`** is an object with all the parameters passed to the Generator by the user.
- **`params`** is an object with all the parameters passed to the Generator by the user.

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/configuration-file',
title: 'Configuration file',
type:'back',
},
{
href: '/docs/tools/generator/react-render-engine',
title: 'React render engine',
type:'next',
}
]}
/>
17 changes: 17 additions & 0 deletions pages/docs/tools/generator/template-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,20 @@ The updated template looks like the following:
<Text>App name: **{ asyncapi.info().title() }**</Text>
<Text>Version: **{asyncapi.info.version()}**</Text>
```

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/api',
title: 'Library API',
type:'back',
},
{
href: '/docs/tools/generator/configuration-file',
title: 'Configuration file',
type:'next',
}
]}
/>
17 changes: 17 additions & 0 deletions pages/docs/tools/generator/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,20 @@ Template Name | Description | Source code

> Check out all our community [generator templates](https://github.com/search?q=topic%3Aasyncapi+topic%3Agenerator+topic%3Atemplate)

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/asyncapi-document',
title: 'AsyncAPI document',
type:'back',
},
{
href: '/docs/tools/generator/parser',
title: 'Parser',
type:'next',
}
]}
/>

16 changes: 16 additions & 0 deletions pages/docs/tools/generator/typescript-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,20 @@ The AsyncAPI generator has TypeScript support for [hooks](#hooks) and Nunjucks's
- Each package related to the typings for TypeScript like `@types/node` must be installed in the template under `dependencies` array. This is because the Generator transpiles the TypeScript code on-the-fly while rendering the template, and cannot use packages under `devDependencies`.
- Each template should have `@types/node` package installed to enable support for typings for Node.

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/file-templates',
title: 'File templates',
type:'back',
},
{
href: '/docs/tools/generator/special-file-names',
title: 'Special file names',
type:'next',
}
]}
/>

19 changes: 18 additions & 1 deletion pages/docs/tools/generator/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,21 @@ try {
}
```

See the [API documentation](api.md) for more examples and full API reference information.
See the [API documentation](api.md) for more examples and full API reference information.

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/installation-guide',
title: 'Installation guide',
type:'back',
},
{
href: '/docs/tools/generator/asyncapi-document',
title: 'AsyncAPI document',
type:'next',
}
]}
/>
19 changes: 18 additions & 1 deletion pages/docs/tools/generator/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,21 @@ npm install -g @asyncapi/[email protected]
asyncapi generate fromTemplate asyncapi.yaml @asyncapi/[email protected] -o ./docs
```

> Before using newer versions of the template, always look at the [changelog](https://github.com/asyncapi/html-template/releases) first. If the generator's features are not important to you, just make sure to use a version compatible with your template.
> Before using newer versions of the template, always look at the [changelog](https://github.com/asyncapi/html-template/releases) first. If the generator's features are not important to you, just make sure to use a version compatible with your template.

---

<DocsButton
suggestions={[
{
href: '/docs/tools/generator/parser',
title: 'Parser',
type:'back',
},
{
href: '/docs/tools/generator/api',
title: 'Library API',
type:'next',
}
]}
/>
4 changes: 2 additions & 2 deletions pages/docs/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ The following is a list of tools that compare AsyncAPI documents.
type:'back',
},
{
href: '/docs/guides',
title: 'Guides - Overview',
href: '/docs/tools/generator/',
title: 'Generator',
type:'next',
}
]}
Expand Down