Hooks

Sample

To re-build Sphinx documentation just before committing your code:

  • Create a script to rebuild the documentation e.g:

    #!/bin/bash
    source ~/repo/env/env-sphinx/bin/activate
    cd $HOME/etc/my-memory/
    make html
    
  • Make the script executable:

    chmod +x ~/bin/sphinxify_docs.sh
    
  • Edit ./.hg/hgrc and add a path to your script:

    [hooks]
    precommit.sphinxify = ~/bin/sphinxify_docs.sh
    
  • The script should run just before your changes are committed.