Skip to content
Code on GitHub (opens in a new tab)

← All the news

Ehundu 0.12.0

A large site is built and uploaded in several calls. A web process has a time limit, and building a thousand-page site in one go does not fit. The new CompiladorPorLotes interface (with CompiladorPorLotesEnProceso and Lote as the result) does part of the work per call, with a budget of seconds given by the caller: iniciar($proyecto) starts, avanzar($proyecto, 20.0) does tasks until the budget runs out, and always at least one, and when completo() the informe() is that of a whole build and salida/ is left the same as if it had been built in one go. Where it has got to is saved in .ehundu/lote.json, inside the project, with its own .gitignore so that it does not clutter a repository; if the project changes halfway, the batch starts again and says so. The upload is also spread out: Desplegador::desplegar() accepts a budget ($segundos) and an already finished build ($compilado), and InformeDeDespliegue says whether it finished ($completo) and how many files are left ($pendientes). Each page is written as it is made, so salida/ mixes new and old pages until the last batch. The ehundu command does not change (docs/formato.md (opens in a new tab), §10.4 and decisions 124 and 125; docs/compilacion.md (opens in a new tab)).

A project declares which version of the format it is written for: formato: 1. In sitio.yml (§2), and "formato": 1 in the esquema.json of an editor (§11). Without the key, the format is 1 and there is no warning, so no 0.11 project has to change; a value that is not an integer greater than zero is warned about and taken as 1; and one greater than the one the engine understands stops the build with a clear error, instead of blindly building a format it does not know. It is only the major version, because within one the format only grows (decision 122; class Ehundu\Formato).

And at last it is written down what the library promises. docs/biblioteca.md (opens in a new tab) lists the console command and the PHP classes that will remain stable within a major version: building, reading a project, warnings and errors, Slug and deployment. The other classes carry @internal and may change in any minor version. What is going to stop being valid warns for at least one minor version before being removed (decision 123). 1.0 will freeze the format, the command and that list.

0.11 sites build the same: nothing changes that does not use formato or batches. Built from scratch with 0.11.1 and with this one, the twenty-three test sites (PDFs included) give the same files, one by one, and built in batches they give the same ones as in one go.

This version on GitHub (opens in a new tab), with the ehundu.phar.