Skip to content

Commit c76e100

Browse files
committed
use starlark lang for code snippts
1 parent 33eaa93 commit c76e100

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/howto/get-python-version.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ the version string.
1313

1414
Create a file named `my_rule.bzl`:
1515

16-
```text
16+
```starlark
1717
# my_rule.bzl
1818
def _my_rule_impl(ctx):
1919
toolchain = ctx.toolchains["@rules_python//python:toolchain_type"]
@@ -39,7 +39,7 @@ my_rule = rule(
3939

4040
In your `BUILD.bazel` file, you can use the rule like this:
4141

42-
```text
42+
```starlark
4343
# BUILD.bazel
4444
load(":my_rule.bzl", "my_rule")
4545

@@ -51,7 +51,7 @@ my_rule(
5151
When you build this target, it will generate a file named
5252
`show_python_version.txt` containing the Python version (e.g., `3.9`).
5353

54-
```text
54+
```starlark
5555
bazel build :show_python_version
5656
cat bazel-bin/show_python_version.txt
57-
```
57+
```

docs/howto/linking-libpython.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ other C/C++ rules via the `CcInfo` provider.
2020

2121
Here's an example of a rule that creates the `-lpython<version>` flag:
2222

23-
```text
23+
```starlark
2424
# python_libs.bzl
2525
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "cc_common")
2626

@@ -47,7 +47,7 @@ python_libs = rule(
4747
In your `BUILD.bazel` file, define a target using this rule and add it to the
4848
`deps` of your `cc_binary` or `cc_library`.
4949

50-
```text
50+
```starlark
5151
# BUILD.bazel
5252
load(":python_libs.bzl", "python_libs")
5353

@@ -63,4 +63,4 @@ cc_binary(
6363
# Other dependencies
6464
],
6565
)
66-
```
66+
```

0 commit comments

Comments
 (0)