(Install package: OSW Core) |
(Update package: OSW Core) |
||
Line 40: | Line 40: | ||
"type": "string", | "type": "string", | ||
"label": "Highlighted lines", | "label": "Highlighted lines", | ||
"description": "List of lines or line ranges to highlight. Line numbers are absolute and must be between start and end line of a block selection.", | "description": "List of lines or line ranges to highlight. Line numbers are absolute and must be between start and end line of a block selection. Not supported with rendered markdown.", | ||
"example": "5,7,9-10", | "example": "5,7,9-10", | ||
"suggested": true | "suggested": true | ||
}, | |||
"render_markdown": { | |||
"type": "boolean", | |||
"label": "Render markdown", | |||
"description": "If set, Markdown files (\".md\") are rendered instead of displaying the source text", | |||
"autovalue": "1" | |||
}, | }, | ||
"uuid": { | "uuid": { | ||
Line 60: | Line 66: | ||
"lang", | "lang", | ||
"highlight", | "highlight", | ||
"render_markdown", | |||
"uuid" | "uuid" | ||
] | ] | ||
Line 74: | Line 81: | ||
|lang={{{lang|}}} | |lang={{{lang|}}} | ||
|highlight={{{highlight|}}} | |highlight={{{highlight|}}} | ||
|render_markdown={{{render_markdown|}}} | |||
}}(Source Code from [{{{url|}}} Github])</includeonly> | }}(Source Code from [{{{url|}}} Github])</includeonly> |
Latest revision as of 07:39, 27 June 2023
Example / Selftest
class OSW(BaseModel):
"""Bundles core functionalities of OpenSemanticWorld (OSW)"""
uuid: str = "2ea5b605-c91f-4e5a-9559-3dff79fdd4a5"
_protected_keywords = (
"_osl_template",
"_osl_footer",
) # private properties included in model export
class Config:
arbitrary_types_allowed = True # neccessary to allow e.g. np.array as type
site: WtSite
(Source Code from Github)
Embeds a source code block from github with syntax highlighting
Parameter | Description | Type | Status | |
---|---|---|---|---|
Github (perma)link | url | When using line numbers (in the link or as parameter) use the permalink!
| URL | required |
Start line | start_line | Start line of a sub-section of the file. Can also be specified in the link as #L3
| Number | optional |
End line | end_line | Start line of a sub-section of the file. Can also be specified in the link as #L3-L12
| Number | optional |
Show line numbers | show_line_numbers | If selected, line numbers are displayed
| Boolean | optional |
Language | lang | Language for the syntax highlighting. Auto-detected from the file suffix (e. g. ".py") for some languages, defaults to "text".
| String | optional |
Highlighted lines | highlight | List of lines or line ranges to highlight. Line numbers are absolute and must be between start and end line of a block selection. Not supported with rendered markdown.
| String | suggested |
Render markdown | render_markdown | If set, Markdown files (".md") are rendered instead of displaying the source text
| Boolean | optional |
UUID (auto-generated, should not be changed) | uuid | no description
| String | required |