Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌿 Fern Docs migration #25

Merged
merged 14 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
@@ -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 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
22 changes: 22 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -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 --log-level debug
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
generated
.mise.toml
**/.DS_Store
57 changes: 57 additions & 0 deletions fern/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# OctoAI Documentation 🐙

This is the source of the OctoAI's public facing documentation found at [octo.ai/docs](https://octo.ai/docs). These docs utilize `.mdx` files with the [Mintlify](https://mintlify.com/) service/framework.

## Run Locally 🏃‍♂️

**NOTE:** `node` is required for local development of these docs, if you do not have `node` on your system refer to the [NodeJS documentation](https://nodejs.org/en/download/package-manager).

Clone the project using

```bash
# via URL
git clone https://github.com/octoml/docs.git

# via SSH
git clone git@github.com:octoml/docs.git
```

Go to the project directory

```bash
cd docs
```

Globally install the Mintlify CLI

```bash
npm i -g mintlify
```

Start the server

```bash
mintlify dev
```

## Development

It is highly recommended to use the [MDX VSCode Extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) if using the VSCode IDE.

The `mint.json` file is the core configuration file where you can specify various settings and properties to customize your documentation. These settings include structure, API configurations, integrations, analytics, redirects, and search engine optimization.

For writing content, the [Mintlify Docs](https://mintlify.com/docs/page) break down the MDX standards required.

There are also Components provided by Mintlify that can be used to add interactivity and styling to the docs. Those can be found [here](https://mintlify.com/docs/content/components/accordions).

### OpenAPI

OpenAPI documentation is autogenerated from the parsed OpenAPI spec. See [Mintlify Docs](https://mintlify.com/docs/api-playground/openapi/setup) for details.

All OpenAPI specs are in the `~/openapi-specs` directory.

The docs generated by the specs are held in the `~/api-reference` directory.

## Deployment 🖥️

Merging to `main` will kick off an automatic deployment to production.
28 changes: 18 additions & 10 deletions fern/apis/asset-library/openapi/openapi-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,36 @@ paths:
get:
x-fern-sdk-method-name: list
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
post:
x-fern-sdk-method-name: create
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
/v1/assets/{asset_id}:
delete:
x-fern-sdk-method-name: delete
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
/v1/assets/{asset_id}/complete-upload:
post:
x-fern-sdk-method-name: completeUpload
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
/v1/assets/{asset_owner_and_name_or_id}:
get:
x-fern-sdk-method-name: get
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
x-fern-bearer:
name: apiKey
env: OCTOAI_API_KEY
27 changes: 17 additions & 10 deletions fern/apis/fine-tuning/openapi/openapi-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ paths:
post:
x-fern-sdk-method-name: create
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
/v1/tune/{tune_id}:
get:
x-fern-sdk-method-name: get
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
delete:
x-fern-sdk-method-name: delete
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
/v1/tune/{tune_id}/cancel:
post:
x-fern-sdk-method-name: cancel
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
/v1/tunes:
get:
x-fern-sdk-method-name: list
servers:
- url: https://api.octoai.cloud
x-name: Default
- url: https://api.octoai.cloud
x-name: Default
components:
schemas:
LoraTune-Input:
Expand All @@ -43,3 +43,10 @@ components:
properties:
details:
x-fern-type-name: TuneDetails
securitySchemes:
BearerAuth:
type: http
scheme: bearer
x-fern-bearer:
name: apiKey
env: OCTOAI_API_KEY
39 changes: 27 additions & 12 deletions fern/apis/image-gen/openapi/openapi-overrides.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
paths:
/generate/ssd:
post:
summary: "Generate SSD"
x-fern-sdk-method-name: generateSsd
servers:
- url: https://image.octoai.cloud
x-name: ImageGen
- url: https://image.octoai.cloud
x-name: ImageGen
/generate/controlnet-sdxl:
post:
summary: "Generate ControlNet SDXL"
x-fern-sdk-method-name: generateControlnetSdxl
servers:
- url: https://image.octoai.cloud
x-name: ImageGen
- url: https://image.octoai.cloud
x-name: ImageGen
/generate/controlnet-sd15:
post:
summary: "Generate ControlNet SD1.5"
x-fern-sdk-method-name: generateControlnetSd15
servers:
- url: https://image.octoai.cloud
x-name: ImageGen
- url: https://image.octoai.cloud
x-name: ImageGen
/generate/sdxl:
post:
summary: "Generate SDXL"
x-fern-sdk-method-name: generateSdxl
servers:
- url: https://image.octoai.cloud
x-name: ImageGen
- url: https://image.octoai.cloud
x-name: ImageGen
/generate/sd:
post:
summary: "Generate SD1.5"
x-fern-sdk-method-name: generateSd
servers:
- url: https://image.octoai.cloud
x-name: ImageGen
- url: https://image.octoai.cloud
x-name: ImageGen
/generate/svd:
post:
summary: "Generate SVD Animations"
x-fern-sdk-method-name: generateSvd
servers:
- url: https://image.octoai.cloud
x-name: ImageGen
- url: https://image.octoai.cloud
x-name: ImageGen
# Hide healthcheck
/healthcheck:
get:
x-fern-ignore: true

components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
x-fern-bearer:
name: apiKey
env: OCTOAI_API_KEY
2 changes: 2 additions & 0 deletions fern/apis/octoai/generators.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
openapi: ./openapi/openapi.json
openapi-overrides: ./openapi/openapi-overrides.yml
Loading
Loading