Skip to content

docs: auto generate markdown files #441

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

Merged
merged 10 commits into from
Nov 22, 2023
Merged
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
31 changes: 31 additions & 0 deletions .github/workflows/generate_markdown_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Generate markdown files

on: push

jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
- name: Install pnpm
uses: pnpm/[email protected]
- name: Install deps
run: pnpm i
- name: generate-docs
run: pnpm run docs
- name: Auto Generate Markdown Files
id: generate-markdown
uses: EndBug/add-and-commit@v9
with:
message: "Auto generated documentation"
add: "*.md"
push: true
pull: --rebase --autostash
default_author: github_actions
- name: Fail on push
run: |
if [[ ${{ steps.generate-markdown.outputs.pushed }} == true ]]; then exit 1; else exit 0; fi
1 change: 1 addition & 0 deletions .github/workflows/third_party_notices_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 18.x
Expand Down
5 changes: 4 additions & 1 deletion packages/pages/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "<projectFolder>/dist/types/<unscopedPackageName>.d.ts"
},
"tsdocMetadata": {},
Expand All @@ -28,6 +27,10 @@
"ae-unresolved-link": {
"logLevel": "none",
"addToApiReportFile": true
},
"ae-internal-missing-underscore": {
"logLevel": "none",
"addToApiReportFile": false
}
},
"tsdocMessageReporting": {
Expand Down
4 changes: 2 additions & 2 deletions packages/pages/docs/api/pages.attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

Custom type for specifying HTML element attributes in the [Tag](./pages.tag.md) interface.

<b>Signature:</b>
**Signature:**

```typescript
export declare type Attributes = Record<string, string>;
export type Attributes = Record<string, string>;
```
13 changes: 13 additions & 0 deletions packages/pages/docs/api/pages.functionmodule.default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/pages](./pages.md) &gt; [FunctionModule](./pages.functionmodule.md) &gt; [default](./pages.functionmodule.default.md)

## FunctionModule.default property

The exported function

**Signature:**

```typescript
default?: FunctionType;
```
19 changes: 19 additions & 0 deletions packages/pages/docs/api/pages.functionmodule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/pages](./pages.md) &gt; [FunctionModule](./pages.functionmodule.md)

## FunctionModule interface

Defines the functions and fields that are available to the serverless function.

**Signature:**

```typescript
export interface FunctionModule
```

## Properties

| Property | Modifiers | Type | Description |
| --------------------------------------------- | --------- | --------------------------------------- | ---------------------------------- |
| [default?](./pages.functionmodule.default.md) | | [FunctionType](./pages.functiontype.md) | _(Optional)_ The exported function |
15 changes: 15 additions & 0 deletions packages/pages/docs/api/pages.functiontype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/pages](./pages.md) &gt; [FunctionType](./pages.functiontype.md)

## FunctionType type

The valid Serverless Function types;

**Signature:**

```typescript
export type FunctionType = HttpFunction | OnUrlChangeFunction;
```

**References:** [HttpFunction](./pages.httpfunction.md)<!-- -->, [OnUrlChangeFunction](./pages.onurlchangefunction.md)
6 changes: 3 additions & 3 deletions packages/pages/docs/api/pages.getheadconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

The type definition for the template's getHeadConfig function. getHeadConfig takes in the provided data and will output a HeadConfig object which will be used to generate the tags inside the head tag of the generated HTML document.

<b>Signature:</b>
**Signature:**

```typescript
export declare type GetHeadConfig<T extends TemplateRenderProps> = (
export type GetHeadConfig<T extends TemplateRenderProps> = (
props: T
) => HeadConfig;
```

<b>References:</b> [TemplateRenderProps](./pages.templaterenderprops.md)<!-- -->, [HeadConfig](./pages.headconfig.md)
**References:** [TemplateRenderProps](./pages.templaterenderprops.md)<!-- -->, [HeadConfig](./pages.headconfig.md)
4 changes: 2 additions & 2 deletions packages/pages/docs/api/pages.getlang.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

Function that takes in a [HeadConfig](./pages.headconfig.md) interface and a props, and returns the lang value that will be set on the HTML tag.

<b>Signature:</b>
**Signature:**

```typescript
getLang: <T extends TemplateRenderProps>(
getLang: <T extends TemplateRenderProps<any>>(
headConfig: HeadConfig | undefined,
props: T
) => string;
Expand Down
6 changes: 3 additions & 3 deletions packages/pages/docs/api/pages.getpath.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

The type definition for the template's getPath function.

<b>Signature:</b>
**Signature:**

```typescript
export declare type GetPath<T extends TemplateProps> = (props: T) => string;
export type GetPath<T extends TemplateProps> = (props: T) => string;
```

<b>References:</b> [TemplateProps](./pages.templateprops.md)
**References:** [TemplateProps](./pages.templateprops.md)
8 changes: 3 additions & 5 deletions packages/pages/docs/api/pages.getredirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@

The type definiton for the template's getRedirects function.

<b>Signature:</b>
**Signature:**

```typescript
export declare type GetRedirects<T extends TemplateProps> = (
props: T
) => string[];
export type GetRedirects<T extends TemplateProps> = (props: T) => string[];
```

<b>References:</b> [TemplateProps](./pages.templateprops.md)
**References:** [TemplateProps](./pages.templateprops.md)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Function that takes a path to a generated template and returns the relative path to the root of the site. Will return the empty string if already at the root level.

<b>Signature:</b>
**Signature:**

```typescript
getRelativePrefixToRootFromPath: (path: string) => string;
Expand Down
2 changes: 1 addition & 1 deletion packages/pages/docs/api/pages.headconfig.charset.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Declares the document's encoding. Will default to 'UTF-8' if omitted.

