Skip to content

Commit

Permalink
convert docs to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
craigahobbs committed Apr 3, 2024
1 parent 7fe874b commit 7156801
Show file tree
Hide file tree
Showing 38 changed files with 182 additions and 258 deletions.
6 changes: 6 additions & 0 deletions template/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ WGET_CMD = if which wget; then wget -q -c $(1); else curl -f -Os $(1); fi
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/Makefile.base))
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/pylintrc))
{% if noapi is not defined or not noapi %}

# Sphinx documentation directory
SPHINX_DOC := doc

# Development dependencies
TESTS_REQUIRE := bare-script myst-parser
{% endif %}

# Include python-build
include Makefile.base


clean:
rm -rf Makefile.base pylintrc{% if noapi is defined and noapi %}

Expand Down
5 changes: 4 additions & 1 deletion template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Coming soon!

## Links

- [Source code](https://github.com/{{github}}/{{package}})
{% if noapi is not defined or not noapi -%}
- [API Documentation](https://{{github}}.github.io/{{package}}/)
{% endif -%}
- [Source code](https://github.com/{{github}}/{{package}})


## Development
Expand Down
40 changes: 0 additions & 40 deletions template/README.rst

This file was deleted.

3 changes: 2 additions & 1 deletion template/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
'sphinx.ext.autosectionlabel',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.githubpages'
'sphinx.ext.githubpages',
'myst_parser'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
9 changes: 9 additions & 0 deletions template/doc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
~~~ {include} ../README.md
~~~

~~~ {toctree}
:maxdepth: 2
:hidden:
reference
~~~
13 changes: 0 additions & 13 deletions template/doc/index.rst

This file was deleted.

8 changes: 4 additions & 4 deletions template/doc/reference.rst → template/doc/reference.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Reference
=========
# Reference


sum_numbers
-----------
## sum_numbers

~~~ {eval-rst}
.. autofunction:: {{ package | replace('-', '_') }}.sum_numbers
~~~
2 changes: 0 additions & 2 deletions template/python-template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@

{# Delete the package API, if requested #}
{% if noapi is defined and noapi %}
{% template_specialize_rename 'README.rst' %}
{% template_specialize_rename 'doc' %}
{% template_specialize_rename 'src/package-name/package_name.py' %}
{% template_specialize_rename 'src/tests/test_package_name.py' %}
{% else %}
{% template_specialize_rename 'README.md' %}
{% template_specialize_rename 'src/package-name/package_name.py', package.replace('-', '_') + '.py' %}
{% template_specialize_rename 'src/tests/test_package_name.py', 'test_' + package.replace('-', '_') + '.py' %}
{% endif %}
Expand Down
5 changes: 0 additions & 5 deletions template/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ author = {{name}}
author_email = {{email}}
license = MIT
description = {{package}}
{% if noapi is defined and noapi -%}
long_description = file:README.md
long_description_content_type = text/markdown
{% else -%}
long_description = file:README.rst
long_description_content_type = text/x-rst
{% endif -%}
keywords = {{package}}
classifiers =
Development Status :: 5 - Production/Stable
Expand Down
6 changes: 6 additions & 0 deletions test-expected/noapi-0-nomain-0/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ WGET_CMD = if which wget; then wget -q -c $(1); else curl -f -Os $(1); fi
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/Makefile.base))
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/pylintrc))


# Sphinx documentation directory
SPHINX_DOC := doc

# Development dependencies
TESTS_REQUIRE := bare-script myst-parser


# Include python-build
include Makefile.base


clean:
rm -rf Makefile.base pylintrc
24 changes: 24 additions & 0 deletions test-expected/noapi-0-nomain-0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# my-package

