Skip to content

Commit

Permalink
Merge pull request #10 from BartvanWoesik/setupmkdocs
Browse files Browse the repository at this point in the history
add workflow
  • Loading branch information
BartvanWoesik authored Mar 7, 2024
2 parents 12a9b92 + 71f2204 commit c9de465
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 14 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update Mkdocs
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
create_mkdocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.11
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install -r requirements_docs.txt
- run: mkdocs gh-deploy --force
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/SwaggerAPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# API description

<swagger-ui src="openapi.json"/>


4 changes: 1 addition & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# API description

<swagger-ui src="openapi.json"/>


--8<-- "README.md"
3 changes: 0 additions & 3 deletions docs/test.md

This file was deleted.

35 changes: 27 additions & 8 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
site_name: Forex Trading
nav:
- Home: home.md
- Home: index.md
- Indicators: indicators.md
- API: index.md
theme: material
- API: SwaggerAPI.md
theme:
name: material
features:
- content.tabs.link
- content.code.copy
- navigation.instant
- navigation.tracking
- navigation.tabs
- navigation.tabs.sticky
- navigation.sections
- navigation.expand

palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode

- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to light mode


plugins:
- search
- swagger-ui-tag
- mkdocstrings:
default_handler: python


hooks:
- deploy\scoring_script.py
118 changes: 118 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"openapi": "3.1.0",
"info": {
"title": "Forex Trading",
"version": ""
},
"paths": {
"/": {
"get": {
"summary": "Landing Page",
"operationId": "landing_page__get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/predict": {
"post": {
"summary": "Predict",
"operationId": "predict_predict_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"title": "Input Data"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
}
},
"servers": [
{
"url": "http://127.0.0.1:500",
"description": "No description."
}
]
}

0 comments on commit c9de465

Please sign in to comment.