Skip to content

Commit 5b7f405

Browse files
author
Thierry Chappuis
committed
Added docstrings to the tasks.py functions
1 parent 914468d commit 5b7f405

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tasks.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,47 @@
1414
)
1515

1616
def check_theme_and_plugins(c):
17+
"""Checks if the theme and plugins directories are present and clones them
18+
from Github if necessary.
19+
"""
1720
if not Path('./theme').exists():
1821
c.run(THEME_CMD)
1922
if not Path('./plugins').exists():
2023
c.run(PLUGINS_CMD)
2124

2225
@task
2326
def build(c):
27+
"""Builds the local Pelican blog."""
2428
check_theme_and_plugins(c)
2529
c.run('echo "Publishing your Pelican website"')
2630
c.run(f'pipenv run pelican content -s pelicanconf.py -t {THEME}')
2731

2832
@task
2933
def publish(c):
34+
"""Builds the Pelican blog with deployment settings."""
3035
check_theme_and_plugins(c)
3136
c.run('echo "Building your Pelican website"')
3237
c.run(f'pipenv run pelican content -s publishconf.py -t {THEME}')
3338

3439
@task
3540
def autoreload(c):
41+
"""Starts the autoreload server to help during writing of blog articles."""
3642
c.run('echo "Running autoreload server. Press CTRL+C to stop"')
3743
c.run(f'pipenv run pelican -r content -s pelicanconf.py -t {THEME}')
3844

3945
@task
4046
def runserver(c):
47+
"""Starts the dev server to visualize the articles locally in a web browser
48+
at url http://localhost:8000.
49+
"""
4150
c.run('echo "Running development server. Press CTRL+C to stop"')
4251
c.run(f'pipenv run python -m http.server -d output')
4352

4453
@task
4554
def revert(c):
55+
"""Reverts the repository to the previous commit if not on a Pull Request
56+
on Travis.
57+
"""
4658
if not os.getenv('TRAVIS_PULL_REQUEST'):
4759
c.run('echo "Build errors were encountered. Reverting last commit..."')
4860
c.run('git revert HEAD -n')

0 commit comments

Comments
 (0)