Skip to content

Commit 35f019e

Browse files
Merge Sphinx into Docusaurus V2 (#206)
* Merge Sphinx into Docusaurus V2 * Add pre-commit fixes * Update docusaurus.config.js * Update docusaurus.config.js Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6e77248 commit 35f019e

File tree

7 files changed

+35
-3
lines changed

7 files changed

+35
-3
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
node-version: 14
3737

3838
- name: Build documentation
39-
run: poetry run make -C docs html
39+
run: ./scripts/build_docs.sh
4040

4141
- name: Build Docusaurus website
4242
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ dist/
2121
*.h5
2222
*.npz
2323
*.pkl
24+
25+
# vscode
26+
.vscode

docs/source/_templates/theme_variables.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{%- set external_urls = {
22
'github': 'https://github.com/Rose-STL-Lab/torchTS',
3-
'home': 'https://github.com/Rose-STL-Lab/torchTS/',
3+
'home': 'https://rose-stl-lab.github.io/torchTS/docs/',
44
'get_started': ' ',
55
'blog': 'https://github.com/Rose-STL-Lab/torchTS',
66
'resources': 'https://github.com/Rose-STL-Lab/torchTS',

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
# documentation.
8989
html_theme_options = {
9090
"pytorch_project": "tutorials",
91-
"canonical_url": "https://github.com/Rose-STL-Lab/torchTS",
91+
"canonical_url": "https://rose-stl-lab.github.io/torchTS/docs/",
9292
"collapse_navigation": False,
9393
"display_version": True,
9494
"logo": "_static/images/torchTS_logo.png",

scripts/build_docs.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# run this script from the project root using `./scripts/build_docs.sh`
3+
4+
echo "-----------------------------------"
5+
echo "Generating API reference via Sphinx"
6+
echo "-----------------------------------"
7+
cd docs || exit
8+
make html
9+
cd .. || exit
10+
11+
12+
# run script to parse html generated by sphinx
13+
echo "--------------------------------------------"
14+
echo "Parsing Sphinx docs and moving to Docusaurus"
15+
echo "--------------------------------------------"
16+
mkdir -p "website/static/api/"
17+
18+
cwd=$(pwd)
19+
SPHINX_HTML_DIR="website/static/api/"
20+
cp -R "${cwd}/docs/build/html/" "${cwd}/${SPHINX_HTML_DIR}"
21+
echo "Parsed Sucessfully"
22+
echo "Moved location: ${SPHINX_HTML_DIR}"

website/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Dependencies
22
/node_modules
3+
yarn.lock
34

45
# Production
56
/build
7+
/static/api
68

79
# Generated files
810
.docusaurus

website/docusaurus.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ module.exports = {
4646
position: "left",
4747
label: "Docs",
4848
},
49+
{
50+
href: "https://rose-stl-lab.github.io/torchTS/api",
51+
label: "API Reference",
52+
position: "left",
53+
},
4954
{
5055
href: "https://github.com/Rose-STL-Lab/torchTS",
5156
label: "GitHub",

0 commit comments

Comments
 (0)