in the hunt for a computable blog, i've wanted to be able to reuse the code i write about in posts.
one integration we are beginning to experiment with in this post is access to doit task specifications
from posts. the tonyfast.dodo module integrates posts with tasks.
# `doit` integration - a `mkdocs` example
in the hunt for a computable blog, i've wanted to be able to reuse the code i write about in posts.
one integration we are beginning to experiment with in this post is access to `doit` task specifications
from posts. the `tonyfast.dodo` module integrates posts with tasks.
`doit` is a great tool for orchestrating commands that operate on files.
to demonstrate the integration we'll compose a task to build a `mkdocs` site,
and deal with some pain points in the configuration.
## the `mkdocs` task`mkdocs` integrations are identified when a project has the `mkdocs.yml` file.
this file contains all the information for your site including the documents to build.
for blog style content, adding a new post means updating the configuration file.
my adhd brain has a tendency to forget the configuration bit.
in this file, we wrote tools to infer the files that should be included in the configuration,
we sort them, and place them back in the configuration file.
what follow is the incovation for `mkdocs` for the `tonyfast` site.
in this document we:
*define functions to find posts
*define a `doit` task to execute `mkdocs`> there is a `mkdocs-material` blog feature avaiable to insiders. when this is generally available a lot of this content will be moot.
in the hunt for a computable blog, i've wanted to be able to reuse the code i write about in posts.
one integration we are beginning to experiment with in this post is access to
doit
task specifications
from posts. the
tonyfast.dodo
module integrates posts with tasks.
doit
is a great tool for orchestrating commands that operate on files.
to demonstrate the integration we'll compose a task to build a
mkdocs
site,
and deal with some pain points in the configuration.
mkdocs
integrations are identified when a project has the
mkdocs.yml
file.
this file contains all the information for your site including the documents to build.
for blog style content, adding a new post means updating the configuration file.
my adhd brain has a tendency to forget the configuration bit.
in this file, we wrote tools to infer the files that should be included in the configuration,
we sort them, and place them back in the configuration file.
what follow is the incovation for
mkdocs
for the
tonyfast
site.
in this document we:
define functions to find posts
define a
doit
task to execute
mkdocs
there is a
mkdocs-material
blog feature avaiable to insiders. when this is generally available a lot of this content will be moot.
## the `mkdocs` `doit` task
primarily `doit` tasks are functions that begin with the prefix `task_`;
`task_mkdocs` is the one task we define in this document.
we don't use `yaml` cause our `mkdocs` uses `yaml` tags.
instead we put the nav at the end of the document
then replace the default with the updated version.
3
we don't use
yaml
cause our
mkdocs
uses
yaml
tags.
instead we put the nav at the end of the document
then replace the default with the updated version.
## invocation*the task is exposed in the `tonyfast` module
python -m tonyfast tasks mkdocs
*this command is invoked with `hatch` in a virtual environment using:
hatch run docs:build
*use with `importnb -t`