diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000000..0e828018a1 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,5 @@ +version: 2 +mkdocs: + configuration: mkdocs.yml +conda: + environment: docs/conda.yml diff --git a/.travis.yml b/.travis.yml index 6954dea7a8..90fe7afccb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,9 @@ jobs: - npm run build - npm run test:unit - npm run report-coverage - - npm run docs:docco - - npm run docs:api + - pyenv global 3.8 + - pip3 install -r docs/requirements.txt + - mkdocs build deploy: - provider: pages skip_cleanup: true diff --git a/docs/conda.yml b/docs/conda.yml new file mode 100644 index 0000000000..8570df48ce --- /dev/null +++ b/docs/conda.yml @@ -0,0 +1,6 @@ +dependencies: + - python>=3.8 + - nodejs=10.* + - pip + - pip: + - -r file:requirements.txt diff --git a/docs/hooks.py b/docs/hooks.py new file mode 100644 index 0000000000..c56f6ea45a --- /dev/null +++ b/docs/hooks.py @@ -0,0 +1,8 @@ +import os.path +import subprocess + +def pre_build(**kwargs): + if not os.path.exists('node_modules'): + subprocess.run(['npm', 'install', '--ignore-scripts'], check=True) + subprocess.run(['npm', 'run', 'docs:docco'], check=True) + subprocess.run(['npm', 'run', 'docs:api'], check=True) diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000000..3f2798fec4 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +mkdocs==1.1.2 +mkdocs-simple-hooks==0.1.2 diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000000..8a517a7803 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,7 @@ +site_name: Aeternity JavaScript SDK +plugins: + - search + - mkdocs-simple-hooks: + hooks: + on_pre_build: "docs.hooks:pre_build" +repo_url: 'https://github.com/aeternity/aepp-sdk-js'