Readthedocs.org: Is it possible to get read the docs to run a custom python script as part of the build?

Created on 25 Jun 2016  路  5Comments  路  Source: readthedocs/readthedocs.org

Specifically, I'd like to run a script that:

  • Builds the txt files of my Sphinx project.
  • Processes the these txt files further.
  • Replaces the content in the html/_sources directory with these files.

I have this script in place locally, but don't know if and how I can get it executed by the read the docs sever as part of the build process.

Support

Most helpful comment

Is this possible when using Mkdocs?

All 5 comments

It's a hack but you can add your scripts to the bottom of conf.py. I have some shell scripts that I run by inserting subprocess.call() into conf.py.

Sounds like you want to include your methods as a hook into one of the Sphinx events. Use a setup function in your conf.py to interact with the state around the Sphinx application:

def setup(app):
    ...

Thank you very much @zxiiro , @agjohnson .
In case somebody else will have the same question: here is a link to the section in the Sphinx documentation that lists the core events you can tap into.

@TimKam Thanks for the link. Are you ready to close this issue?

Is this possible when using Mkdocs?

Was this page helpful?
0 / 5 - 0 ratings