Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkideal committed Oct 12, 2024
1 parent a9e2c9d commit a502b70
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 25 deletions.
30 changes: 29 additions & 1 deletion website/docs/api/latest/command_line.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ next version
Output:

```
next v0.0.4(main: 51864a35de7890d63bfd8acecdb62d20372ca963) built at 2024/09/27T22:58:21+0800 by go1.23.0
next v0.0.4(51864a35de7890d63bfd8acecdb62d20372ca963) built at 2024/09/27T22:58:21+0800 by go1.23.0
```

## Flag {#user-content-CommandLine_Flag}
Expand All @@ -85,6 +85,17 @@ myapp
2.1
```

### -F {#user-content-CommandLine_Flag_-F}

`-F` represents the custom formatter for generated code. Example:

```sh
next -F go=gofmt -s -w \
-F ts=prettier --write \
-F cpp=clang-format -i \
...
```

### -M {#user-content-CommandLine_Flag_-M}

`-M` represents the language-specific type mappings and features. **%T%**, **%T.E%**, **%N%**, **%K%**, **%V%** are placeholders replaced with actual types or values. **%T.E%** is the final element type of a vector or array. It's used to get the element type of multi-dimensional arrays.
Expand Down Expand Up @@ -255,6 +266,23 @@ See the [-D](#user-content-CommandLine_Flag_-D) flag for more information.
</div>
###### .formatter {#user-content-CommandLine_Options__formatter}
<div className="property-container">
`.formatter` represents the custom formatter for generated code.

Example:

```yaml
formatter:
go: gofmt -s -w
ts: prettier --write
java: java -jar /path/to/google-java-format-1.24.0-all-deps.jar -i
cpp: clang-format -i
```

</div>

###### .grammar {#user-content-CommandLine_Options__grammar}
<div className="property-container">

Expand Down
4 changes: 2 additions & 2 deletions website/docs/api/latest/context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ Example:
Output (for c++):

```cpp
// Code generated by "next 0.0.1"; DO NOT EDIT.
// Code generated by "next"; DO NOT EDIT.
```

Output (for c):

```c
/* Code generated by "next 0.0.1"; DO NOT EDIT. */
/* Code generated by "next"; DO NOT EDIT. */
```

## indent {#user-content-Context_indent}
Expand Down
35 changes: 25 additions & 10 deletions website/docs/api/latest/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,57 @@ pagination_prev: null
pagination_next: null
slug: /api/latest
title: Latest
version: 0.1.16
version: 0.1.18
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import useBaseUrl from "@docusaurus/useBaseUrl";

export const linkName = (name) => useBaseUrl(`/docs${frontMatter.slug}/${name}`);
export const linkName = (name) =>
useBaseUrl(`/docs${frontMatter.slug}/${name}`);

# Release Notes

## Introduction to Next {frontMatter.version}

<h2><a href={linkName("command_line")}>CommandLine</a></h2>
<h2>
<a href={linkName("command_line")}>CommandLine</a>
</h2>

CommandLine APIs process command line flags and arguments.

<h2><a href={linkName("context")}>Context</a></h2>
<h2>
<a href={linkName("context")}>Context</a>
</h2>

Context APIs are related to the template context for code generation. They provide access to contextual information and utilities used within the code generation process.

<h2><a href={linkName("environment")}>Environment</a></h2>
<h2>
<a href={linkName("environment")}>Environment</a>
</h2>

Environment APIs deal with system environment variables used by the Next compiler. These variables can affect the compilation process and output.

<h2><a href={linkName("function")}>Function</a></h2>
<h2>
<a href={linkName("function")}>Function</a>
</h2>

Function APIs encompass context-independent global functions available in templates. These utility functions can be used across different parts of your templates.

<h2><a href={linkName("grammar")}>Grammar</a></h2>
<h2>
<a href={linkName("grammar")}>Grammar</a>
</h2>

Grammar APIs are related to the custom grammar rules. The grammar is used to define a subset of the next files. It can limit the features of the next code according by your requirements.

<h2><a href={linkName("map")}>Map</a></h2>
<h2>
<a href={linkName("map")}>Map</a>
</h2>

Map APIs are related to the language-specific types and features mappings.

<h2><a href={linkName("object")}>Object</a></h2>
<h2>
<a href={linkName("object")}>Object</a>
</h2>

Object APIs define the interfaces for objects used within templates. They provide methods and properties for manipulating and accessing data structures in your code generation templates.

Expand Down
35 changes: 25 additions & 10 deletions website/docs/api/preview/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ pagination_prev: null
pagination_next: null
slug: /api/preview
title: Preview
version: 0.1.16
version: 0.1.18
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import useBaseUrl from "@docusaurus/useBaseUrl";

export const linkName = (name) => useBaseUrl(`/docs${frontMatter.slug}/${name}`);
export const linkName = (name) =>
useBaseUrl(`/docs${frontMatter.slug}/${name}`);

# Release Notes

Expand All @@ -19,31 +20,45 @@ export const linkName = (name) => useBaseUrl(`/docs${frontMatter.slug}/${name}`)
**Next {frontMatter.version} is not yet released. These are work-in-progress release notes.**
:::

<h2><a href={linkName("command_line")}>CommandLine</a></h2>
<h2>
<a href={linkName("command_line")}>CommandLine</a>
</h2>

CommandLine APIs process command line flags and arguments.

<h2><a href={linkName("context")}>Context</a></h2>
<h2>
<a href={linkName("context")}>Context</a>
</h2>

Context APIs are related to the template context for code generation. They provide access to contextual information and utilities used within the code generation process.

<h2><a href={linkName("environment")}>Environment</a></h2>
<h2>
<a href={linkName("environment")}>Environment</a>
</h2>

Environment APIs deal with system environment variables used by the Next compiler. These variables can affect the compilation process and output.

<h2><a href={linkName("function")}>Function</a></h2>
<h2>
<a href={linkName("function")}>Function</a>
</h2>

Function APIs encompass context-independent global functions available in templates. These utility functions can be used across different parts of your templates.

<h2><a href={linkName("grammar")}>Grammar</a></h2>
<h2>
<a href={linkName("grammar")}>Grammar</a>
</h2>

Grammar APIs are related to the custom grammar rules. The grammar is used to define a subset of the next files. It can limit the features of the next code according by your requirements.

<h2><a href={linkName("map")}>Map</a></h2>
<h2>
<a href={linkName("map")}>Map</a>
</h2>

Map APIs are related to the language-specific types and features mappings.

<h2><a href={linkName("object")}>Object</a></h2>
<h2>
<a href={linkName("object")}>Object</a>
</h2>

Object APIs define the interfaces for objects used within templates. They provide methods and properties for manipulating and accessing data structures in your code generation templates.

Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const URL = "https://next.as";
const REPO = "https://github.com/mkideal/next";

const customFields = {
version: "0.1.16",
version: "0.1.18",
repo: REPO,
};

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/FeaturedDownloads/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const FeaturedDownloads: React.FC = () => {
{
title: "Microsoft Windows",
description: "Windows 10 or later, Intel 64-bit processor",
fileName: `next${version}.windows.msi`,
fileName: `next${version}.windows-amd64.msi`,
},
{
title: "Apple macOS (ARM64)",
Expand Down

0 comments on commit a502b70

Please sign in to comment.