Skip to content

Commit

Permalink
Updated doc generator [using pdoc]
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkdrag committed Mar 14, 2024
1 parent 929360b commit 08701cd
Show file tree
Hide file tree
Showing 14 changed files with 210 additions and 515 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ on:

jobs:
build:

runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -43,9 +42,6 @@ jobs:
- name: Check code style
run: |
make check-style
# - name: Check static analysis
# run: |
# make check-static-analysis
- name: Install package
run: |
pip install .
Expand All @@ -58,19 +54,36 @@ jobs:
- name: Generate docs
run: |
make docs
- name: Generate docs
run: |
make docs
- name: Generate package
if: github.event_name == 'release'
run: |
make dist
- name: Upload docs
uses: actions/upload-pages-artifact@v3
with:
name: docs
path: docs
- name: Upload distribution package
if: github.event_name == 'release'
uses: actions/upload-artifact@master
with:
name: dist
path: dist

deploy-docs:
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

pypi-publish:
runs-on: ubuntu-latest
needs: build
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ instance/
# Scrapy stuff:
.scrapy

# Sphinx documentation
# documentation
docs/_build/
docs/build/
docs/source/api/
Expand Down Expand Up @@ -113,3 +113,6 @@ data/
pretrained/
resources/
temp/

# pdoc documentation
docs/ocrtoolkit
19 changes: 6 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,16 @@ check-lint:
check-static-analysis: check-lint check-types


# help: docs - generate project documentation
# help: docs - generate project documentation using pdoc
.PHONY: docs
docs: coverage
@cd docs; rm -rf source/api/ocrtoolkit*.rst source/api/modules.rst build/*
@cd docs; make html
docs:
@pdoc --html --force -o docs ocrtoolkit


# help: check-docs - quick check docs consistency
.PHONY: check-docs
check-docs:
@cd docs; make dummy


# help: serve-docs - serve project html documentation
# help: serve-docs - serve project html documentation using pdoc
.PHONY: serve-docs
serve-docs:
@cd docs/build; python -m http.server --bind 127.0.0.1
serve-docs:
@pdoc --http : ocrtoolkit


# help: dist - create a wheel distribution package
Expand Down
18 changes: 0 additions & 18 deletions docs/Makefile

This file was deleted.

8 changes: 8 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>

<head>
<link rel="preload prerender" as="document" href="./ocrtoolkit/">
</head>

</html>
Empty file removed docs/source/_static/.gitignore
Empty file.
135 changes: 0 additions & 135 deletions docs/source/conf.py

This file was deleted.

Loading

0 comments on commit 08701cd

Please sign in to comment.