From e44a7e37b6c7b5961adaffc62b9042b8d442938e Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 13 Nov 2008 09:49:11 +0000 Subject: New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f --- .../js/dojox/highlight/tests/test_pygments.html | 142 +++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 includes/js/dojox/highlight/tests/test_pygments.html (limited to 'includes/js/dojox/highlight/tests/test_pygments.html') diff --git a/includes/js/dojox/highlight/tests/test_pygments.html b/includes/js/dojox/highlight/tests/test_pygments.html new file mode 100644 index 0000000..6bdced6 --- /dev/null +++ b/includes/js/dojox/highlight/tests/test_pygments.html @@ -0,0 +1,142 @@ + + + + dojox.highlight.pygments - syntax highlighting | The Dojo Toolkit + + + + + + + + + + + +

Test Pygments-based highlighting

+ +

Current theme from the pygments set: + +

+ +

Javascript:

+ +
function initHighlight(block) {
+  if (block.className.search(/\bno\-highlight\b/) != -1)
+    return false;
+  try {
+    blockText(block);
+  } catch (e) {
+    if (e == 'Complex markup')
+      return;
+  }//try
+  var classes = block.className.split(/\s+/);
+  for (var i = 0; i < classes.length; i++) {
+    if (LANGUAGES[classes[i]]) {
+      highlightLanguage(block, classes[i]);
+      return;
+    }//if
+  }//for
+  highlightAuto(block);
+}//initHighlight
+ +

Some CSS code:

+ +
body, 
+html {
+  font: Tahoma, Arial, sans-serif;
+}
+
+#content {
+  width: 100%; /* test comment */
+  height: 100%
+}
+
+p[lang=ru] {
+  color: red;
+}
+
+ +

Some HTML code:

+ +
<head>
+  <title>Title</title>
+<body>
+  <p class="something">Something</p>
+  <p class=something>Something</p>
+  <!-- comment -->
+  <p class>Something</p>
+  <p class="something" title="p">Something</p>
+</body>
+
+ +

A custom XML document:

+ +
<?xml version="1.0"?>
+<response value="ok">
+  <text>Ok</text>
+  <comment/>
+  <ns:description><![CDATA[ 
+  CDATA is <not> magical. 
+  ]]></ns:description>
+</response>
+
+ + + -- cgit v1.2.3-54-g00ecf