Skip to content

Commit

Permalink
Add basic website structure
Browse files Browse the repository at this point in the history
  • Loading branch information
adamltyson committed Oct 16, 2024
1 parent 10f0fa3 commit d755f00
Show file tree
Hide file tree
Showing 56 changed files with 4,813 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docs_build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build Sphinx docs and deploy to GitHub Pages

# Generate the documentation on all merges to main, all pull requests, or by
# manual workflow dispatch. The build job can be used as a CI check that the
# docs still build successfully. The deploy job only runs when a tag is
# pushed and actually moves the generated html to the gh-pages branch
# (which triggers a GitHub pages deployment).
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:


jobs:
linting:
# scheduled workflows should not run on forks
if: (${{ github.event_name == 'schedule' }} && ${{ github.repository_owner == 'SainsburyWellcomeCentre' }} && ${{ github.ref == 'refs/heads/main' }}) || (${{ github.event_name != 'schedule' }})
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/lint@v2

build_sphinx_docs:
name: Build Sphinx Docs
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/build_sphinx_docs@v2

deploy_sphinx_docs:
name: Deploy Sphinx Docs
needs: build_sphinx_docs
permissions:
contents: write
if: github.event_name == 'push' && github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/deploy_sphinx_docs@v2
with:
secret_input: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ recursive-include images *
recursive-include documents *.cff
recursive-include documents *.md
recursive-include neuralplayground *.md

recursive-exclude docs *
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
4 changes: 4 additions & 0 deletions docs/build/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 7f2ed55be309b7e2b881405b6b347d16
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added docs/build/.doctrees/environment.pickle
Binary file not shown.
Binary file added docs/build/.doctrees/getting_started.doctree
Binary file not shown.
Binary file added docs/build/.doctrees/index.doctree
Binary file not shown.
Empty file added docs/build/.nojekyll
Empty file.
11 changes: 11 additions & 0 deletions docs/build/_sources/getting_started.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Getting started

Here you may demonstrate the basic functionalities your package.

You can include code snippets using the usual Markdown syntax:

```python
from my_package import my_function

result = my_function()
```
46 changes: 46 additions & 0 deletions docs/build/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. NeuralPlayground documentation master file, created by
sphinx-quickstart on Fri Dec 9 14:12:42 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to NeuralPlayground's documentation!
=========================================================

.. toctree::
:maxdepth: 2
:caption: Contents:

getting_started
api_index

By default the documentation includes the following sections:

* Getting started. Here you could describe the basic functionalities of your package. To modify this page, edit the file ``docs/source/getting_started.md``.
* API: here you can find the auto-generated documentation of your package, which is based on the docstrings in your code. To modify which modules/classes/functions are included in the API documentation, edit the file ``docs/source/api_index.rst``.

You can create additional sections with narrative documentation,
by adding new ``.md`` or ``.rst`` files to the ``docs/source`` folder.
These files should start with a level-1 (H1) header,
which will be used as the section title. Sub-sections can be created
with lower-level headers (H2, H3, etc.) within the same file.

To include a section in the rendered documentation,
add it to the ``toctree`` directive in this (``docs/source/index.rst``) file.

For example, you could create a ``docs/source/installation.md`` file
and add it to the ``toctree`` like this:

.. code-block:: rst
.. toctree::
:maxdepth: 2
:caption: Contents:
getting_started
installation
api_index
Index & Search
--------------
* :ref:`genindex`
* :ref:`search`
Loading

0 comments on commit d755f00

Please sign in to comment.