Skip to content

Commit

Permalink
Merge pull request #1 from dtdang/feat/docs_setup
Browse files Browse the repository at this point in the history
feat: docs building
  • Loading branch information
dtdang committed Aug 5, 2024
2 parents 0791c02 + d7d3240 commit 22f29da
Show file tree
Hide file tree
Showing 16 changed files with 305 additions and 74 deletions.
26 changes: 1 addition & 25 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,35 +52,11 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint,test]
pip install .[lint]
- name: Run MyPy
run: mypy .

functional:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest] # eventually add `windows-latest`
python-version: [3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Run Tests
run: pytest -m "not fuzzing" -n 0 -s --cov

# NOTE: uncomment this block after you've marked tests with @pytest.mark.fuzzing
# fuzzing:
# runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ repos:
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies: [types-setuptools, pydantic]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ To get started with working on the codebase, use the following steps prepare you

```bash
# clone the github repo and navigate into the folder
git clone https://github.com/ApeWorX/<REPO_NAME>.git
cd <PROJECT_NAME>
git clone https://github.com/ApeWorX/docs-build.git
cd docs-build

# create and load a virtual environment
python3 -m venv venv
Expand Down
1 change: 0 additions & 1 deletion MODULE_NAME/__init__.py

This file was deleted.

Empty file removed MODULE_NAME/py.typed
Empty file.
51 changes: 39 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,61 @@
# Quick Start

TODO: Description
A script that uses sphinx to develop documentation for ApeWorX plugins.

## Dependencies

- [python3](https://www.python.org/downloads) version 3.9 up to 3.12.

## Installation
## Quick Usage

To use this to build the documentation in an Ape plugin, add this to your documentation workflow (e.g. your `.github/workflows/docs.yaml` file).

### via `pip`
```bash
- name: Clone ApeDocumentationBuilder
run: git clone https://github.com/ApeWorX/ApeDocumentationBuilder.git

You can install the latest release via [`pip`](https://pypi.org/project/pip/):
- name: Set up environment variable
run: echo "GITHUB_REPO=$(echo ${GITHUB_REPOSITORY} | cut -d'/' -f2)" >> $GITHUB_ENV

- name: Build HTML artifact
run: |
cd ApeDocumentationBuilder
python build_docs.py

```

### Running the docs locally

First, clone the repo into your root project directory.

```bash
pip install <PYPI_NAME>
git clone https://github.com/ApeWorX/ApeDocumentationBuilder.git
```

### via `setuptools`
Then, set up the `GITHUB_REPO` environment variable:

You can clone the repository and use [`setuptools`](https://github.com/pypa/setuptools) for the most up-to-date version:
```bash
export GITHUB_REPO=<project-name>
```

Next, run the following in the `ApeDocumentationBuilder` directory:

```bash
git clone https://github.com/ApeWorX/<PYPI_NAME>.git
cd <PYPI_NAME>
python3 setup.py install
cd ApeDocumentationBuilder
python build_docs.py
```

## Quick Usage
For the best viewing experience, use a local server:

```bash
python -m http.server --directory "../docs/_build/" --bind 127.0.0.1 1337
```

TODO: Describe library overview in code
Then, open your browser to `127.0.0.1:1337` and click the `ape` directory link.

```{note}
Serving from `"docs/_build/"` rather than `"docs/_build/<project>"` is necessary to make routing work.
```

## Development

Expand Down
3 changes: 3 additions & 0 deletions _static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
html[data-accent-color='lime'] {
--accent-9: #7efa01;
}
Binary file added _static/favicon.ico
Binary file not shown.
Binary file added _static/logo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions _static/logo_green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 22f29da

Please sign in to comment.