Added more docs on events

This commit is contained in:
Armin Ronacher 2015-12-26 21:00:48 +01:00
parent bc60df6d26
commit 59a4ab50b9
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,12 @@
title: after-build-all
---
signature: builder
---
summary: This event is emitted after all sources are built.
---
type: event
---
body:
This event is emitted after the builder build all sources. It works similar
to the [before-build-all :ref](../before-build-all/) event otherwise.

View File

@ -0,0 +1,13 @@
title: after-build
---
signature: builder, build_state, source, prog
---
summary: This event is emitted after an individual source is built.
---
type: event
---
body:
This event is emitted right after a source is being built into a final build
artifact. It works pretty much exactly the same as the [before-build
:ref](../before-build/) event.

View File

@ -0,0 +1,27 @@
title: before-build-all
---
signature: builder
---
summary: This event is emitted before all sources are built.
---
type: event
---
body:
This event is emitted before the builder decides to build all sources. It's
most useful for preprocessing sources on the file system before the rest of
the build process should pick it up. For instance here a plugin could inject
additional files into the asset folder and similar things.
As an example, this is what the [Webpack Support
:ref](../../../../guides/webpack/) uses.
## Example
```python
import subprocess
def on_before_build_all(self, builder, **extra):
root = ospath.join(self.env.root_path, 'webpack')
subprocess.Popen(['webpack'], cwd=root).wait()
```