mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 12:07:19 +00:00
Merge pull request #1992 from tgrosinger/master
Add documentation to tw5.com for CodeBlock widget
This commit is contained in:
commit
a30f9e1739
34
editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid
Normal file
34
editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid
Normal file
@ -0,0 +1,34 @@
|
||||
caption: codeblock
|
||||
created: 20151103160200000
|
||||
modified: 20151103160200000
|
||||
tags: Widgets
|
||||
title: CodeBlockWidget
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
! Introduction
|
||||
|
||||
The ''codeblock'' widget renders text in `<pre>` and `<code>` blocks, causing it to be
|
||||
displayed monospace. A language may optionally be specified using the
|
||||
''language'' attribute, however syntax highlighting will only be used if the
|
||||
[[Highlight Plugin]] is installed.
|
||||
|
||||
! Content and Attributes
|
||||
|
||||
The content of the `<$codeblock>` widget is ignored.
|
||||
|
||||
|!Attribute |!Description|
|
||||
|code|Contents of the block to render as code|
|
||||
|language|Programming language for syntax highlighting|
|
||||
|
||||
! Examples
|
||||
|
||||
Here is an example embedding the contents of a tiddler as a code block.
|
||||
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<$codeblock code={{$:/editions/tw5.com/macro-examples/say-hi}} />' />
|
||||
|
||||
A codeblock may also specify a language.
|
||||
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<$codeblock code="SELECT * FROM users WHERE deleted = false" language="sql" />' />
|
||||
|
Loading…
Reference in New Issue
Block a user