Skip to content

Commit

Permalink
Merge pull request #9 from aboutcircles/20240607-readthedocs
Browse files Browse the repository at this point in the history
(docs): blind attempt at readthedocs for solidity
  • Loading branch information
benjaminbollen committed Jun 7, 2024
2 parents e8e0ff6 + 7ef8dcc commit af7ff96
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
nodejs: "19"
rust: "1.64"
apt_packages:
- solc


# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Declare the Python requirements required to build your documentation
python:
install:
- requirements: docs/requirements.txt

# Additional commands to set up the environment for Foundry
commands:
- curl -L https://foundry.paradigm.xyz | bash # Install Foundry
- foundryup # Update Foundry
- forge install # Install dependencies for Foundry project
- ./generate_solidity_docs.sh # Generate Solidity documentation
- sphinx-build -b html docs/source docs/build/html # Build Sphinx documentation
7 changes: 7 additions & 0 deletions docs/generate_solidity_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Run solidity-docgen
npx solidity-docgen --output docs/source/solidity --solc-module solc

# Ensure the output directory exists
mkdir -p docs/source/solidity
5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Defining the exact version will make sure things don't break
sphinx==5.3.0
sphinx_rtd_theme==1.1.1
sphinx-autobuild==2024.4.16
readthedocs-sphinx-search==0.1.1
27 changes: 27 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# conf.py

import os
import sys
sys.path.insert(0, os.path.abspath('.'))

# Project information
project = 'Circles'
author = 'AboutCircles'
release = '0.3.4'

# General configuration
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
]

templates_path = ['_templates']
exclude_patterns = []

# Options for HTML output
html_theme = 'alabaster'
html_static_path = ['_static']

# Add Solidity docgen output path
solidity_docgen_output = os.path.abspath('solidity')
15 changes: 15 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Welcome to Circles documentation!
=================================================

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

solidity/index

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit af7ff96

Please sign in to comment.