Skip to content
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

Allow for generic build command (for use with jupyter-book) #99

Open
amichuda opened this issue Nov 5, 2020 · 4 comments
Open

Allow for generic build command (for use with jupyter-book) #99

amichuda opened this issue Nov 5, 2020 · 4 comments

Comments

@amichuda
Copy link

amichuda commented Nov 5, 2020

I wanted to see if it was possible to use sphinx-autobuild with building with jupyter-book. As of now it seems that this is possible as the get_builder function runs sphinx explicitly. Would it be possible to have the server watch a sourcedir and outdir but for a generic command (such as jb build)?

@welcome
Copy link

welcome bot commented Nov 5, 2020

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@pradyunsg
Copy link
Collaborator

pradyunsg commented Nov 5, 2020

You can add --pre-build "jb build" today, to run that build and pass additional --watch options as well.

As it stands, this is a really thin wrapper over livereload (the Python package). It might make sense for jupyter-book to get a serve command that uses that directly. FWIW, it's even pretty straightforward to write a script that does the right thing, using only livereload.

import subprocess
import livereload

def run():
    subprocess.run(["jupyter-book", "build"])

server = livereload.Server()
server.watch('docs/source', run)

server.serve(root='docs/build/html')

@ashwin153
Copy link

ashwin153 commented Jun 15, 2021

I want to use sphinx-autorebuild with sphinx-multiversion, which itself wraps the sphinx-build command to build versioned documentation. Would it be possible to parameterize the currently hard-coded sphinx-build invocation via a command line option (e.g., --build-cmd)?

@chrisjsewell
Copy link
Member

Heya, as I note in executablebooks/jupyter-book#1455:

jupyter-book now has the ability for external packages to "inject" commands in to its CLI, this is for example how jupyter-book toc works (executablebooks/sphinx-external-toc@ec4a439/setup.cfg#L43-L44). By the same mechanism, sphinx-autobuild could inject a jupyter-book serve command, that is customized for jupyter-book

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

No branches or pull requests

4 participants