[![PyPI - Status](https://img.shields.io/pypi/status/my-package)](https://pypi.org/project/my-package/)
[![PyPI](https://img.shields.io/pypi/v/my-package)](https://pypi.org/project/my-package/)
[![GitHub](https://img.shields.io/github/license/johndoe/my-package)](https://github.com/johndoe/my-package/blob/main/LICENSE)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/my-package)](https://pypi.org/project/my-package/)

Coming soon!


## Links

- [API Documentation](https://johndoe.github.io/my-package/)
- [Source code](https://github.com/johndoe/my-package)


## Development

This package is developed using [python-build](https://github.com/craigahobbs/python-build#readme).
It was started using [python-template](https://github.com/craigahobbs/python-template#readme) as follows:

~~~
template-specialize python-template/template/ my-package/ -k package my-package -k name 'John Doe' -k email '[email protected]' -k github 'johndoe'
~~~
40 changes: 0 additions & 40 deletions test-expected/noapi-0-nomain-0/README.rst

This file was deleted.

3 changes: 2 additions & 1 deletion test-expected/noapi-0-nomain-0/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
'sphinx.ext.autosectionlabel',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.githubpages'
'sphinx.ext.githubpages',
'myst_parser'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
9 changes: 9 additions & 0 deletions test-expected/noapi-0-nomain-0/doc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
~~~ {include} ../README.md
~~~

~~~ {toctree}
:maxdepth: 2
:hidden:
reference
~~~
13 changes: 0 additions & 13 deletions test-expected/noapi-0-nomain-0/doc/index.rst

This file was deleted.

8 changes: 8 additions & 0 deletions test-expected/noapi-0-nomain-0/doc/reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Reference


## sum_numbers

~~~ {eval-rst}
.. autofunction:: my_package.sum_numbers
~~~
8 changes: 0 additions & 8 deletions test-expected/noapi-0-nomain-0/doc/reference.rst

This file was deleted.

4 changes: 2 additions & 2 deletions test-expected/noapi-0-nomain-0/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ author = John Doe
author_email = [email protected]
license = MIT
description = my-package
long_description = file:README.rst
long_description_content_type = text/x-rst
long_description = file:README.md
long_description_content_type = text/markdown
keywords = my-package
classifiers =
Development Status :: 5 - Production/Stable
Expand Down
2 changes: 2 additions & 0 deletions test-expected/noapi-nomain/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ WGET_CMD = if which wget; then wget -q -c $(1); else curl -f -Os $(1); fi
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/Makefile.base))
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/pylintrc))


# Include python-build
include Makefile.base


clean:
rm -rf Makefile.base pylintrc

Expand Down
2 changes: 2 additions & 0 deletions test-expected/noapi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ WGET_CMD = if which wget; then wget -q -c $(1); else curl -f -Os $(1); fi
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/Makefile.base))
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/pylintrc))


# Include python-build
include Makefile.base


clean:
rm -rf Makefile.base pylintrc

Expand Down
6 changes: 6 additions & 0 deletions test-expected/nomain/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ WGET_CMD = if which wget; then wget -q -c $(1); else curl -f -Os $(1); fi
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/Makefile.base))
$(eval $(call WGET, https://raw.githubusercontent.com/craigahobbs/python-build/main/pylintrc))


# Sphinx documentation directory
SPHINX_DOC := doc

# Development dependencies
TESTS_REQUIRE := bare-script myst-parser


# Include python-build
include Makefile.base


clean:
rm -rf Makefile.base pylintrc
24 changes: 24 additions & 0 deletions test-expected/nomain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# my-package

[![PyPI - Status](https://img.shields.io/pypi/status/my-package)](https://pypi.org/project/my-package/)
[![PyPI](https://img.shields.io/pypi/v/my-package)](https://pypi.org/project/my-package/)
[![GitHub](https://img.shields.io/github/license/johndoe/my-package)](https://github.com/johndoe/my-package/blob/main/LICENSE)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/my-package)](https://pypi.org/project/my-package/)

Coming soon!


## Links

- [API Documentation](https://johndoe.github.io/my-package/)
- [Source code](https://github.com/johndoe/my-package)


## Development

This package is developed using [python-build](https://github.com/craigahobbs/python-build#readme).
It was started using [python-template](https://github.com/craigahobbs/python-template#readme) as follows:

~~~
template-specialize python-template/template/ my-package/ -k package my-package -k name 'John Doe' -k email '[email protected]' -k github 'johndoe' -k nomain 1
~~~
Loading

0 comments on commit 7156801

Please sign in to comment.