Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Fix readthedocs
  • Loading branch information
ghostbuster91 committed Sep 24, 2023
commit 91aa1324d01e4783ef9af85a4c5c249e2c7d40e9
17 changes: 12 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
version: 2

sphinx:
configuration: generated-docs/out/conf.py
configuration: generated-docs/out/conf.py

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: generated-docs/out/requirements.pip
install:
- method: pip
- requirements: generated-docs/out/requirements.txt

build:
os: ubuntu-22.04
tools:
python: "3.7"
nodejs: "18" # not sure if needed but better to fix its version
rust: "1.64" # not sure if needed but better to fix its version
golang: "1.19" # not sure if needed but better to fix its version
10 changes: 6 additions & 4 deletions docs-sources/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# sttp documentation build configuration file, created by
# diffx documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 12 15:51:09 2017.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -42,7 +42,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['myst_parser', 'sphinx_rtd_theme']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -54,8 +54,10 @@
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify

source_parsers = {
'.md': CommonMarkParser,
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}

source_suffix = ['.rst', '.md']
Expand Down
128 changes: 128 additions & 0 deletions docs-sources/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions docs-sources/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
description = "Python shell flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";

mach-nix.url = "github:davhau/mach-nix";
};

outputs = { self, nixpkgs, mach-nix, flake-utils, ... }:
let
pythonVersion = "python37";
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
mach = mach-nix.lib.${system};

pythonEnv = mach.mkPython {
python = pythonVersion;
requirements = builtins.readFile ./requirements.txt;
};
watchDocs =
let
name = "watchDocs";
src = pkgs.writeShellScript name ''
sphinx-autobuild . _build/html
'';
in
pkgs.stdenv.mkDerivation
{
inherit name src;

phases = [ "installPhase" "patchPhase" ];

installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/${name}
chmod +x $out/bin/${name}
'';
};
in
{
devShells.default = pkgs.mkShellNoCC {
packages = [ pythonEnv watchDocs ];

shellHook = ''
export PYTHONPATH="${pythonEnv}/bin/python"
'';
};
}
);
}
4 changes: 0 additions & 4 deletions docs-sources/requirements.pip

This file was deleted.

5 changes: 5 additions & 0 deletions docs-sources/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sphinx_rtd_theme==1.0.0
recommonmark==0.7.1
sphinx==4.2.0
sphinx-autobuild==2021.3.14
myst-parser==0.15.2
2 changes: 0 additions & 2 deletions docs-sources/watch.sh

This file was deleted.

10 changes: 6 additions & 4 deletions generated-docs/out/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# sttp documentation build configuration file, created by
# diffx documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 12 15:51:09 2017.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -42,7 +42,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['myst_parser', 'sphinx_rtd_theme']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -54,8 +54,10 @@
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify

source_parsers = {
'.md': CommonMarkParser,
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}

source_suffix = ['.rst', '.md']
Expand Down
Loading