Skip to content

Added a way to hook into the serve process. #2620

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AdrienDerobert
Copy link

@AdrienDerobert AdrienDerobert commented Mar 26, 2025

Closes #2573
Added a way to hook into the serve process after the build.

mdbook serve -c <post build command>
# or
mdbook serve --post-build <post build command>

Tested on:

  • Linux
  • Windows
  • MacOs

Added a way to hook into the serve process after the build.
```
mdbook serve -c <post build command>
```
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Mar 26, 2025
@szabgab
Copy link
Contributor

szabgab commented Mar 26, 2025

Thanks for the PR.

I also think we need a way to do this, but I thought it should be part of the configuration in the book.toml as it is more permanent. In which case would you prefer it to be a command-line flag?

In any case it would be better if there was a test that runs in the CI to check this feature.

@AdrienDerobert
Copy link
Author

I can add a configuration option for it in book.toml if you prefer. I was thinking on the easiest and quickest way to develop the feature and the cli flag for serve seemed the simplest to go. As for build you could easily run the build and your command/script right after. But if you prefer i can work a bit more on it to make it part of the configuration and add a test to the ci.

Just to make sure if it is in the book.toml it should also run in build.
Am i right ?

@AdrienDerobert
Copy link
Author

Another problem with including this in the book toml config is that the command might be different for a windows user and a user of a posix system. Do I introduce a section per platform to define the command ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: waiting on a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to ignore the source link file present in the SUMMARY.md while including the link.
3 participants