diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml new file mode 100644 index 0000000..4b9c83b --- /dev/null +++ b/.github/workflows/preview-docs.yml @@ -0,0 +1,30 @@ +name: Preview Docs + +on: pull_request + +jobs: + run: + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Fern + run: npm install -g fern-api + + - name: Generate preview URL + id: generate-docs + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + OUTPUT=$(fern generate --docs --preview --log-level debug 2>&1) || true + echo "$OUTPUT" + URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()') + echo "Preview URL: $URL" + echo "🌿 Preview your docs: $URL" > preview_url.txt + + - name: Comment URL in PR + uses: thollander/actions-comment-pull-request@v2.4.3 + with: + filePath: preview_url.txt \ No newline at end of file diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000..3401b4d --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,22 @@ +name: Publish Docs + +on: + push: + branches: + - main + +jobs: + run: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/heads/main') && github.run_number > 1 }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Fern + run: npm install -g fern-api + + - name: Publish Docs + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: fern generate --docs \ No newline at end of file diff --git a/README.md b/README.md index 65d5416..6b038fd 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,27 @@ This will generate the SDK and download it to a local folder that can be pip ins ```sh pip install -e /fern/.preview/fern-python-sdk ``` + +## How to update documentation? + +### Local Development server + +To run a local development server with hot-reloading you can run the following command + +```sh +fern docs dev +``` + +#### Hosted URL + +To update your documentation on a hosted URL, run +``` +# npm install -g fern-api +fern generate --docs +``` +To preview your documentation, run +``` +# npm install -g fern-api +fern generate --docs --preview +``` +The repository contains GitHub workflows that will automatically run these commands for you. For example, when you make a PR a preview link will be auto-generated and when you merge to main the docs site will update. \ No newline at end of file diff --git a/fern/docs.yml b/fern/docs.yml index e275b07..c21ab64 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -15,9 +15,15 @@ colors: background: dark: '#000000' light: '#FFFFFF' + header-background: + dark: '#000000' + light: '#FFFFFF' experimental: mdx-components: - snippets +landing-page: + page: Welcome + path: welcome.mdx css: assets/styles.css navbar-links: - type: minimal @@ -40,23 +46,30 @@ navbar-links: rightIcon: fa-solid fa-chevron-right href: https://example.com/login rounded: true +footer-links: + github: https://github.com/vapiai + twitter: https://twitter.com/vapi_ai + discord: https://discord.gg/pUFNcf2WmH + website: https://vapi.ai/ + linkedin: https://www.linkedin.com/company/vapi-ai tabs: api-reference: slug: api-reference + icon: terminal display-name: API Reference documentation: display-name: Documentation + icon: book slug: documentation layout: tabs-placement: header searchbar-placement: header + header-height: 80px navigation: - tab: documentation layout: - - section: '' - contents: - - page: Introduction - path: introduction.mdx + - page: Introduction + path: introduction.mdx - section: General contents: - section: How Vapi Works @@ -89,8 +102,8 @@ navigation: path: changelog.mdx - page: Support path: support.mdx - - page: Status - path: status.mdx + - link: Status + href: https://status.vapi.ai/ - section: Quickstart contents: - page: Dashboard @@ -305,12 +318,12 @@ navigation: contents: - page: HIPAA Compliance path: security-and-privacy/hipaa.mdx - - page: SOC-2 Compliance - path: security-and-privacy/soc.mdx - - page: Privacy Policy - path: security-and-privacy/privacy-policy.mdx - - page: Terms of Service - path: security-and-privacy/tos.mdx + - link: SOC-2 Compliance + href: https://security.vapi.ai/ + - link: Privacy Policy + href: https://vapi.ai/privacy + - link: Terms of Service + href: https://vapi.ai/terms-of-service - tab: api-reference layout: - api: API Reference @@ -325,8 +338,8 @@ navigation: paginated: true - section: '' contents: - - page: Swagger - path: api-reference/swagger.mdx - - page: OpenAPI - path: api-reference/openapi.mdx + - link: Swagger + href: https://api.vapi.ai/api + - link: OpenAPI + href: https://api.vapi.ai/api-json \ No newline at end of file diff --git a/fern/welcome.mdx b/fern/welcome.mdx new file mode 100644 index 0000000..eb0f367 --- /dev/null +++ b/fern/welcome.mdx @@ -0,0 +1,25 @@ +--- +title: Welcome to Vapi's Developer Documentation +layout: overview +--- + +Everything you need to build, test, & deploy voice AI agents in minutes rather than months + + + + Get started now with the Vapi web dashboard. + + + Reference our documentation for how to use Vapi's Voice AI platform. + + + Connect with our team & other developers using Vapi. + + + Check out our GitHub to see what the Vapi team has been up to. + + \ No newline at end of file