From 650a9a76df1a12ac6f061e6e01fb448599c9bfbd Mon Sep 17 00:00:00 2001 From: Tony Grosinger Date: Sat, 3 Oct 2015 16:47:01 -0700 Subject: [PATCH 1/2] Add documentation to tw5.com for CodeBlock widget Partial fix for #1985 --- .../tiddlers/widgets/CodeblockWidget.tid | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid diff --git a/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid b/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid new file mode 100644 index 000000000..3c64d227e --- /dev/null +++ b/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid @@ -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 `
` and `` 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">'/>
+

From 2e1ad771d62ae1dda3a1192ae0cf916ee90e9626 Mon Sep 17 00:00:00 2001
From: Tony Grosinger 
Date: Sun, 4 Oct 2015 13:05:46 -0700
Subject: [PATCH 2/2] Whitespace clean up and missing close tag

Clean up for CodeblockWidget documentation.
---
 editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid b/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid
index 3c64d227e..5592b3b45 100644
--- a/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid
+++ b/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid
@@ -24,11 +24,11 @@ The content of the `<$codeblock>` widget is ignored.
 
 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}}>'/>
+<$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">'/>
+<$macrocall $name='wikitext-example-without-html'
+src='<$codeblock code="SELECT * FROM users WHERE deleted = false" language="sql" />' />