Skip to content

Commit

Permalink
Get typescript docs working
Browse files Browse the repository at this point in the history
incremental progress on typescript docs

removing explicit typescript declaration

getting typescript docs working

let's see if secret works

update token name

bump version

typedoc install

npm install

specifically typedoc

global install

switching up version again

using 3.11

npm install, broad

modify env var syntax
  • Loading branch information
sydney-runkle committed Apr 26, 2024
1 parent cc3f20f commit f59cd45
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/docs-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ jobs:

- uses: actions/setup-python@v4
with:
# cloudflare build containers use 3.8, hence using it here
python-version: '3.8'
python-version: '3.11'

- name: install
run: |
pip install --upgrade pip
pip install -r requirements/docs.txt
pip install --extra-index-url https://pydantic:${MKDOCS_TOKEN}@pppr.pydantic.dev/simple/ mkdocs-material mkdocstrings-python mkdocstrings-typescript
pip install --extra-index-url https://pydantic:${PPPR_TOKEN}@pppr.pydantic.dev/simple/ mkdocs-material mkdocstrings-python griffe-typedoc mkdocstrings-typescript
npm install
npm install -g typedoc
env:
MKDOCS_TOKEN: ${{ secrets.MKDOCS_TOKEN }}
PPPR_TOKEN: ${{ secrets.PPPR_TOKEN }}

- run: python -c 'import docs.plugins.main'

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ jobs:

- uses: actions/setup-python@v4
with:
# cloudflare build containers use 3.8, hence using it here
python-version: '3.8'
python-version: '3.11'

- name: install
run: |
pip install --upgrade pip
pip install -r requirements/docs.txt
pip install --extra-index-url https://pydantic:${PPPR_TOKEN}@pppr.pydantic.dev/simple/ mkdocs-material mkdocstrings-python griffe-typedoc mkdocstrings-typescript
npm install
npm install -g typedoc
env:
PPPR_TOKEN: ${{ secrets.PPPR_TOKEN }}

- name: build site
run: mkdocs build --strict
Expand Down
3 changes: 3 additions & 0 deletions build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ set -x
python3 -V

python3 -m pip install -r ./requirements/docs.txt
pip install --extra-index-url https://pydantic:$PPPR_TOKEN@pppr.pydantic.dev/simple/ mkdocs-material mkdocstrings-python griffe-typedoc mkdocstrings-typescript
npm install
npm install -g typedoc

python3 -m mkdocs build
3 changes: 3 additions & 0 deletions docs/components.md → docs/api/python_components.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Python Components

::: fastui.components
handler: python
options:
inherited_members: true
docstring_options:
Expand Down
7 changes: 7 additions & 0 deletions docs/api/typescript_components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# TypeScript Components

!!! warning "🚧 Work in Progress"
This page is a work in progress.

::: @pydantic/fastui
handler: typescript
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,6 @@ plugins:
nav:
- Introduction: index.md
- Guide: guide.md
- Components: components.md
- API Documentation:
- Python Components: api/python_components.md
- TypeScript Components: api/typescript_components.md
96 changes: 92 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"typescript": "^5.0.2"
},
"dependencies": {
"prettier": "^3.2.5"
"prettier": "^3.2.5",
"typedoc": "^0.25.13"
}
}
5 changes: 5 additions & 0 deletions src/npm-fastui-bootstrap/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ["../../typedoc.base.json"],
"entryPointStrategy": "expand",
"entryPoints": ["src"]
}
5 changes: 5 additions & 0 deletions src/npm-fastui-prebuilt/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ["../../typedoc.base.json"],
"entryPointStrategy": "expand",
"entryPoints": ["src"]
}
10 changes: 5 additions & 5 deletions src/npm-fastui/src/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export interface PageEvent {
pushPath?: string
context?: ContextType
clear?: boolean
nextEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent
nextEvent?: AnyEvent
type: 'page'
}
export interface ContextType {
Expand All @@ -191,7 +191,7 @@ export interface AuthEvent {
*/
export interface Link {
components: FastProps[]
onClick?: PageEvent | GoToEvent | BackEvent | AuthEvent
onClick?: AnyEvent
mode?: 'navbar' | 'footer' | 'tabs' | 'vertical' | 'pagination'
active?: string | boolean
locked?: boolean
Expand All @@ -212,7 +212,7 @@ export interface LinkList {
*/
export interface Navbar {
title?: string
titleEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent
titleEvent?: AnyEvent
startLinks: Link[]
endLinks: Link[]
className?: ClassName
Expand Down Expand Up @@ -357,7 +357,7 @@ export interface DataModel {
export interface DisplayLookup {
mode?: DisplayMode
title?: string
onClick?: PageEvent | GoToEvent | BackEvent | AuthEvent
onClick?: AnyEvent
field: string
tableWidthPercent?: number
}
Expand All @@ -379,7 +379,7 @@ export interface Pagination {
export interface Display {
mode?: DisplayMode
title?: string
onClick?: PageEvent | GoToEvent | BackEvent | AuthEvent
onClick?: AnyEvent
value: JsonData
type: 'Display'
}
Expand Down
8 changes: 8 additions & 0 deletions src/npm-fastui/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// TODO: we really want the entryPoint to be src, but mkdocstrings-typescript doesn't fully support this option yet,
// as we can't specify the path within the package from which we want to pull docs, so right now
// we resort to more specific entryPoints
{
"extends": ["../../typedoc.base.json"],
"entryPointStrategy": "expand",
"entryPoints": ["src/models.d.ts"]
}
4 changes: 4 additions & 0 deletions typedoc.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://typedoc.org/schema.json",
"includeVersion": true
}
5 changes: 5 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ["./typedoc.base.json"],
"entryPointStrategy": "packages",
"entryPoints": ["./src/*"]
}

0 comments on commit f59cd45

Please sign in to comment.