Skip to content

Execute shell scripts before build #6929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
belerico opened this issue Apr 18, 2020 · 3 comments
Closed

Execute shell scripts before build #6929

belerico opened this issue Apr 18, 2020 · 3 comments

Comments

@belerico
Copy link

Details

It would be nice to permit users to run shell scripts before a build, e.g. I need to use sed linux command to substitute a path in a file before the building process, so that a relative image can be properly load

Expected Result

Maybe a new section in the .yml called script or before-script could be added, like the Travis or GitLab ones:

version: 2

before-script:
  - sed -i "s/path/new_path/1" file.md  # or directly call sh substitute.sh

sphinx:
  builder: html
  fail_on_warning: false
  configuration: docs/source/conf.py

formats: all

python:
  version: 3.7
  install:
    - requirements: docs/requirements.txt
    - method: setuptools
      path: .

Actual Result

I think I can come up with a Pythonic solution involving running a function in the sphinx conf.py, but there maybe would be cases in which the python solution could nont be affordable

@Daltz333
Copy link

The above solution could also solve #6919 if implemented

@stsewd
Copy link
Member

stsewd commented Apr 20, 2020

Duplicate of #6662

@stsewd stsewd marked this as a duplicate of #6662 Apr 20, 2020
@stsewd stsewd closed this as completed Apr 20, 2020
@humitos
Copy link
Member

humitos commented Apr 11, 2022

Hi @belerico! You can now achieve your goal by using build.jobs. Read the documentation at https://docs.readthedocs.io/en/stable/config-file/v2.html#build-jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants