swyddfa / esbonio

A language server for working with Sphinx projects.
https://docs.esbon.io/
122 stars 21 forks source link

Add "build all" command to VSCode extension #445

Open ghost opened 1 year ago

ghost commented 1 year ago

A would like to see a "build all" command in the VSCode extension.

This is really helpfull when editing a toctree directive. The toctree isn't automatically updated on other pages, only when saving them again. So each and every page must be saved to inherit the updated toctree.

davbeek commented 1 year ago

I don't know if I am missing something, but I have pinned the command to restart the language server, so it is only a click away. I use it often. I have a large website to build, but rebuild all by restarting the language server is really fast and waiting is zero issue for me.

ghost commented 1 year ago

Maybe I'm missing something too, but in my case, the table of contents in the sidebar isn't updated, even when I restart the language server. I'm using the sphinx-book-theme.

alcarney commented 1 year ago

the table of contents in the sidebar isn't updated, even when I restart the language server

Sounds like Sphinx's caching is getting in the way.

Currently there is an esbonio.sphinx.forceFullBuild option you can try that should force Sphinx to build everything when the server restarts.

But a command that only triggers a full build sounds like a good idea :)

ghost commented 1 year ago

Currently there is an esbonio.sphinx.forceFullBuild option you can try that should force Sphinx to build everything when the server restarts.

Thanks for pointing out the option, I must have overlooked it. Restarting the language server now updates the sidebar TOC as it should.

But a command that only triggers a full build sounds like a good idea :)

I'm glad to hear that!

davbeek commented 1 year ago

in my case, the table of contents in the sidebar isn't updated, even when I restart the language server.

When you delete the Sphinx/Esbonio build folder before restarting the language server, the complete website is rebuilt, but you will need to close and reopen the Esbonio previewer when the language server is finished rebuilding.

I use the Esbonio setting "esbonio.sphinx.buildDir": "${workspaceFolder}/_build/html" to have the build dir (_build/html) at the top level of my VSCode workspace, for easy access.

alcarney commented 2 months ago

As well as a "build all" command, there should be the option to clear the build folder and start from scratch

See: https://github.com/swyddfa/esbonio/issues/609#issuecomment-1722913901