Skip to content

Commit

Permalink
✨ feat(docs): Add dynamically generated API section
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception committed Jan 8, 2024
1 parent 731b11b commit 5f5a60d
Show file tree
Hide file tree
Showing 13 changed files with 832 additions and 23 deletions.
21 changes: 7 additions & 14 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { createRequire } from 'module'
import { defineConfig } from 'vitepress'
import TypedocSidebar from '../api/typedoc-sidebar.json'

// TODO: Can we somehow change this to `import`?
const require = createRequire(import.meta.url)
const pkg = require('../../release/package.json')
const pkg = await import("../node_modules/@synthetixio/synpress/package.json")

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand All @@ -14,7 +12,7 @@ export default defineConfig({
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Docs', link: '/docs' },
{ text: 'API', link: '/markdown-examples' },
{ text: 'API', link: '/api/' },
{ text: 'Examples', link: 'https://github.com/Synthetixio/synpress/tree/new-dawn/examples' },
{
text: pkg.version,
Expand All @@ -28,15 +26,10 @@ export default defineConfig({
}
],

sidebar: [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
}
],
sidebar: {
'/docs/': { base: '/docs/', items: [] },
'/api/': TypedocSidebar
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/Synthetixio/synpress/tree/new-dawn' },
Expand Down
1 change: 1 addition & 0 deletions docs/api/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
Loading

0 comments on commit 5f5a60d

Please sign in to comment.