Module: MaRuKu
- Included in:
- MDElement
- Defined in:
- lib/maruku.rb,
lib/maruku/toc.rb,
lib/maruku/ext/div.rb,
lib/maruku/ext/div.rb,
lib/maruku/helpers.rb,
lib/maruku/helpers.rb,
lib/maruku/version.rb,
lib/maruku/defaults.rb,
lib/maruku/attributes.rb,
lib/maruku/attributes.rb,
lib/maruku/structures.rb,
lib/maruku/output/to_s.rb,
lib/maruku/string_utils.rb,
lib/maruku/output/to_html.rb,
lib/maruku/input/parse_doc.rb,
lib/maruku/input/rubypants.rb,
lib/maruku/output/s5/fancy.rb,
lib/maruku/output/s5/to_s5.rb,
lib/maruku/output/to_latex.rb,
lib/maruku/output/to_latex.rb,
lib/maruku/ext/math/parsing.rb,
lib/maruku/ext/math/to_html.rb,
lib/maruku/input/charsource.rb,
lib/maruku/input/extensions.rb,
lib/maruku/input/linesource.rb,
lib/maruku/tests/new_parser.rb,
lib/maruku/errors_management.rb,
lib/maruku/ext/math/elements.rb,
lib/maruku/ext/math/to_latex.rb,
lib/maruku/input/html_helper.rb,
lib/maruku/input/parse_block.rb,
lib/maruku/output/to_markdown.rb,
lib/maruku/output/to_markdown.rb,
lib/maruku/structures_inspect.rb,
lib/maruku/input/type_detection.rb,
lib/maruku/structures_iterators.rb,
lib/maruku/input/parse_span_better.rb,
lib/maruku/input_textile2/t2_parser.rb,
lib/maruku/output/to_latex_entities.rb,
lib/maruku/ext/math/mathml_engines/none.rb,
lib/maruku/ext/math/mathml_engines/ritex.rb,
lib/maruku/ext/math/mathml_engines/blahtex.rb,
lib/maruku/ext/math/mathml_engines/itex2mml.rb
Overview
This code does the classification of lines for block-level parsing.
Defined Under Namespace
Modules: Errors, Helpers, In, Out, Strings, Tests Classes: AttributeList, Exception, MDDocument, MDElement, Section
Constant Summary collapse
- Version =
'0.5.9'
- MarukuURL =
'http://maruku.rubyforge.org/'
- Globals =
{ :unsafe_features => false, :on_error => :warning, :use_numbered_headers => false, :maruku_signature => false, :code_background_color => '#fef', :code_show_spaces => false, :filter_html => false, :html_math_output_mathml => true, # also set :html_math_engine :html_math_engine => 'none', #ritex, itex2mml :html_math_output_png => false, :html_png_engine => 'none', :html_png_dir => 'pngs', :html_png_url => 'pngs/', :html_png_resolution => 200, :html_use_syntax => false, :latex_use_listings => false, :latex_cjk => false, :latex_cache_file => "blahtex_cache.pstore", # cache file for blahtex filter :debug_keep_ials => false, :doc_prefix => '' }
- MagicChar =
':'
- S5_external =
" \n <meta name=\"defaultView\" content=\"slideshow\" />\n <meta name=\"controlVis\" content=\"hidden\" />\n <link rel=\"stylesheet\" href=\"ui/default/slides.css\" type=\"text/css\" media=\"projection\" id=\"slideProj\" />\n <link rel=\"stylesheet\" href=\"ui/default/outline.css\" type=\"text/css\" media=\"screen\" id=\"outlineStyle\" />\n <link rel=\"stylesheet\" href=\"ui/default/print.css\" type=\"text/css\" media=\"print\" id=\"slidePrint\" />\n <link rel=\"stylesheet\" href=\"ui/default/opera.css\" type=\"text/css\" media=\"projection\" id=\"operaFix\" />\n <script src=\"ui/default/slides.js\" type=\"text/javascript\"> </script>\n"
- S5_Fancy =
"\n<meta name=\"defaultView\" content=\"slideshow\" />\n<meta name=\"controlVis\" content=\"hidden\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<style type=\"text/css\" media=\"projection\" id=\"slideProj\">\n/* Do not edit or override these styles! The system will likely break if you do. */\n\ndiv#header, div#footer, div#controls, .slide {position: absolute;}\nhtml>body div#header, html>body div#footer, \n html>body div#controls, html>body .slide {position: fixed;}\n.handout {display: none;}\n.layout {display: block;}\n.slide, .hideme, .incremental {visibility: hidden;}\n#slide0 {visibility: visible;}\n\n/* The following styles size, place, and layer the slide components.\n Edit these if you want to change the overall slide layout.\n The commented lines can be uncommented (and modified, if necessary) \n to help you with the rearrangement process. */\n\n/* target = 1024x768 */\n\ndiv#header, div#footer, .slide {width: 100%; top: 0; left: 0;}\ndiv#header {top: 0; height: 3em; z-index: 1;}\ndiv#footer {top: auto; bottom: 0; height: 2.5em; z-index: 5;}\n.slide {top: 0; width: 92%; padding: 3.5em 4% 4%; z-index: 2; list-style: none;}\ndiv#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;}\ndiv#controls form {position: absolute; bottom: 0; right: 0; width: 100%;\n margin: 0;}\n#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; z-index: 10;}\nhtml>body #currentSlide {position: fixed;}\n\n/*\ndiv#header {background: #FCC;}\ndiv#footer {background: #CCF;}\ndiv#controls {background: #BBD;}\ndiv#currentSlide {background: #FFC;}\n*/\n\n/* Following are the presentation styles -- edit away! */\n\nbody {background: #FFF url(bodybg.gif) -16px 0 no-repeat; color: #000; font-size: 2em;}\n:link, :visited {text-decoration: none; color: #00C;}\n#controls :active {color: #88A !important;}\n#controls :focus {outline: 1px dotted #227;}\nh1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;}\nul, pre {margin: 0; line-height: 1em;}\nhtml, body {margin: 0; padding: 0;}\n\nblockquote, q {font-style: italic;}\nblockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em; text-align: center; font-size: 1em;}\nblockquote p {margin: 0;}\nblockquote i {font-style: normal;}\nblockquote b {display: block; margin-top: 0.5em; font-weight: normal; font-size: smaller; font-style: normal;}\nblockquote b i {font-style: italic;}\n\nkbd {font-weight: bold; font-size: 1em;}\nsup {font-size: smaller; line-height: 1px;}\n\n.slide code {padding: 2px 0.25em; font-weight: bold; color: #533;}\n.slide code.bad, code del {color: red;}\n.slide code.old {color: silver;}\n.slide pre {padding: 0; margin: 0.25em 0 0.5em 0.5em; color: #533; font-size: 90%;}\n.slide pre code {display: block;}\n.slide ul {margin-left: 5%; margin-right: 7%; list-style: disc;}\n.slide li {margin-top: 0.75em; margin-right: 0;}\n.slide ul ul {line-height: 1;}\n.slide ul ul li {margin: .2em; font-size: 85%; list-style: square;}\n.slide img.leader {display: block; margin: 0 auto;}\n\ndiv#header, div#footer {background: #005; color: #AAB;\n font-family: Verdana, Helvetica, sans-serif;}\ndiv#header {background: #005 url(bodybg.gif) -16px 0 no-repeat;\n line-height: 1px;}\ndiv#footer {font-size: 0.5em; font-weight: bold; padding: 1em 0;}\n#footer h1, #footer h2 {display: block; padding: 0 1em;}\n#footer h2 {font-style: italic;}\n\ndiv.long {font-size: 0.75em;}\n.slide h1 {position: absolute; top: 0.7em; left: 87px; z-index: 1;\n margin: 0; padding: 0.3em 0 0 50px; white-space: nowrap;\n font: bold 150%/1em Helvetica, sans-serif; text-transform: capitalize;\n color: #DDE; background: #005;}\n.slide h3 {font-size: 130%;}\nh1 abbr {font-variant: small-caps;}\n\ndiv#controls {position: absolute; left: 50%; bottom: 0;\n width: 50%;\n text-align: right; font: bold 0.9em Verdana, Helvetica, sans-serif;}\nhtml>body div#controls {position: fixed; padding: 0 0 1em 0;\n top: auto;}\ndiv#controls form {position: absolute; bottom: 0; right: 0; width: 100%;\n margin: 0; padding: 0;}\n#controls #navLinks a {padding: 0; margin: 0 0.5em; \n background: #005; border: none; color: #779; \n cursor: pointer;}\n#controls #navList {height: 1em;}\n#controls #navList #jumplist {position: absolute; bottom: 0; right: 0; background: #DDD; color: #227;}\n\n#currentSlide {text-align: center; font-size: 0.5em; color: #449;}\n\n#slide0 {padding-top: 3.5em; font-size: 90%;}\n#slide0 h1 {position: static; margin: 1em 0 0; padding: 0;\n font: bold 2em Helvetica, sans-serif; white-space: normal;\n color: #000; background: transparent;}\n#slide0 h2 {font: bold italic 1em Helvetica, sans-serif; margin: 0.25em;}\n#slide0 h3 {margin-top: 1.5em; font-size: 1.5em;}\n#slide0 h4 {margin-top: 0; font-size: 1em;}\n\nul.urls {list-style: none; display: inline; margin: 0;}\n.urls li {display: inline; margin: 0;}\n.note {display: none;}\n.external {border-bottom: 1px dotted gray;}\nhtml>body .external {border-bottom: none;}\n.external:after {content: \" \\274F\"; font-size: smaller; color: #77B;}\n\n.incremental, .incremental *, .incremental *:after {color: #DDE; visibility: visible;}\nimg.incremental {visibility: hidden;}\n.slide .current {color: #B02;}\n\n\n/* diagnostics\n\nli:after {content: \" [\" attr(class) \"]\"; color: #F88;}\n */\n</style>\n<style type=\"text/css\" media=\"projection\" id=\"operaFix\">\n/* DO NOT CHANGE THESE unless you really want to break Opera Show */\n.slide {\n visibility: visible !important;\n position: static !important;\n page-break-before: always;\n}\n#slide0 {page-break-before: avoid;}\n\n</style>\n<style type=\"text/css\" media=\"screen\" id=\"outlineStyle\">\n/* don't change this unless you want the layout stuff to show up in the outline view! */\n\n.layout div, #footer *, #controlForm * {display: none;}\n#footer, #controls, #controlForm, #navLinks, #toggle {\n display: block; visibility: visible; margin: 0; padding: 0;}\n#toggle {float: right; padding: 0.5em;}\nhtml>body #toggle {position: fixed; top: 0; right: 0;}\n\n/* making the outline look pretty-ish */\n\n#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;}\n#slide0 h1 {padding-top: 1.5em;}\n.slide h1 {margin: 1.5em 0 0; padding-top: 0.25em;\n border-top: 1px solid #888; border-bottom: 1px solid #AAA;}\n#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;}\n\n</style>\n<style type=\"text/css\" media=\"print\" id=\"slidePrint\">\n/* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */\n.slide, ul {page-break-inside: avoid; visibility: visible !important;}\nh1 {page-break-after: avoid;}\n\nbody {font-size: 12pt; background: white;}\n* {color: black;}\n\n#slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;}\n#slide0 h3 {margin: 0; padding: 0;}\n#slide0 h4 {margin: 0 0 0.5em; padding: 0;}\n#slide0 {margin-bottom: 3em;}\n\nh1 {border-top: 2pt solid gray; border-bottom: 1px dotted silver;}\n.extra {background: transparent !important;}\ndiv.extra, pre.extra, .example {font-size: 10pt; color: #333;}\nul.extra a {font-weight: bold;}\np.example {display: none;}\n\n#header {display: none;}\n#footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;}\n#footer h2, #controls {display: none;}\n\n/* The following rule keeps the layout stuff out of print. Remove at your own risk! */\n.layout, .layout * {display: none !important;}\n\n</style>\n<script type=\"text/javascript\">\n<![CDATA[\n// S5 v1.1 slides.js -- released into the Public Domain\n//\n// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information \n// about all the wonderful and talented contributors to this code!\n\nvar undef;\nvar slideCSS = '';\nvar snum = 0;\nvar smax = 1;\nvar incpos = 0;\nvar number = undef;\nvar s5mode = true;\nvar defaultView = 'slideshow';\nvar controlVis = 'visible';\n\nvar isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;\nvar isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0;\nvar isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0;\n\nfunction hasClass(object, className) {\n if (!object.className) return false;\n return (object.className.search('(^|\\\\s)' + className + '(\\\\s|$)') != -1);\n}\n\nfunction hasValue(object, value) {\n if (!object) return false;\n return (object.search('(^|\\\\s)' + value + '(\\\\s|$)') != -1);\n}\n\nfunction removeClass(object,className) {\n if (!object) return;\n object.className = object.className.replace(new RegExp('(^|\\\\s)'+className+'(\\\\s|$)'), RegExp.$1+RegExp.$2);\n}\n\nfunction addClass(object,className) {\n if (!object || hasClass(object, className)) return;\n if (object.className) {\n object.className += ' '+className;\n } else {\n object.className = className;\n }\n}\n\nfunction GetElementsWithClassName(elementName,className) {\n var allElements = document.getElementsByTagName(elementName);\n var elemColl = new Array();\n for (var i = 0; i< allElements.length; i++) {\n if (hasClass(allElements[i], className)) {\n elemColl[elemColl.length] = allElements[i];\n }\n }\n return elemColl;\n}\n\nfunction isParentOrSelf(element, id) {\n if (element == null || element.nodeName=='BODY') return false;\n else if (element.id == id) return true;\n else return isParentOrSelf(element.parentNode, id);\n}\n\nfunction nodeValue(node) {\n var result = \"\";\n if (node.nodeType == 1) {\n var children = node.childNodes;\n for (var i = 0; i < children.length; ++i) {\n result += nodeValue(children[i]);\n } \n }\n else if (node.nodeType == 3) {\n result = node.nodeValue;\n }\n return(result);\n}\n\nfunction slideLabel() {\n var slideColl = GetElementsWithClassName('*','slide');\n var list = document.getElementById('jumplist');\n smax = slideColl.length;\n for (var n = 0; n < smax; n++) {\n var obj = slideColl[n];\n\n var did = 'slide' + n.toString();\n obj.setAttribute('id',did);\n if (isOp) continue;\n\n var otext = '';\n var menu = obj.firstChild;\n if (!menu) continue; // to cope with empty slides\n while (menu && menu.nodeType == 3) {\n menu = menu.nextSibling;\n }\n if (!menu) continue; // to cope with slides with only text nodes\n\n var menunodes = menu.childNodes;\n for (var o = 0; o < menunodes.length; o++) {\n otext += nodeValue(menunodes[o]);\n }\n list.options[list.length] = new Option(n + ' : ' + otext, n);\n }\n}\n\nfunction currentSlide() {\n var cs;\n if (document.getElementById) {\n cs = document.getElementById('currentSlide');\n } else {\n cs = document.currentSlide;\n }\n cs.innerHTML = '<span id=\"csHere\">' + snum + '<\\/span> ' + \n '<span id=\"csSep\">\\/<\\/span> ' + \n '<span id=\"csTotal\">' + (smax-1) + '<\\/span>';\n if (snum == 0) {\n cs.style.visibility = 'hidden';\n } else {\n cs.style.visibility = 'visible';\n }\n}\n\nfunction go(step) {\n if (document.getElementById('slideProj').disabled || step == 0) return;\n var jl = document.getElementById('jumplist');\n var cid = 'slide' + snum;\n var ce = document.getElementById(cid);\n if (incrementals[snum].length > 0) {\n for (var i = 0; i < incrementals[snum].length; i++) {\n removeClass(incrementals[snum][i], 'current');\n removeClass(incrementals[snum][i], 'incremental');\n }\n }\n if (step != 'j') {\n snum += step;\n lmax = smax - 1;\n if (snum > lmax) snum = lmax;\n if (snum < 0) snum = 0;\n } else\n snum = parseInt(jl.value);\n var nid = 'slide' + snum;\n var ne = document.getElementById(nid);\n if (!ne) {\n ne = document.getElementById('slide0');\n snum = 0;\n }\n if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;}\n if (incrementals[snum].length > 0 && incpos == 0) {\n for (var i = 0; i < incrementals[snum].length; i++) {\n if (hasClass(incrementals[snum][i], 'current'))\n incpos = i + 1;\n else\n addClass(incrementals[snum][i], 'incremental');\n }\n }\n if (incrementals[snum].length > 0 && incpos > 0)\n addClass(incrementals[snum][incpos - 1], 'current');\n ce.style.visibility = 'hidden';\n ne.style.visibility = 'visible';\n jl.selectedIndex = snum;\n currentSlide();\n number = 0;\n}\n\nfunction goTo(target) {\n if (target >= smax || target == snum) return;\n go(target - snum);\n}\n\nfunction subgo(step) {\n if (step > 0) {\n removeClass(incrementals[snum][incpos - 1],'current');\n removeClass(incrementals[snum][incpos], 'incremental');\n addClass(incrementals[snum][incpos],'current');\n incpos++;\n } else {\n incpos--;\n removeClass(incrementals[snum][incpos],'current');\n addClass(incrementals[snum][incpos], 'incremental');\n addClass(incrementals[snum][incpos - 1],'current');\n }\n}\n\nfunction toggle() {\n var slideColl = GetElementsWithClassName('*','slide');\n var slides = document.getElementById('slideProj');\n var outline = document.getElementById('outlineStyle');\n if (!slides.disabled) {\n slides.disabled = true;\n outline.disabled = false;\n s5mode = false;\n fontSize('1em');\n for (var n = 0; n < smax; n++) {\n var slide = slideColl[n];\n slide.style.visibility = 'visible';\n }\n } else {\n slides.disabled = false;\n outline.disabled = true;\n s5mode = true;\n fontScale();\n for (var n = 0; n < smax; n++) {\n var slide = slideColl[n];\n slide.style.visibility = 'hidden';\n }\n slideColl[snum].style.visibility = 'visible';\n }\n}\n\nfunction showHide(action) {\n var obj = GetElementsWithClassName('*','hideme')[0];\n switch (action) {\n case 's': obj.style.visibility = 'visible'; break;\n case 'h': obj.style.visibility = 'hidden'; break;\n case 'k':\n if (obj.style.visibility != 'visible') {\n obj.style.visibility = 'visible';\n } else {\n obj.style.visibility = 'hidden';\n }\n break;\n }\n}\n\n// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/)\nfunction keys(key) {\n if (!key) {\n key = event;\n key.which = key.keyCode;\n }\n if (key.which == 84) {\n toggle();\n return;\n }\n if (s5mode) {\n switch (key.which) {\n case 10: // return\n case 13: // enter\n if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;\n if (key.target && isParentOrSelf(key.target, 'controls')) return;\n if(number != undef) {\n goTo(number);\n break;\n }\n case 32: // spacebar\n case 34: // page down\n case 39: // rightkey\n case 40: // downkey\n if(number != undef) {\n go(number);\n } else if (!incrementals[snum] || incpos >= incrementals[snum].length) {\n go(1);\n } else {\n subgo(1);\n }\n break;\n case 33: // page up\n case 37: // leftkey\n case 38: // upkey\n if(number != undef) {\n go(-1 * number);\n } else if (!incrementals[snum] || incpos <= 0) {\n go(-1);\n } else {\n subgo(-1);\n }\n break;\n case 36: // home\n goTo(0);\n break;\n case 35: // end\n goTo(smax-1);\n break;\n case 67: // c\n showHide('k');\n break;\n }\n if (key.which < 48 || key.which > 57) {\n number = undef;\n } else {\n if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;\n if (key.target && isParentOrSelf(key.target, 'controls')) return;\n number = (((number != undef) ? number : 0) * 10) + (key.which - 48);\n }\n }\n return false;\n}\n\nfunction clicker(e) {\n number = undef;\n var target;\n if (window.event) {\n target = window.event.srcElement;\n e = window.event;\n } else target = e.target;\n if (target.getAttribute('href') != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true;\n if (!e.which || e.which == 1) {\n if (!incrementals[snum] || incpos >= incrementals[snum].length) {\n go(1);\n } else {\n subgo(1);\n }\n }\n}\n\nfunction findSlide(hash) {\n var target = null;\n var slides = GetElementsWithClassName('*','slide');\n for (var i = 0; i < slides.length; i++) {\n var targetSlide = slides[i];\n if ( (targetSlide.name && targetSlide.name == hash)\n || (targetSlide.id && targetSlide.id == hash) ) {\n target = targetSlide;\n break;\n }\n }\n while(target != null && target.nodeName != 'BODY') {\n if (hasClass(target, 'slide')) {\n return parseInt(target.id.slice(5));\n }\n target = target.parentNode;\n }\n return null;\n}\n\nfunction slideJump() {\n if (window.location.hash == null) return;\n var sregex = /^#slide(\\d+)$/;\n var matches = sregex.exec(window.location.hash);\n var dest = null;\n if (matches != null) {\n dest = parseInt(matches[1]);\n } else {\n dest = findSlide(window.location.hash.slice(1));\n }\n if (dest != null)\n go(dest - snum);\n}\n\nfunction fixLinks() {\n var thisUri = window.location.href;\n thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length);\n var aelements = document.getElementsByTagName('A');\n for (var i = 0; i < aelements.length; i++) {\n var a = aelements[i].href;\n var slideID = a.match('\\#slide[0-9]{1,2}');\n if ((slideID) && (slideID[0].slice(0,1) == '#')) {\n var dest = findSlide(slideID[0].slice(1));\n if (dest != null) {\n if (aelements[i].addEventListener) {\n aelements[i].addEventListener(\"click\", new Function(\"e\",\n \"if (document.getElementById('slideProj').disabled) return;\" +\n \"go(\"+dest+\" - snum); \" +\n \"if (e.preventDefault) e.preventDefault();\"), true);\n } else if (aelements[i].attachEvent) {\n aelements[i].attachEvent(\"onclick\", new Function(\"\",\n \"if (document.getElementById('slideProj').disabled) return;\" +\n \"go(\"+dest+\" - snum); \" +\n \"event.returnValue = false;\"));\n }\n }\n }\n }\n}\n\nfunction externalLinks() {\n if (!document.getElementsByTagName) return;\n var anchors = document.getElementsByTagName('a');\n for (var i=0; i<anchors.length; i++) {\n var anchor = anchors[i];\n if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) {\n anchor.target = '_blank';\n addClass(anchor,'external');\n }\n }\n}\n\nfunction createControls() {\n var controlsDiv = document.getElementById(\"controls\");\n if (!controlsDiv) return;\n var hider = ' onmouseover=\"showHide(\\'s\\');\" onmouseout=\"showHide(\\'h\\');\"';\n var hideDiv, hideList = '';\n if (controlVis == 'hidden') {\n hideDiv = hider;\n } else {\n hideList = hider;\n }\n controlsDiv.innerHTML = '<form action=\"#\" id=\"controlForm\"' + hideDiv + '>' +\n '<div id=\"navLinks\">' +\n '<a accesskey=\"t\" id=\"toggle\" href=\"javascript:toggle();\">Ø<\\/a>' +\n '<a accesskey=\"z\" id=\"prev\" href=\"javascript:go(-1);\">«<\\/a>' +\n '<a accesskey=\"x\" id=\"next\" href=\"javascript:go(1);\">»<\\/a>' +\n '<div id=\"navList\"' + hideList + '><select id=\"jumplist\" onchange=\"go(\\'j\\');\"><\\/select><\\/div>' +\n '<\\/div><\\/form>';\n if (controlVis == 'hidden') {\n var hidden = document.getElementById('navLinks');\n } else {\n var hidden = document.getElementById('jumplist');\n }\n addClass(hidden,'hideme');\n}\n\nfunction fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers\n if (!s5mode) return false;\n var vScale = 22; // both yield 32 (after rounding) at 1024x768\n var hScale = 32; // perhaps should auto-calculate based on theme's declared value?\n if (window.innerHeight) {\n var vSize = window.innerHeight;\n var hSize = window.innerWidth;\n } else if (document.documentElement.clientHeight) {\n var vSize = document.documentElement.clientHeight;\n var hSize = document.documentElement.clientWidth;\n } else if (document.body.clientHeight) {\n var vSize = document.body.clientHeight;\n var hSize = document.body.clientWidth;\n } else {\n var vSize = 700; // assuming 1024x768, minus chrome and such\n var hSize = 1024; // these do not account for kiosk mode or Opera Show\n }\n var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));\n fontSize(newSize + 'px');\n if (isGe) { // hack to counter incremental reflow bugs\n var obj = document.getElementsByTagName('body')[0];\n obj.style.display = 'none';\n obj.style.display = 'block';\n }\n}\n\nfunction fontSize(value) {\n if (!(s5ss = document.getElementById('s5ss'))) {\n if (!isIE) {\n document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style'));\n s5ss.setAttribute('media','screen, projection');\n s5ss.setAttribute('id','s5ss');\n } else {\n document.createStyleSheet();\n document.s5ss = document.styleSheets[document.styleSheets.length - 1];\n }\n }\n if (!isIE) {\n while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild);\n s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}'));\n } else {\n document.s5ss.addRule('body','font-size: ' + value + ' !important;');\n }\n}\n\nfunction notOperaFix() {\n slideCSS = document.getElementById('slideProj').href;\n var slides = document.getElementById('slideProj');\n var outline = document.getElementById('outlineStyle');\n slides.setAttribute('media','screen');\n outline.disabled = true;\n if (isGe) {\n slides.setAttribute('href','null'); // Gecko fix\n slides.setAttribute('href',slideCSS); // Gecko fix\n }\n if (isIE && document.styleSheets && document.styleSheets[0]) {\n document.styleSheets[0].addRule('img', 'behavior: url(ui/default/iepngfix.htc)');\n document.styleSheets[0].addRule('div', 'behavior: url(ui/default/iepngfix.htc)');\n document.styleSheets[0].addRule('.slide', 'behavior: url(ui/default/iepngfix.htc)');\n }\n}\n\nfunction getIncrementals(obj) {\n var incrementals = new Array();\n if (!obj) \n return incrementals;\n var children = obj.childNodes;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (hasClass(child, 'incremental')) {\n if (child.nodeName == 'OL' || child.nodeName == 'UL') {\n removeClass(child, 'incremental');\n for (var j = 0; j < child.childNodes.length; j++) {\n if (child.childNodes[j].nodeType == 1) {\n addClass(child.childNodes[j], 'incremental');\n }\n }\n } else {\n incrementals[incrementals.length] = child;\n removeClass(child,'incremental');\n }\n }\n if (hasClass(child, 'show-first')) {\n if (child.nodeName == 'OL' || child.nodeName == 'UL') {\n removeClass(child, 'show-first');\n if (child.childNodes[isGe].nodeType == 1) {\n removeClass(child.childNodes[isGe], 'incremental');\n }\n } else {\n incrementals[incrementals.length] = child;\n }\n }\n incrementals = incrementals.concat(getIncrementals(child));\n }\n return incrementals;\n}\n\nfunction createIncrementals() {\n var incrementals = new Array();\n for (var i = 0; i < smax; i++) {\n incrementals[i] = getIncrementals(document.getElementById('slide'+i));\n }\n return incrementals;\n}\n\nfunction defaultCheck() {\n var allMetas = document.getElementsByTagName('meta');\n for (var i = 0; i< allMetas.length; i++) {\n if (allMetas[i].name == 'defaultView') {\n defaultView = allMetas[i].content;\n }\n if (allMetas[i].name == 'controlVis') {\n controlVis = allMetas[i].content;\n }\n }\n}\n\n// Key trap fix, new function body for trap()\nfunction trap(e) {\n if (!e) {\n e = event;\n e.which = e.keyCode;\n }\n try {\n modifierKey = e.ctrlKey || e.altKey || e.metaKey;\n }\n catch(e) {\n modifierKey = false;\n }\n return modifierKey || e.which == 0;\n}\n\nfunction startup() {\n defaultCheck();\n if (!isOp) \n createControls();\n slideLabel();\n fixLinks();\n externalLinks();\n fontScale();\n if (!isOp) {\n notOperaFix();\n incrementals = createIncrementals();\n slideJump();\n if (defaultView == 'outline') {\n toggle();\n }\n document.onkeyup = keys;\n document.onkeypress = trap;\n document.onclick = clicker;\n }\n}\n\nwindow.onload = startup;\nwindow.onresize = function(){setTimeout('fontScale()', 50);}\n]]></script>\n\n"
Class Method Summary collapse
Instance Method Summary collapse
-
#markdown_extra? ⇒ Boolean
If true, use also PHP Markdown extra syntax.
- #new_meta_data? ⇒ Boolean
Class Method Details
.textile2(source, params) ⇒ Object
88 89 90 91 |
# File 'lib/maruku/input_textile2/t2_parser.rb', line 88 def self.textile2(source, params) m = Maruku.new m.t2_parse(source, params) end |
Instance Method Details
#markdown_extra? ⇒ Boolean
If true, use also PHP Markdown extra syntax
Note: it is not guaranteed that if it’s false then no special features will be used.
So please, ignore it for now.
32 33 34 |
# File 'lib/maruku/version.rb', line 32 def markdown_extra? true end |
#new_meta_data? ⇒ Boolean
36 37 38 |
# File 'lib/maruku/version.rb', line 36 def true end |