Skip to content

Commit 2402d3c

Browse files
committed
docs path thing
1 parent f1c4589 commit 2402d3c

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

apps/docs/content/docs/configuration.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,11 @@ This creates a `coda.config.mjs` file with helpful comments and examples.
2727
- **Default**: `"./src/generated"`
2828
- **Description**: Directory where generated TypeScript files will be placed
2929

30-
### `docsPath`
31-
- **Type**: `string`
32-
- **Default**: `"./docs"`
33-
- **Description**: Directory where generated markdown documentation will be placed
34-
3530
### `docs`
36-
- **Type**: `{ npmPackageName?: string }`
31+
- **Type**: `{ path?: string, npmPackageName?: string }`
3732
- **Default**: `{}`
3833
- **Description**: Documentation-specific options
34+
- `path`: Directory where generated markdown documentation will be placed (default: `"./docs"`)
3935
- `npmPackageName`: NPM package name to display badge and link in documentation
4036

4137
### `visitors`

apps/docs/content/docs/generating-docs.mdx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,28 @@ Documentation generation can be customized through `coda.config.mjs`. See the [C
2828
import { defineConfig } from "@macalinao/coda";
2929

3030
export default defineConfig({
31-
// Custom output directory for docs
32-
docsPath: "./documentation",
33-
3431
// Documentation options
3532
docs: {
33+
// Custom output directory for docs (default: "./docs")
34+
path: "./documentation",
3635
// Add NPM package badge and link
3736
npmPackageName: "@my-org/my-solana-client",
3837
},
3938
});
4039
```
4140

41+
### Custom Output Directory
42+
43+
To generate documentation to a different directory:
44+
45+
```javascript
46+
export default defineConfig({
47+
docs: {
48+
path: "./my-custom-docs",
49+
},
50+
});
51+
```
52+
4253
## NPM Package Integration
4354

4455
If you've published a TypeScript client for your program, you can include NPM package information in your documentation:

packages/coda/src/bin/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ program
135135
.action(async (options: { idl: string; config: string }) => {
136136
try {
137137
const { codama, config } = await processIdls(options);
138-
const outputPath = resolve(config.docsPath ?? "./docs");
138+
const outputPath = resolve(config.docs?.path ?? "./docs");
139139

140140
// Apply the markdown visitor with options from config
141141
console.log(`Generating documentation to ${outputPath}...`);

packages/coda/src/config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ export interface CodaConfig {
3434
*/
3535
outputDir?: string;
3636

37-
/**
38-
* Output directory for the generated documentation.
39-
* @default "./docs"
40-
*/
41-
docsPath?: string;
42-
4337
/**
4438
* Documentation generation options.
4539
*/
4640
docs?: {
41+
/**
42+
* Output directory for the generated documentation.
43+
* @default "./docs"
44+
*/
45+
path?: string;
46+
4747
/**
4848
* NPM package name for the TypeScript client.
4949
* If provided, will add an NPM badge and link to the package in the generated documentation.

0 commit comments

Comments
 (0)