-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweak the semantic convention code generation. #3394
Tweak the semantic convention code generation. #3394
Conversation
In particular, to better support links and html in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also try using render_markdown(code="{{@code {0}}}")
. Pro: Will look a bit more idiomatic, con: Would probably break if there are }
in the input.
@@ -64,10 +64,10 @@ public final class {{class}} { | |||
{%- for attribute in attributes if attribute.is_local and not attribute.ref %} | |||
|
|||
/** | |||
* {% filter escape %}{{attribute.brief | to_doc_brief}}.{% endfilter %} | |||
* {% filter safe %}{{attribute.brief | render_markdown}}{% endfilter %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* {% filter safe %}{{attribute.brief | render_markdown}}{% endfilter %} | |
* {{attribute.brief | render_markdown | safe}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't even think it needs the | safe
which I believe is a no-op.
{%- if attribute.note %} | ||
* | ||
* Note: {% filter escape %}{{attribute.note | to_doc_brief}}.{% endfilter %} | ||
* <p>Notes: {% filter safe %}{{attribute.note | render_markdown}}{% endfilter %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* <p>Notes: {% filter safe %}{{attribute.note | render_markdown}}{% endfilter %} | |
* <p>Notes: {{attribute.note | render_markdown | safe}} |
Can you explain/point to docs about what this is doing? @breedx-splk and I spent an hour yesterday trying to figure out how to send code blocks into the python via the jinja template and never saw anything like this (and never got anything working, either). |
Unfortunately, there is no documentation for this one. 😬
|
So instead of |
Also unfortunately, it doesn't look like it works. :(
|
Because you forgot the closing |
Dangit. This code ends up looking like perl. |
Yeah, too many nesting levels here with quotes and various brackets. |
Now I have the power! #3398 |
In particular, to better support links and html in the docs.