From c8ed06680650ffc9ced02fa539be907c4e345d0d Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Wed, 22 Dec 2021 11:32:53 -0500 Subject: [PATCH] Add documentation site commands to Gulp config --- docs/contributing.md | 16 ++++++++++++++++ gulpfile.js | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/docs/contributing.md b/docs/contributing.md index 2be97b82..54c4e96f 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -155,6 +155,9 @@ management commands. - [`gulp compilemessages`](#compilemessages) - [`gulp coverage`](#coverage) - [`gulp createcachetable`](#createcachetable) +- [`gulp docs:build`](#docsbuild) +- [`gulp docs:deploy`](#docsdeploy) +- [`gulp docs:watch`](#docswatch) - [`gulp extras`](#extras) - [`gulp fake`](#fake) - [`gulp lint`](#lint) @@ -179,6 +182,19 @@ server IP address. See [`gulp runserver`](#runserver) for details. Creates all script, style and "extra" assets and places them in the `babybuddy/static` folder. +#### `docs:build` + +Builds the documentation site in a local directory (`site` by default). + +#### `docs:deploy` + +Deploys the documentation site to GitHub Pages. + +#### `docs:watch` + +Runs a local server for the documentation site reloading whenever documentation +sites files (in the `docs` directory) as modified. + #### `clean` Deletes all build folders and the root `static` folder. Generally this should diff --git a/gulpfile.js b/gulpfile.js index 2c12288d..8f0c548d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -89,6 +89,33 @@ function coverage(cb) { }); } +/** + * Builds the documentation site locally. + * + * @param cb + */ +function docsBuild(cb) { + _runInPipenv(['mkdocs', 'build'], cb); +} + +/** + * Deploys the documentation site to GitHub Pages. + * + * @param cb + */ +function docsDeploy(cb) { + _runInPipenv(['mkdocs', 'gh-deploy'], cb); +} + +/** + * Serves the documentation site, watching for changes. + * + * @param cb + */ +function docsWatch(cb) { + _runInPipenv(['mkdocs', 'serve'], cb); +} + /** * Builds and copies "extra" static files to configured paths. * @@ -322,6 +349,12 @@ gulp.task('clean', clean); gulp.task('coverage', coverage); +gulp.task('docs:build', docsBuild); + +gulp.task('docs:deploy', docsDeploy); + +gulp.task('docs:watch', docsWatch); + gulp.task('extras', extras); gulp.task('lint', lint);