From 52dd18513bbab7f0fbfcb2938c9644d9092247cf Mon Sep 17 00:00:00 2001 From: lyz-code Date: Sat, 26 Dec 2020 04:18:09 +0000 Subject: [PATCH] docs: rewrite the conditional files / directories example description. (#1437) * docs: rewrite the conditional files / directories example description. The example didn't match the description structure of the previous example and it mentioned the pre_gen_project, when it should be post_gen_project hook. * docs: improve hooks example phrasing --- docs/advanced/hooks.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/advanced/hooks.rst b/docs/advanced/hooks.rst index 25729dd2a..c659fd407 100644 --- a/docs/advanced/hooks.rst +++ b/docs/advanced/hooks.rst @@ -67,8 +67,9 @@ value of the ``cookiecutter.module_name`` template variable: Example: Validating template variables -------------------------------------- -Here is an example of a script that validates a template variable -before generating the project, to be used as ``hooks/pre_gen_project.py``: +Here is an example of a pre-generate hook script, defined at +``hooks/pre_gen_project.py``, that validates a template variable before generating the +project: .. code-block:: python @@ -88,9 +89,10 @@ before generating the project, to be used as ``hooks/pre_gen_project.py``: Example: Conditional files / directories ---------------------------------------- -This is another example of ``hooks/pre_gen_project.py`` to demonstrate -how to use post-processing hooks to achieve conditional control of files, -directories. + +Here is an example of a post-generate hook script, defined at +``hooks/post_gen_project.py``, on how to achieve conditional control of files and +directories after generating the project. The script ensures that the directory structure is as expected by removing unwanted files and directories: