Company | typeCAD | Board Name | usage-guide | Variant | released | Sheet | 1 of 1 |
Filename | ./build/atmos.kicad_pcb | Revision | 1 | Date | 3/25/2025 |
The typeCAD Documentation Generator is a tool to convert markdown files into KiCAD documentation with support for layer exports and renders.
npm install -g @typecad/typecad-docgen
typecad-docgen input.md pcb_file.kicad_pcb
This will generate an HTML file with the same name as your input markdown file (e.g., input.html
).
#
(h1) in a page, centered both horizontally and verticallyYou can customize the documentation output by adding frontmatter to your markdown file:
---
title: My PCB Project
company: Acme Electronics
board_name: Main Controller
variant: v1.0
revision: A
date: 2024-03-30
highlight: github-light
stylesheet: https://cdn.jsdelivr.net/npm/github-markdown-css@5.5.0/github-markdown.min.css
kicad_theme: default
dark_mode_default: true
---
Frontmatter options change themes, stylesheets, and provide information for the title block.
Option | Description | Default |
---|---|---|
title |
Document title | Empty |
company |
Company name | Empty |
board_name |
PCB board name | Empty |
variant |
Board variant | Empty |
revision |
Revision number | Empty |
date |
Document date | Current date |
highlight |
Code highlighting theme | github-light |
stylesheet |
Custom CSS stylesheet URL | Custom CSS |
kicad_theme |
KiCad color theme | KiCAD Default |
dark_mode_default |
Dark mode | false |
To include a PCB layer stackup visualization:

The information is extracted from the PCB file and is set in the PCB Editor, Menu > Board Setup... > Physical Stackup
.
The number after =
specifies the width in pixels and is optional.
To export specific PCB layers, use the following syntax:


kicad_theme
.User.2
might be renamed to Dimension
. KiCAD doesn’t recognize the new name, so make sure the original layer name is used in the markdown.images
folder will be created in the same folder as the markdown file.To include 3D renders of your PCB:


The render syntax is: {Render/view/x/y/z}
where:
view
: bottom, left, right, front, or backx,y,z
: rotation angles in degreesThe render will use the KiCAD preset view Follow PCB Editor
. If a layer is not visible in the PCB Editor, that layer will not be rendered.
There are two options for drill maps:

will create a drill map from the PCB fileIf you use the {Drill} method, you’ll always have an updated map and not have to manually do it. You lose some control over how it appears. KiCAD doesn’t generate the images using a theme, so it will always be black/white.
You can use a custom CSS stylesheet by adding the stylesheet
option to the frontmatter. Here’s an example:
body.light-mode {
--color-text: #1a1a1a; /* Main text color */
--color-background: #ffffff; /* Document background color */
--color-border: #e0e0e0; /* Border color for elements */
--color-accent: #0366d6; /* Accent color for links and highlights */
--color-image-background: #ffffff; /* Background color for images */
--title-block-text: #1a1a1a; /* Text color in the title block */
}
body.dark-mode {
--color-text: #ffffff; /* Main text color */
--color-background: #1a1a1a; /* Document background color */
--color-border: #444444; /* Border color for elements */
--color-accent: #58a6ff; /* Accent color for links and highlights */
--color-image-background: #1a1a1a; /* Background color for images */
--title-block-text: #ffffff; /* Text color in the title block */
}
More variables can be found by inspecting the CSS in the browser.
You can include UML diagrams using PlantUML syntax:
```plantuml
@startuml
!theme reddress-darkblue
participant Controller
participant "I2C Bus" as Bus
participant Target
Controller -> Bus : Start Condition
Bus -> Target: Forward Address Frame (7-bit Addr + Read Bit)
Target-> Bus : ACK
Bus -> Controller: ACK
@enduml
```
Produces:
A list of themes can be found here
Code blocks are syntax-highlighted:
```cpp:optional_name.cpp
void app_main(void)
{
printf("typecad-docgen");
}
```
Produces:
void app_main(void) { printf("typecad-docgen"); }
optional_name.cpp
You can change the theme to any listed here: https://shiki.style/themes.
A filename can be given by adding :<filename>
to the end of the language name.
Some text with inline AsciiMath ($a^2 + b^2 = c^2$
)
and inline LaTeX math (\(\sin \theta\)
) is possible.
AsciiMath blocks:
$$
e = sum_(n=0)^oo 1 / n!
$$
And LaTeX blocks:
\[
e = \sum_{n=0}^{\infty} \frac{1}{n!}
\]
- [x] Task 1
- [ ] Task 2
- [ ] Task 3
Note
GitHub Style Alerts/Admonitions
> [!NOTE]
> Highlights information that users should take into account.
> [!TIP]
> Optional information to help a user.
> [!IMPORTANT]
> Crucial information.
> [!WARNING]
> Critical content demanding immediate user attention.
> [!CAUTION]
> Negative potential consequences of an action.
For more information and updates, visit: