Skip to content

Commit

Permalink
Document the use of relative outdir paths.
Browse files Browse the repository at this point in the history
Fixes #37
  • Loading branch information
mblayman committed Sep 20, 2015
1 parent 04a8a59 commit 4eec80d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,23 @@ configuration file option.
``site`` section
----------------

The ``outdir`` option will determine the output directory. If a tilde character
(``~``) is supplied, it will be expanded to the user's home directory.
The ``outdir`` option will determine the output directory.

The ``outdir`` permits relative paths.
One useful pattern with relative paths
is to set ``outdir = ..`` as the value.
Source and output can exist
in a single repository or directory.
Putting the output at the root of a repository
makes it easy to deploy the entire project as a website.
When generating output
or watching the source directory,
handroll is aware of the source and
allows the two directories to coexist
without interference.

If a tilde character (``~``) is supplied,
it will be expanded to the user's home directory.

The ``with_blog`` option set to ``true``, ``on``, ``yes``, or ``1`` will
enable the blog extension.
Expand Down
1 change: 1 addition & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Version 2.1, In Development
* Relax the frontmatter requirement and don't force the
inclusion of the YAML directive (e.g., ``%YAML 1.1``).
* Support Python 3.5.
* An output directory can be a relative path.

Version 2.0, Released July 25, 2015
-----------------------------------
Expand Down
10 changes: 10 additions & 0 deletions handroll/tests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,13 @@ def test_loads_domain_from_site(self):
config = configuration.build_config(f.name, args)

self.assertEqual('a_fake_domain', config.domain)

def test_converts_relative_paths(self):
conf_file = inspect.cleandoc(
"""[site]
outdir = ..""")
with tempfile.NamedTemporaryFile(delete=False) as f:
f.write(conf_file.encode('utf-8'))
config = configuration.Configuration()
config.load_from_file(f.name)
self.assertEqual(os.path.abspath('..'), config.outdir)

0 comments on commit 4eec80d

Please sign in to comment.