@@ -31,15 +31,29 @@ for the development of APIs to support custom derived rules.
3131Custom rules can be created using the core rules as a basis by using their rule
3232builder APIs.
3333
34- * {bzl: obj }` //python/apis:executables.bzl%executables ` for builders for executables
35- * {bzl: obj }` //python/apis:libraries.bzl%libraries ` for builders for libraries
34+ * [ ` //python/apis:executables.bzl ` ] ( #python-apis-executables-bzl ) : builders for
35+ executables.
36+ * [ ` //python/apis:libraries.bzl ` ] ( #python-apis-libraries-bzl ) : builders for
37+ libraries.
3638
3739These builders create {bzl: obj }` ruleb.Rule ` objects, which are thin
3840wrappers around the keyword arguments eventually passed to the ` rule() `
3941function. These builder APIs give access to the _ entire_ rule definition and
4042allow arbitrary modifications.
4143
42- ### Example: validating a source file
44+ This is level of control is powerful, but also volatile. A rule definition
45+ contains many details that _ must_ change as the implementation changes. What
46+ is more or less likely to change isn't known in advance, but some general
47+ rules are:
48+
49+ * Additive behavior to public attributes will be less prone to breaking.
50+ * Internal attributes that directly support a public attribute are likely
51+ reliable.
52+ * Internal attributes that support an action are more likely to change.
53+ * Rule toolchains are moderately stable (toolchains are mostly internal to
54+ how a rule works, but custom toolchains are supported).
55+
56+ ## Example: validating a source file
4357
4458In this example, we derive from ` py_library ` a custom rule that verifies source
4559code contains the word "snakes". It does this by:
@@ -95,7 +109,7 @@ def create_has_snakes_rule():
95109has_snakes_library = create_has_snakes_rule()
96110```
97111
98- ### Example: adding transitions
112+ ## Example: adding transitions
99113
100114In this example, we derive from ` py_binary ` to force building for a particular
101115platform. We do this by:
0 commit comments