forked from strands-agents/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacros.py
More file actions
60 lines (47 loc) · 1.79 KB
/
macros.py
File metadata and controls
60 lines (47 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""
MkDocs macros for Strands Agents documentation.
This file defines custom Jinja2 macros that can be used in markdown files.
"""
def define_env(env):
"""
Define custom macros for the MkDocs environment.
Args:
env: The MkDocs macros plugin environment
"""
@env.macro
def ts_not_supported(message="This feature is not supported in TypeScript."):
"""
Generate an admonition box indicating feature is not supported in TypeScript.
Args:
message: Custom message to display (default: "This feature is not supported in TypeScript.")
Returns:
Markdown string with info admonition
Example usage in markdown:
{{ ts_not_supported() }}
{{ ts_not_supported("Coming soon in TypeScript") }}
"""
return f'''!!! info "Not supported in TypeScript"
{message}
'''
@env.macro
def ts_not_supported_code(message="Not supported in TypeScript"):
"""
Generate a TypeScript code tab with a message indicating feature is not supported.
Args:
message: Custom message to display (default: "Not supported in TypeScript")
Returns:
Markdown string with TypeScript tab containing the message
Example usage in markdown:
{{ ts_not_supported_code() }}
{{ ts_not_supported_code("Coming soon in TypeScript") }}
"""
return f'''=== "TypeScript"
```ts
// {message}
```
'''
@env.macro
def experimental_feature_warning(message="This feature is experimental and may change in future versions. Use with caution in production environments."):
return f'''!!! warning "Experimental Feature"
{message}
'''