<b>Signature:</b>
**Signature:**

```typescript
charset?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/pages/docs/api/pages.headconfig.lang.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Lang of the page. Will be set to the document's locale if omitted.

<b>Signature:</b>
**Signature:**

```typescript
lang?: string;
Expand Down
18 changes: 9 additions & 9 deletions packages/pages/docs/api/pages.headconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

The configuration that allows users to entirely arbitarily set the inner contents of the head element that will be prepended to the generated HTML document.

<b>Signature:</b>
**Signature:**

```typescript
export interface HeadConfig
```

## Properties

| Property | Modifiers | Type | Description |
| ------------------------------------------- | --------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [charset?](./pages.headconfig.charset.md) | | string | <i>(Optional)</i> Declares the document's encoding. Will default to 'UTF-8' if omitted. |
| [lang?](./pages.headconfig.lang.md) | | string | <i>(Optional)</i> Lang of the page. Will be set to the document's locale if omitted. |
| [other?](./pages.headconfig.other.md) | | string | <i>(Optional)</i> For any content that can't be fully encapsulted by our Tag interface, (i.e. template or style) an arbitrary, user-defined string can be provided. |
| [tags?](./pages.headconfig.tags.md) | | [Tag](./pages.tag.md)<!-- -->\[\] | <i>(Optional)</i> Well-defined interface for adding HTML tags (such as meta tags) |
| [title?](./pages.headconfig.title.md) | | string | <i>(Optional)</i> Title of the page. Will default to 'Yext Pages Site' if omitted. |
| [viewport?](./pages.headconfig.viewport.md) | | string | <i>(Optional)</i> Declares the size and shape of the document's viewport. Will default to 'width=device-width, initial-scale=1' if omitted. |
| Property | Modifiers | Type | Description |
| ------------------------------------------- | --------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [charset?](./pages.headconfig.charset.md) | | string | _(Optional)_ Declares the document's encoding. Will default to 'UTF-8' if omitted. |
| [lang?](./pages.headconfig.lang.md) | | string | _(Optional)_ Lang of the page. Will be set to the document's locale if omitted. |
| [other?](./pages.headconfig.other.md) | | string | _(Optional)_ For any content that can't be fully encapsulted by our Tag interface, (i.e. template or style) an arbitrary, user-defined string can be provided. |
| [tags?](./pages.headconfig.tags.md) | | [Tag](./pages.tag.md)<!-- -->\[\] | _(Optional)_ Well-defined interface for adding HTML tags (such as meta tags) |
| [title?](./pages.headconfig.title.md) | | string | _(Optional)_ Title of the page. Will default to 'Yext Pages Site' if omitted. |
| [viewport?](./pages.headconfig.viewport.md) | | string | _(Optional)_ Declares the size and shape of the document's viewport. Will default to 'width=device-width, initial-scale=1' if omitted. |
2 changes: 1 addition & 1 deletion packages/pages/docs/api/pages.headconfig.other.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

For any content that can't be fully encapsulted by our Tag interface, (i.e. template or style) an arbitrary, user-defined string can be provided.

<b>Signature:</b>
**Signature:**

```typescript
other?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/pages/docs/api/pages.headconfig.tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Well-defined interface for adding HTML tags (such as meta tags)

<b>Signature:</b>
**Signature:**

```typescript
tags?: Tag[];
Expand Down
2 changes: 1 addition & 1 deletion packages/pages/docs/api/pages.headconfig.title.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Title of the page. Will default to 'Yext Pages Site' if omitted.

<b>Signature:</b>
**Signature:**

```typescript
title?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/pages/docs/api/pages.headconfig.viewport.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Declares the size and shape of the document's viewport. Will default to 'width=device-width, initial-scale=1' if omitted.

<b>Signature:</b>
**Signature:**

```typescript
viewport?: string;
Expand Down
15 changes: 15 additions & 0 deletions packages/pages/docs/api/pages.httpfunction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/pages](./pages.md) &gt; [HttpFunction](./pages.httpfunction.md)

## HttpFunction type

A function that runs when a specific path is visited on the site.

**Signature:**

```typescript
export type HttpFunction = (arg: SitesHttpRequest) => SitesHttpResponse;
```

**References:** [SitesHttpRequest](./pages.siteshttprequest.md)<!-- -->, [SitesHttpResponse](./pages.siteshttpresponse.md)
17 changes: 9 additions & 8 deletions packages/pages/docs/api/pages.manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@

A manifest of bundled files present during a production build.

<b>Signature:</b>
**Signature:**

```typescript
export declare type Manifest = {
bundlePaths: {
export type Manifest = {
serverPaths: {
[key: string]: string;
};
projectFilepaths: {
templatesRoot: string;
distRoot: string;
hydrationBundleOutputRoot: string;
serverBundleOutputRoot: string;
clientPaths: {
[key: string]: string;
};
renderPaths: {
[key: string]: string;
};
projectStructure: ProjectStructureConfig;
bundlerManifest?: any;
};
```
Loading