You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/configuration.md
+115Lines changed: 115 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -562,3 +562,118 @@ Then in your documentation files, you can use sphinx-rust directives:
562
562
563
563
\`\`\`
564
564
````
565
+
566
+
## Sphinx-JS Integration
567
+
568
+
Yardang provides integration with [sphinx-js](https://pypi.org/project/sphinx-js/) for documenting JavaScript and TypeScript code. To use this feature, you also need JSDoc or TypeDoc installed:
569
+
570
+
```bash
571
+
# For JavaScript projects
572
+
npm install jsdoc
573
+
574
+
# For TypeScript projects
575
+
npm install typedoc
576
+
```
577
+
578
+
All sphinx-js configuration is under `[tool.yardang.sphinx-js]`.
579
+
580
+
### `js-source-path`
581
+
582
+
A list of directories containing your JS/TS source files, relative to the project root. This is required to enable sphinx-js.
583
+
584
+
```toml
585
+
[tool.yardang.sphinx-js]
586
+
js-source-path = ["src", "lib"]
587
+
```
588
+
589
+
Or as a single path:
590
+
591
+
```toml
592
+
[tool.yardang.sphinx-js]
593
+
js-source-path = "src"
594
+
```
595
+
596
+
### `js-language`
597
+
598
+
The language of your source files. Use `"javascript"` (default) or `"typescript"`.
599
+
600
+
```toml
601
+
[tool.yardang.sphinx-js]
602
+
js-language = "typescript"
603
+
```
604
+
605
+
### `root-for-relative-js-paths`
606
+
607
+
The root directory for resolving relative JS entity paths. Required if you have multiple `js-source-path` entries.
608
+
609
+
```toml
610
+
[tool.yardang.sphinx-js]
611
+
root-for-relative-js-paths = "src"
612
+
```
613
+
614
+
### `jsdoc-config-path`
615
+
616
+
Path to a JSDoc configuration file.
617
+
618
+
```toml
619
+
[tool.yardang.sphinx-js]
620
+
jsdoc-config-path = "jsdoc.json"
621
+
```
622
+
623
+
### `jsdoc-tsconfig-path`
624
+
625
+
Path to a TypeScript configuration file (for TypeDoc).
626
+
627
+
```toml
628
+
[tool.yardang.sphinx-js]
629
+
jsdoc-tsconfig-path = "tsconfig.json"
630
+
```
631
+
632
+
### `ts-type-bold`
633
+
634
+
Make TypeScript types bold in the output. Defaults to `false`.
635
+
636
+
```toml
637
+
[tool.yardang.sphinx-js]
638
+
ts-type-bold = true
639
+
```
640
+
641
+
### Complete Example
642
+
643
+
Here's a complete example configuration for a TypeScript project:
644
+
645
+
```toml
646
+
[tool.yardang]
647
+
title = "My TypeScript Library"
648
+
root = "docs/index.md"
649
+
pages = ["docs/api.md", "docs/examples.md"]
650
+
use-autoapi = false
651
+
652
+
[tool.yardang.sphinx-js]
653
+
js-language = "typescript"
654
+
js-source-path = ["src"]
655
+
jsdoc-tsconfig-path = "tsconfig.json"
656
+
ts-type-bold = true
657
+
```
658
+
659
+
Then in your documentation files, you can use sphinx-js directives:
0 commit comments