aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--site/docs/skylark/aspects.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/site/docs/skylark/aspects.md b/site/docs/skylark/aspects.md
index def865373f..93c0e93bdc 100644
--- a/site/docs/skylark/aspects.md
+++ b/site/docs/skylark/aspects.md
@@ -102,11 +102,13 @@ for actions generated by aspects.
Aspect implementation functions are similiar to the rule implementation
functions. They return [providers](rule.md#providers), can generate
[actions](rule.md#actions) and take two arguments:
+
* `target`: the target the aspect is being applied to.
* [`ctx`](lib/ctx.html): `ctx` object that can be used to access attributes and
generate outputs and actions.
Example:
+
```python
def _metal_proto_aspect_impl(target, ctx):
# For every `src` in proto_library, generate an output file
@@ -138,10 +140,10 @@ returns a struct of providers that are accessible to its dependencies.
the implementation of aspect A. It is an error if a target and an aspect that
is applied to it each provide a provider with the same name.
* For the aspect implementation, the values of attributes along which
- the aspect is propagated (from the 'attr_aspect' list) are replaced with
+ the aspect is propagated (from the 'attr\_aspect' list) are replaced with
the results of an application of the aspect to them. For example, if target
X has Y and Z in its deps, `ctx.rule.attr.deps` for A(X) will be [A(Y), A(Z)].
- In the `_metal_proto_aspect_impl` function above, ctx.rule.attr.deps will be
+ In the `\_metal\_proto\_aspect\_impl` function above, ctx.rule.attr.deps will be
Target objects that are the results of applying the aspect to the 'deps'
of the original target to which the aspect has been applied.
That allows the aspect to examine `metal_proto` provider on them.