Pārlūkot izejas kodu

Implemented example cross-referencing from docs

Casey Grun 10 gadi atpakaļ
vecāks
revīzija
66ce3bafff
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      docs/page.js

+ 4 - 0
docs/page.js

@@ -33,6 +33,10 @@ var onDocumentLoad = function ( event ) {
 	text = text.replace(/\[link:([\w|\:|\/|\.|\-|\_|\(|\)]+) ([\w|\:|\/|\.|\-|\_ ]+)\]/gi, "<a href=\"$1\"  target=\"_blank\">$2</a>" ); // [link:url title]
 	text = text.replace(/\[link:([\w|\:|\/|\.|\-|\_|\(|\)]+) ([\w|\:|\/|\.|\-|\_ ]+)\]/gi, "<a href=\"$1\"  target=\"_blank\">$2</a>" ); // [link:url title]
 	text = text.replace(/\*([\w|\d|\"|\-|\(][\w|\d|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]*[\w|\d|\"|\)]|\w)\*/gi, "<strong>$1</strong>" ); // *
 	text = text.replace(/\*([\w|\d|\"|\-|\(][\w|\d|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]*[\w|\d|\"|\)]|\w)\*/gi, "<strong>$1</strong>" ); // *
 
 
+	text = text.replace(/\[example:([\w\_]+)\]/gi, "[example:$1 $1]" ); // [example:name] to [example:name title]
+	text = text.replace(/\[example:([\w\_]+) ([\w\_]+)\]/gi, "<a href=\"../../../examples/#$1\"  target=\"_blank\">$2</a>" ); // [example:name title]
+
+
 	document.body.innerHTML = text;
 	document.body.innerHTML = text;
 
 
 	// handle code snippets formatting
 	// handle code snippets formatting