├── about.html
├── editor.html
├── footer.html
├── index.html
├── john1.html
├── js
├── jr.js
├── prettify.js
└── showdown.js
├── license.html
├── readme.md
├── themes
├── code.css
├── default.css
└── simple.css
└── uploads
└── empty
/about.html:
--------------------------------------------------------------------------------
1 | # The Static, Static Blog Generator
2 |
3 | ### May 17th, 2014
4 |
5 | We all like publishing our thoughts online - but why is it such a bother to run a CMS?
6 |
7 | Managing databases, updating software, and keeping track of our content often cuts into the most important activity: *expressing ourselves*.
8 |
9 | The web makes it really easy to share our thoughts with millions of individuals from around the world. With it we are able to talk about the things we love.
10 |
11 | Online publishing platform have a problem though - they require certain software to be installed on web servers in order to work. This often means running your own server or paying someone else who will setup the required parts for you.
12 |
13 | After you setup the system, constant updates are required to make sure that any bugs in the software you are running are patched immediately to prevent your site from being hacked. This often means having a recent backup of your database ready at all times.
14 |
15 | ## Can't we simplify?
16 |
17 | Because running websites and managing databases isn't always worth the effort, "Static Content Generators" like [Dr. jekyll](http://jekyllrb.com/) and [Mr. Hyde](http://hyde.github.io/) have begun to gain traction as people pre-build websites and then place the static HTML results onto their server.
18 |
19 | This means the web server doesn't need to be configured with any special software or databases - it simply serves the generated static HTML files.
20 |
21 | However, you still have to install the generator and setup a "build" process of sorts after every article.
22 |
23 | ## Meet Jr.
24 |
25 | `Jr` is a truly *static*, static content generator. All the processing of your files happens on the requesting client's computer as needed. The whole system is written in client-side JavaScript. This means:
26 |
27 | - minimal bandwidth requirements
28 | - better search engine indexing
29 | - awesome screen reader support
30 | - *zero* security vulnerabilities
31 | - and more!
32 |
33 | However, the neatest thing about `Jr` is that you don't have to configure, setup, or install _anything_! Simply download the files, create your articles, and upload everything to your server!
34 |
35 | done.
36 |
37 | ## GIT thee hence
38 |
39 | If you want to be really awesome you can use `Jr` along with the ever useful *version-control* system [git](https://help.github.com/articles/set-up-git). This allows you to keep better track of changes insuring that you can always rollback your text to recover previous versions - very handy if you work with a team!
40 |
41 | ## What About Markup?
42 |
43 | Like most systems, you can compose pages in `Jr` using the text-to-HTML format "[markdown](http://daringfireball.net/projects/markdown/)". You can also use plain HTML if you want.
44 |
45 |
46 | ## Getting Started
47 |
48 | 1. [Download](http://github.com/Xeoncross/Jr) `Jr`
49 | 2. Make your `[article-name].html` files
50 | 3. Paste the following code at the bottom of each page:
51 | <script src="jr.js"></script>
52 |
53 |
54 | Once you have created your pages then simply upload the system to your website and enjoy.
55 |
56 | *P.S. Looking for a static social lifestream application? Checkout [MicroStream](https://github.com/Xeoncross/microstream).*
57 |
58 | 
59 |
60 |
61 |
--------------------------------------------------------------------------------
/editor.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
47 | Create48 |> Prose is architecture, not interior decoration. - Ernest Hemingway 49 | 50 | Facere nisi id cum, eum nemo molestias provident maxime ullam sed autem vitae, culpa nihil eveniet atque doloremque corporis esse quaerat. Eaque nisi ullam blanditiis esse provident repellat ea corporis aliquid molestias, quam nemo maiores obcaecati reiciendis excepturi ducimus laudantium voluptates. Voluptatem eius soluta eum praesentium, mollitia nisi ex cupiditate libero, earum temporibus vitae. 51 | 52 | print "hello"; 53 | var length = ['hi'].length; 54 | 55 | [Google](http://google.com) knows all. 56 | 57 | - List Item 1 58 | - List Item 2 59 | - List Item 3 60 | 61 |62 | 63 | |
64 |
65 |
66 | Preview67 | 68 | (delete all my prose) 69 | |
70 |
2 | 3 |  4 | 5 | # Welcome to Jr! 6 | 7 | A static, static content generator that moves the "generator" part to the browser. 8 | This site is pure text files with a single Javascript included on each page that renders 9 | the theme and assets as needed. 10 | 11 | Go ahead, take a look at the source code for this page. 12 | 13 | You want my page, fine, you render it! 14 | ~ Nginx 15 | 16 | 17 | You see, there is really no need for the server to generate anything for simple 18 | article-based sites like this. If the user wants to read your blog, they can spend 19 | a few processor cycles to render the page themselves. 20 | 21 | [gist:c5d5244d89caa0775d92] 22 | 23 | 24 | -------------------------------------------------------------------------------- /john1.html: -------------------------------------------------------------------------------- 1 | # John Chapter 1 2 | 3 | _Ye 'ol Filler Text_ 4 | 5 | In the beginning was the Word, and the Word was with God, and the Word was God. The same was in the beginning with God. 6 | 7 | All things were made by him; and without him was not any thing made that was made. 8 | 9 | In him was life; and the life was the light of men. And the light shineth in darkness; and the darkness comprehended it not. 10 | 11 | There was a man sent from God, whose name was John. The same came for a witness, to bear witness of the Light, that all men through him might believe. 12 | 13 | He was not that Light, but was sent to bear witness of that Light. That was the true Light, which lighteth every man that cometh into the world. 14 | 15 | He was in the world, and the world was made by him, and the world knew him not. He came unto his own, and his own received him not. But as many as received him, to them gave he power to become the sons of God, even to them that believe on his name: Which were born, not of blood, nor of the will of the flesh, nor of the will of man, but of God. 16 | 17 | And the Word was made flesh, and dwelt among us, (and we beheld his glory, the glory as of the only begotten of the Father,) full of grace and truth. 18 | 19 | John bare witness of him, and cried, saying, This was he of whom I spake, He that cometh after me is preferred before me: for he was before me. And of his fulness have all we received, and grace for grace. 20 | 21 | For the law was given by Moses, but grace and truth came by Jesus Christ. 22 | 23 | No man hath seen God at any time; the only begotten Son, which is in the bosom of the Father, he hath declared him. And this is the record of John, when the Jews sent priests and Levites from Jerusalem to ask him, Who art thou? And he confessed, and denied not; but confessed, I am not the Christ. And they asked him, What then? Art thou Elias? And he saith, I am not. Art thou that prophet? And he answered, No. 24 | 25 | Then said they unto him, Who art thou? that we may give an answer to them that sent us. What sayest thou of thyself? He said, I am the voice of one crying in the wilderness, Make straight the way of the Lord, as said the prophet Esaias. 26 | 27 | And they which were sent were of the Pharisees. And they asked him, and said unto him, Why baptizest thou then, if thou be not that Christ, nor Elias, neither that prophet? 28 | 29 | John answered them, saying, I baptize with water: but there standeth one among you, whom ye know not; He it is, who coming after me is preferred before me, whose shoe's latchet I am not worthy to unloose. These things were done in Bethabara beyond Jordan, where John was baptizing. 30 | 31 | The next day John seeth Jesus coming unto him, and saith, Behold the Lamb of God, which taketh away the sin of the world. This is he of whom I said, After me cometh a man which is preferred before me: for he was before me. And I knew him not: but that he should be made manifest to Israel, therefore am I come baptizing with water. And John bare record, saying, I saw the Spirit descending from heaven like a dove, and it abode upon him. 32 | 33 | And I knew him not: but he that sent me to baptize with water, the same said unto me, Upon whom thou shalt see the Spirit descending, and remaining on him, the same is he which baptizeth with the Holy Ghost. And I saw, and bare record that this is the Son of God. 34 | 35 | Again the next day after John stood, and two of his disciples; And looking upon Jesus as he walked, he saith, Behold the Lamb of God! And the two disciples heard him speak, and they followed Jesus. 36 | 37 | Then Jesus turned, and saw them following, and saith unto them, What seek ye? They said unto him, Rabbi, (which is to say, being interpreted, Master,) where dwellest thou? 38 | 39 | He saith unto them, Come and see. They came and saw where he dwelt, and abode with him that day: for it was about the tenth hour. 40 | 41 | One of the two which heard John speak, and followed him, was Andrew, Simon Peter's brother. He first findeth his own brother Simon, and saith unto him, We have found the Messias, which is, being interpreted, the Christ. 42 | 43 | And he brought him to Jesus. And when Jesus beheld him, he said, Thou art Simon the son of Jona: thou shalt be called Cephas, which is by interpretation, A stone. 44 | 45 | The day following Jesus would go forth into Galilee, and findeth Philip, and saith unto him, Follow me. 46 | 47 | Now Philip was of Bethsaida, the city of Andrew and Peter. Philip findeth Nathanael, and saith unto him, We have found him, of whom Moses in the law, and the prophets, did write, Jesus of Nazareth, the son of Joseph. 48 | 49 | And Nathanael said unto him, Can there any good thing come out of Nazareth? Philip saith unto him, Come and see. 50 | 51 | Jesus saw Nathanael coming to him, and saith of him, Behold an Israelite indeed, in whom is no guile! 52 | 53 | Nathanael saith unto him, Whence knowest thou me? Jesus answered and said unto him, Before that Philip called thee, when thou wast under the fig tree, I saw thee. 54 | 55 | Nathanael answered and saith unto him, Rabbi, thou art the Son of God; thou art the King of Israel. 56 | 57 | Jesus answered and said unto him, Because I said unto thee, I saw thee under the fig tree, believest thou? thou shalt see greater things than these. And he saith unto him, Verily, verily, I say unto you, Hereafter ye shall see heaven open, and the angels of God ascending and descending upon the Son of man. 58 | 59 | [continue to chapter 2](http://1jn2.com/bible/John/2) 60 | 61 | -------------------------------------------------------------------------------- /js/jr.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Master Top Global Root Base Special Parent Object.... thingy 3 | */ 4 | var jr = { 5 | /* 6 | * You can define content blocks to display in your theme 7 | */ 8 | blocks : { 9 | 'footer.html' : 'footer', 10 | //'header.html' : 'header' 11 | }, 12 | styles : [ 13 | // Choose a theme CSS 14 | 'themes/default.css', 15 | //'themes/simple.css', 16 | // Plus the code CSS if you have a programming blog 17 | 'themes/code.css', 18 | ], 19 | scripts : [ 20 | 'js/showdown.js', 21 | 'js/prettify.js' 22 | // if you want jQuery or some other library for a plugin 23 | // '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js' 24 | ], 25 | }; 26 | 27 | 28 | // Plugins are defined below 29 | jr.body = null; 30 | jr.markdownContent = null; 31 | jr.plugins = {} 32 | 33 | /** 34 | * Jr. Plugins go here 35 | */ 36 | jr.plugins.date = function(value) { 37 | try { 38 | var date = new Date(Date.parse(value)); 39 | if(date) { 40 | return date.toLocaleDateString("i"); 41 | } 42 | } catch (e) { 43 | console.log(e); 44 | } 45 | } 46 | 47 | jr.plugins.time = function(value) { 48 | try { 49 | var date = new Date(Date.parse(value)); 50 | if(date) { 51 | return date.toLocaleTimeString("i"); 52 | } 53 | } catch (e) { 54 | console.log(e); 55 | } 56 | } 57 | 58 | jr.plugins.gist = function(gistId, element){ 59 | var callbackName = "gist_callback"; 60 | window[callbackName] = function (gistData) { 61 | 62 | delete window[callbackName]; 63 | var html = ''; 64 | html += gistData.div; 65 | 66 | var gistContainer = document.createElement('div'); 67 | gistContainer.innerHTML = html; 68 | 69 | element.parentNode.replaceChild(gistContainer, element); 70 | }; 71 | 72 | var script = document.createElement("script"); 73 | script.setAttribute("src", "https://gist.github.com/" + gistId + ".json?callback=" + callbackName); 74 | document.body.appendChild(script); 75 | } 76 | 77 | 78 | /** 79 | * CAREFUL WITH THE MAGIC BELOW ↓ 80 | * @todo cleanup 81 | */ 82 | 83 | /** 84 | * Used to replace short codes in articles with strings or DOM elements 85 | */ 86 | jr.traverseChildNodes = function(node) { 87 | var next; 88 | 89 | if (node.nodeType === 1) { 90 | 91 | // (Element node) 92 | if (node = node.firstChild) { 93 | do { 94 | // Recursively call traverseChildNodes on each child node 95 | next = node.nextSibling; 96 | jr.traverseChildNodes(node); 97 | } while(node = next); 98 | } 99 | 100 | } else if (node.nodeType === 3) { 101 | 102 | // (Text node) 103 | node.data.replace(/\[(\w+):([^\]]+)\]/g, function(match, plugin, value) { 104 | 105 | if(jr.plugins[plugin]) { 106 | 107 | if(value = jr.plugins[plugin](value, node)) { 108 | if(typeof value === "string") { 109 | node.data = node.data.replace(match, value); 110 | } else if(typeof value === "Node") { 111 | node.parentNode.insertBefore(value, node); 112 | node.parentNode.removeChild(node); 113 | } 114 | } 115 | } 116 | }); 117 | } 118 | }; 119 | 120 | /* 121 | * The last item we are loading is the showdown.js 122 | * file which contains the Showdown parser. So, 123 | * keep testing for it until it loads! 124 | * 125 | * This isn't quite a good idea... but it works. 126 | */ 127 | jr.fireWhenReady = function() { 128 | var timeout, b=4; 129 | 130 | if (typeof window.Showdown != 'undefined') { 131 | jr.run(jr.markdownContent); 132 | } else { 133 | timeout = setTimeout(jr.fireWhenReady, 100); 134 | } 135 | }; 136 | 137 | // Also: http://stackoverflow.com/a/7719185/99923 138 | jr.loadScript = function(src) { 139 | var s = document.createElement('script'); 140 | s.type = 'text/javascript'; 141 | s.async = true; 142 | s.src = src; 143 | var head = document.getElementsByTagName('head')[0]; 144 | head.appendChild(s); 145 | }; 146 | 147 | jr.loadStyle = function(href, media) { 148 | var s = document.createElement('link'); 149 | s.type = 'text/css'; 150 | s.media = media || 'all'; 151 | s.rel = 'stylesheet'; 152 | s.href = href; 153 | var head = document.getElementsByTagName('head')[0]; 154 | head.appendChild(s); 155 | }; 156 | 157 | jr.loadBlock = function(file, selector) { 158 | ajax(file, function(html) { 159 | if( ! html) { 160 | html = 'error loading ' + file; 161 | } 162 | 163 | if(selector.substring(0,1) == '.') { 164 | // IE 8+ = document.querySelector(selector); 165 | var el = document.getElementsByClassName(selector.substring(1))[0]; 166 | } else { 167 | var el = document.getElementsByTagName(selector)[0]; 168 | } 169 | 170 | var e = document.createElement('div'); 171 | e.innerHTML = html; 172 | while(e.firstChild) { el.appendChild(e.firstChild); } 173 | }); 174 | } 175 | 176 | jr.run = function(markdownContent) { 177 | 178 | // Attach an ID (based on URL) to the body container for CSS reasons 179 | var id = window.location.pathname.replace(/\W+/g, '-').replace(/^\-|\-$/g, ''); 180 | 181 | jr.body.id = id || 'index'; 182 | 183 | var converter = new Showdown.converter({extensions: ['github', 'prettify', 'table'] }); 184 | 185 | // Convert to HTML 186 | var html = converter.makeHtml(markdownContent); 187 | 188 | // Basic HTML5 shell wrapped in a div 189 | jr.body.innerHTML = '\ 190 |'; 196 | 197 | // Find all background images and put them in the right elements 198 | var images = document.getElementsByTagName('main')[0].getElementsByTagName('img'); 199 | 200 | // Put all "background" images in their repective DOM elements 201 | for (var i = images.length - 1; i >= 0; i--) { 202 | 203 | var img = images[i]; 204 | 205 | // BG images have the format "_[elementname]" 206 | if(img.alt.substring(0,1) == '_') { 207 | 208 | // Look for that DOM element 209 | var el = document.getElementsByTagName(img.alt.substring(1))[0]; 210 | if(el) { 211 | 212 | el.style.backgroundImage = 'url(' + img.src + ')'; 213 | el.className += ' background_image'; 214 | 215 | // We don't need this anymore 216 | img.parentNode.removeChild(img); 217 | } 218 | } 219 | } 220 | 221 | // Load content blocks and inject them where needed 222 | for (var file in jr.blocks) { 223 | jr.loadBlock(file, jr.blocks[file]); 224 | } 225 | 226 | // Allow plugins to process shortcode embeds 227 | jr.traverseChildNodes(jr.body); 228 | 229 | // Look for dates in Header elements 230 | for (var x in {'h2':0,'h3':0,'h4':0,'h5':0}) { 231 | var headers = document.getElementsByTagName(x); 232 | for (var i = headers.length - 1; i >= 0; i--) { 233 | if(Date.parse(headers[i].innerHTML.replace(/(th|st|nd|rd)/g, ''))) { 234 | headers[i].className += ' date'; 235 | } 236 | } 237 | } 238 | 239 | // Set the title for browser tabs (not Search Engines) 240 | var el = document.getElementsByTagName('h1'); 241 | if(el.length && el[0]) { 242 | document.title = el[0].innerHTML; 243 | } 244 | 245 | // Highlight any code out there (wait for it to load) 246 | setTimeout(function() { prettyPrint(); }, 500); 247 | }; 248 | 249 | /** 250 | * Tiny AJAX request Object 251 | * @see https://github.com/Xeoncross/kb_javascript_framework/blob/master/kB.js#L30 252 | */ 253 | function ajax(url, callback, data) 254 | { 255 | var x = new(window.ActiveXObject||XMLHttpRequest)('Microsoft.XMLHTTP'); 256 | x.open(data ? 'POST' : 'GET', url, 1); 257 | x.setRequestHeader('X-Requested-With','XMLHttpRequest'); 258 | x.setRequestHeader('Content-type','application/x-www-form-urlencoded'); 259 | x.onreadystatechange = function() { 260 | x.readyState > 3 && callback && callback(x.responseText, x); 261 | }; 262 | x.send(data); 263 | }; 264 | 265 | 266 | /* 267 | * Get this party started! 268 | */ 269 | (function () { 270 | 271 | // Load the article 272 | jr.body = document.getElementsByTagName("body")[0]; 273 | 274 | // Save the markdown for after we load the parser 275 | jr.markdownContent = jr.body.innerHTML; 276 | 277 | // Empty the content in case it takes a while to parse the markdown (leaves a blank screen) 278 | jr.body.innerHTML = ''; 279 | 280 | // Load styles first 281 | for (var i = jr.styles.length - 1; i >= 0; i--) { 282 | jr.loadStyle(jr.styles[i]); 283 | } 284 | 285 | for (var i = jr.scripts.length - 1; i >= 0; i--) { 286 | jr.loadScript(jr.scripts[i]); 287 | } 288 | 289 | jr.fireWhenReady(); 290 | 291 | // If you want to *see* the pritty AJAX-spinner do this instead... 292 | //setTimeout(jr.fireWhenReady, 1000); 293 | 294 | })(); 295 | -------------------------------------------------------------------------------- /js/prettify.js: -------------------------------------------------------------------------------- 1 | !function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= 3 | b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a\ 191 | \ 192 | \ 194 | \ 195 |' + html + ' \ 193 |122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;a h[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f =2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k =5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", 11 | /^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ 12 | s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, 13 | q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= 14 | c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i =0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, 21 | V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]+/],["dec",/^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 22 | /^ ]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^ -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Welcome to Jr! (v1.2) 2 | 3 | A static, static content generator that moves the "generator" part to the browser. 4 | This site is pure text files with a single Javascript included on each page that renders 5 | the theme and assets as needed. 6 | 7 | Each page is written in markdown with a single `