Skip to content

Commit

Permalink
Fix documentation (generation)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielstron committed Sep 8, 2021
1 parent c03c110 commit 24464fb
Show file tree
Hide file tree
Showing 7 changed files with 744 additions and 615 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
docs/html

*~
*.py[co]
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ os: linux

install:
- pip install coverage coveralls
- pip install pdoc3
- pip install -e .

script:
# tests installation and build
- make all
- coverage run --source=demjson3 test/test_demjson3.py
# creates documentation files
- make docs
- make docs_html

after_success:
- coverage report
Expand Down
19 changes: 8 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# See the INSTALL.txt file for specific instructions.

PYTHON=python
PYDOC=pdoc

MODULE=demjson3
VERSION=3.0.0
VERSION=3.0.4

SOURCES = $(MODULE).py
SETUP = setup.py
READMES = README.txt LICENSE.txt docs/CHANGES.txt docs/INSTALL.txt docs/NEWS.txt
TESTS = test/test_$(MODULE).py
#DOCS = docs/$(MODULE).html docs/$(MODULE).txt docs/jsonlint.txt
DOCS = docs/$(MODULE).txt docs/jsonlint.txt docs/$(MODULE).html
DOCS = docs/$(MODULE).txt docs/jsonlint.txt
DOCS_HTML = docs/$(MODULE).html
SCRIPTS = jsonlint
DISTDIR = dist

Expand Down Expand Up @@ -58,20 +59,16 @@ $(DIST_FILE): MANIFEST.in $(ALL_FILES)
$(PYTHON) setup.py sdist -d $(DISTDIR)

docs: $(DOCS) ALWAYS
docs_html: $(DOCS_HTML) ALWAYS

docs/jsonlint.txt: jsonlint $(MODULE).py
PYTHONPATH=. ./jsonlint --help >$@
echo "" >>$@
PYTHONPATH=. ./jsonlint --strict --help-behaviors >>$@

docs/$(MODULE).txt: $(MODULE).py
pydoc $(MODULE) | sed -e 's|/home/[a-zA-Z0-9_/.-]*/$(MODULE)/dev/||' >docs/$(MODULE).txt
python -m pydoc $(MODULE) | sed -e 's|/home/[a-zA-Z0-9_/.-]*/git/demjson/||' >docs/$(MODULE).txt

docs/$(MODULE).html: $(MODULE).py
$(PYTHON) -m pydoc -w $(MODULE)
sed -e 's|file:/home/[a-zA-Z0-9_]+/public_html|http://nielstron.github.io/demjson3|g' \
-e 's|>/home/[a-zA-Z0-9_]+/public_html/python/$(MODULE)/[a-zA-Z0-9.]*/|>|g' \
-e 's|>/home/[a-zA-Z0-9/.-]*/$(MODULE)/dev/|>|g' \
-e 's|file:/[^<>]*/dev/|../|g' \
<$(MODULE).html >docs/index.html
rm -f $(MODULE).html
$(PYDOC) --html $(MODULE) -o docs/html
mv docs/html/$(MODULE).html docs/html/index.html
12 changes: 6 additions & 6 deletions demjson3.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@
"""

__author__ = "Deron Meranda <http://deron.meranda.us/>"
__homepage__ = "http://deron.meranda.us/python/demjson/"
__author__ = "Deron Meranda <http://deron.meranda.us/>, Niels Mündler"
__homepage__ = "http://nielstron.github.io/demjson3/"

__date__ = "2015-12-22"
__version__ = "2.2.4"
__version_info__ = (2, 2, 4) # Will be converted into a namedtuple below
__date__ = "2021-09-08"
__version__ = "3.0.4"
__version_info__ = (3, 0, 4) # Will be converted into a namedtuple below

__credits__ = """Copyright (c) 2006-2015 Deron E. Meranda <http://deron.meranda.us/>
__credits__ = """Copyright (c) 2006-2021 Deron E. Meranda <http://deron.meranda.us/>, Niels Mündler
Licensed under GNU LGPL (GNU Lesser General Public License) version 3.0
or later. See LICENSE.txt included with this software.
Expand Down
Loading

0 comments on commit 24464fb

Please sign in to comment.