├── .editorconfig ├── .jshintrc ├── LICENSE ├── README.md ├── _footer.html ├── _header.html ├── bower.json ├── package.json ├── scripts ├── hgt.js └── vendor │ ├── infinite.min.js │ ├── jquery.waypoints.min.js │ └── sticky.min.js └── styles ├── hgt-syntax.css └── hgt.css /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | 10 | # Change these settings to your own preference 11 | indent_style = space 12 | indent_size = 2 13 | 14 | # We recommend you to keep these unchanged 15 | end_of_line = lf 16 | charset = utf-8 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "browser": true, 4 | "esnext": true, 5 | "bitwise": true, 6 | "camelcase": true, 7 | "curly": true, 8 | "eqeqeq": true, 9 | "immed": true, 10 | "indent": 2, 11 | "latedef": true, 12 | "newcap": true, 13 | "noarg": true, 14 | "quotmark": "single", 15 | "regexp": true, 16 | "undef": true, 17 | "unused": true, 18 | "strict": true, 19 | "trailing": true, 20 | "smarttabs": true, 21 | "globals": { 22 | "$": false 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Puzzle ITC GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hologram Github Theme 2 | 3 | This is a very simple [Github Styleguide](https://github.com/styleguide) inspired theme for Trulia's [Hologram](https://github.com/trulia/hologram), the ruby front-end doc generator. 4 | 5 | ## Preview 6 | 7 | 8 | 9 | [View example styleguide](http://wearecube.github.io/hologram-github-theme-example/styleguide) ([source code](https://github.com/wearecube/hologram-github-theme-example)) 10 | 11 | ## Usage 12 | 13 | Install Hologram: 14 | 15 | ``` 16 | $ gem install hologram 17 | ``` 18 | 19 | Add this theme to your project using NPM: 20 | 21 | ``` 22 | $ npm install --save-dev hologram-github-theme 23 | ``` 24 | 25 | Alternatively you may use Bower: 26 | 27 | ``` 28 | $ bower install --save-dev hologram-github-theme 29 | ``` 30 | 31 | Define the theme in your `hologram_config.yml`: 32 | 33 | ``` 34 | # Relative path(s) to your source files 35 | source: app/styles 36 | 37 | # Relative path where you want the documentation to be built 38 | destination: styleguide 39 | 40 | # The path that contains supporting assets for the documentation page 41 | documentation_assets: node_modules/hologram-github-theme 42 | 43 | # Category that will be used as the index.html (optional) 44 | index: styleguide 45 | 46 | # A list of relative paths to folders containing any dependencies to copy 47 | dependencies: 48 | - 'dist' 49 | 50 | # The CSS files to be included in the styleguide 51 | css_include: 52 | - 'dist/styles/vendor.css' 53 | - 'dist/styles/main.css' 54 | 55 | # The JavaScript files to included in the styleguide 56 | js_include: 57 | - 'dist/scripts/main.js' 58 | 59 | # The global title that is displayed at the top of the pages 60 | global_title: Styleguide 61 | 62 | ``` 63 | 64 | In this example the markdown file `app/styles/styleguide.md` is used for the content on the index page. Also, if you're using Bower, adjust the package path accordingly: ```documentation_assets: bower_components/hologram-github-theme```. 65 | 66 | For more details on the options, checkout the [Hologram documentation](https://github.com/trulia/hologram/blob/master/README.md#creating-a-yaml-config-file) 67 | 68 | Finally, build the styleguide: 69 | 70 | ``` 71 | hologram -c hologram_config.yml 72 | ``` 73 | 74 | ## Authors 75 | 76 | The Hologram Github Theme has been created by [Mathis Hofer](https://github.com/hupf). Many thanks to [Maurice Kühlborn](https://github.com/minimalweb) and [Oscar](https://github.com/obartra) for their contributions. 77 | 78 | ## License 79 | 80 | The Hologram Github Theme is licensed under the [MIT License](LICENSE) 81 | -------------------------------------------------------------------------------- /_footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <% if @config['js_include'].to_s.strip.length != 0 %> 17 | <% @config['js_include'].each do |js| %> 18 | 19 | <% end %> 20 | <% end %> 21 | 22 | <% if @config['components_include'].to_s.strip.length != 0 %> 23 | <% @config['components_include'].each do |component| %> 24 | 25 | <% end %> 26 | <% end %> 27 | 28 | 29 | -------------------------------------------------------------------------------- /_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%= title %> <% if title != '' %>–<% end %> <%= @config['global_title'] %> 7 | 8 | 9 | 10 | 11 | 12 | 13 | <% if @config['css_include'].to_s.strip.length != 0 %> 14 | <% @config['css_include'].each do |css| %> 15 | 16 | <% end %> 17 | <% end %> 18 | 19 | 20 | 21 |
22 |
23 | 36 | 37 |

<%= @config['global_title'] %>

38 |
39 |
40 | 41 |
42 |
43 | <% unless @blocks.length == 0 %> 44 |
45 | 52 |
53 | <% end %> 54 | 55 |
56 |
57 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hologram-github-theme", 3 | "version": "0.1.4", 4 | "authors": [ 5 | "Mathis Hofer " 6 | ], 7 | "description": "A Github Styleguide inspired theme for Hologram", 8 | "keywords": [ 9 | "hologram", 10 | "theme", 11 | "github", 12 | "styleguide" 13 | ], 14 | "license": "MIT", 15 | "homepage": "https://github.com/wearecube/hologram-github-theme", 16 | "ignore": [ 17 | "**/.*", 18 | "node_modules", 19 | "bower_components", 20 | "test", 21 | "tests", 22 | "example.png" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hologram-github-theme", 3 | "version": "0.1.4", 4 | "description": "A Github Styleguide inspired theme for Hologram", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/wearecube/hologram-github-theme.git" 11 | }, 12 | "keywords": [ 13 | "hologram", 14 | "styleguide", 15 | "theme" 16 | ], 17 | "author": "Mathis Hofer ", 18 | "license": "MIT", 19 | "bugs": { 20 | "url": "https://github.com/wearecube/hologram-github-theme/issues" 21 | }, 22 | "homepage": "https://github.com/wearecube/hologram-github-theme#readme" 23 | } 24 | -------------------------------------------------------------------------------- /scripts/hgt.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Author: Mathis Hofer 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2015 Puzzle ITC GmbH 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in 16 | * all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | * THE SOFTWARE. 25 | */ 26 | 27 | (function (window, document, $, Waypoint) { 28 | 'use strict'; 29 | 30 | $(document).ready(function () { 31 | // Menu should be always visible when scrolling 32 | var $hgtMenu = $('.hgt-menu'); 33 | if ($hgtMenu.length){ 34 | new Waypoint.Sticky({ 35 | element: $hgtMenu[0], 36 | stuckClass: 'hgt-sticky', 37 | wrapper: '
', 38 | offset: 5 39 | }); 40 | } 41 | 42 | function selectMenuItem(hash) { 43 | $('.hgt-menu-item').removeClass('selected'); 44 | $('.hgt-menu-item[href="' + hash + '"]').addClass('selected'); 45 | } 46 | 47 | // Update selected menu item on scrolling 48 | $('.hgt-content > h1').waypoint({ 49 | handler: function() { 50 | selectMenuItem('#' + $(this.element).attr('id')); 51 | } 52 | }); 53 | 54 | // Smoothly scroll to clicked menu item content 55 | $('.hgt-menu-item').on('click', function (event) { 56 | var hash = $(this).attr('href'), 57 | pos = Math.min($(hash).offset().top, $(document).height() - $(window).height()); 58 | 59 | event.preventDefault(); 60 | 61 | $('html,body').stop().animate({scrollTop : pos}, 200, function (){ 62 | window.location.hash = hash; 63 | selectMenuItem(hash); 64 | }); 65 | }); 66 | 67 | // Initially select menu item 68 | if (window.location.hash) { 69 | setTimeout(function () { 70 | selectMenuItem(window.location.hash); 71 | }, 0); 72 | } else { 73 | $('.hgt-menu-item:first-child').addClass('selected'); 74 | } 75 | }); 76 | })(window, window.document, jQuery, Waypoint); 77 | -------------------------------------------------------------------------------- /scripts/vendor/infinite.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Waypoints Infinite Scroll Shortcut - 3.0.0 3 | Copyright © 2011-2014 Caleb Troughton 4 | Licensed under the MIT license. 5 | https://github.com/imakewebthings/waypoints/blog/master/licenses.txt 6 | */ 7 | !function(){"use strict";function t(n){this.options=i.extend({},t.defaults,n),this.container=this.options.element,"auto"!==this.options.container&&(this.container=this.options.container),this.$container=i(this.container),this.$more=i(this.options.more),this.$more.length&&(this.setupHandler(),this.waypoint=new o(this.options))}var i=window.jQuery,o=window.Waypoint;t.prototype.setupHandler=function(){this.options.handler=i.proxy(function(){window.setTimeout(i.proxy(function(){this.options.onBeforePageLoad(),this.destroy(),this.$container.addClass(this.options.loadingClass),i.get(i(this.options.more).attr("href"),i.proxy(function(t){var n=i(i.parseHTML(t)),e=n.find(this.options.more);this.$container.append(n.find(this.options.items)),this.$container.removeClass(this.options.loadingClass),e.length||(e=n.filter(this.options.more)),e.length?(this.$more.replaceWith(e),this.$more=e,this.waypoint=new o(this.options)):this.$more.remove(),this.options.onAfterPageLoad()},this),0)},this))},this)},t.prototype.destroy=function(){this.waypoint&&this.waypoint.destroy()},t.defaults={container:"auto",items:".infinite-item",more:".infinite-more-link",offset:"bottom-in-view",loadingClass:"infinite-loading",onBeforePageLoad:i.noop,onAfterPageLoad:i.noop},o.Infinite=t}(); -------------------------------------------------------------------------------- /scripts/vendor/jquery.waypoints.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Waypoints - 3.0.0 3 | Copyright © 2011-2014 Caleb Troughton 4 | Licensed under the MIT license. 5 | https://github.com/imakewebthings/waypoints/blog/master/licenses.txt 6 | */ 7 | !function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.destroyAll=function(){var t=[];for(var e in i)t.push(i[e]);for(var o=0,r=t.length;r>o;o++)t[o].destroy()},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=r.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},r=window.Waypoint,n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t,s=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||r.isTouch)&&(e.didScroll=!0,n(t))})},e.prototype.handleResize=function(){r.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],r=o.newScroll>o.oldScroll,n=r?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(n),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element===this.element.window?r.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element===this.element.window?r.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,r=t.length;r>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element===this.element.window,i=this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var n=t[r];for(var s in this.waypoints[r]){var a,l,h,p,u,c=this.waypoints[r][s],d=c.options.offset,f=c.triggerPoint,w=0,y=null==f;c.element!==c.element.window&&(w=c.adapter.offset()[n.offsetProp]),"function"==typeof d?d=d.apply(c):"string"==typeof d&&(d=parseFloat(d),c.options.offset.indexOf("%")>-1&&(d=Math.ceil(n.contextDimension*d/100))),a=n.contextScroll-n.contextOffset,c.triggerPoint=w+a-d,l=f=n.oldScroll,p=l&&h,u=!l&&!h,!y&&p?(c.queueTrigger(n.backward),o[c.group.id]=c.group):!y&&u?(c.queueTrigger(n.forward),o[c.group.id]=c.group):y&&n.oldScroll>=c.triggerPoint&&(c.queueTrigger(n.forward),o[c.group.id]=c.group)}}for(var g in o)o[g].flushTriggers();return this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){s&&s(),e.refreshAll()},r.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},r=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],r="up"===i||"left"===i;o.sort(r?e:t);for(var n=0,s=o.length;s>n;n+=1){var a=o[n];(a.options.continuous||n===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=r.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=r.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=r.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},r.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var r=t.extend({},o,{element:this});"string"==typeof r.context&&(r.context=t(this).closest(r.context)[0]),i.push(new e(r))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); -------------------------------------------------------------------------------- /scripts/vendor/sticky.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Waypoints Sticky Element Shortcut - 3.0.0 3 | Copyright © 2011-2014 Caleb Troughton 4 | Licensed under the MIT license. 5 | https://github.com/imakewebthings/waypoints/blog/master/licenses.txt 6 | */ 7 | !function(){"use strict";function t(s){this.options=e.extend({},i.defaults,t.defaults,s),this.element=this.options.element,this.$element=e(this.element),this.createWrapper(),this.createWaypoint()}var e=window.jQuery,i=window.Waypoint;t.prototype.createWaypoint=function(){var t=this.options.handler;this.waypoint=new i(e.extend({},this.options,{element:this.wrapper,handler:e.proxy(function(e){var i=this.options.direction.indexOf(e)>-1,s=i?this.$element.outerHeight(!0):"";this.$wrapper.height(s),this.$element.toggleClass(this.options.stuckClass,i),t&&t.call(this,e)},this)}))},t.prototype.createWrapper=function(){this.$element.wrap(this.options.wrapper),this.$wrapper=this.$element.parent(),this.wrapper=this.$wrapper[0]},t.prototype.destroy=function(){this.$element.parent()[0]===this.wrapper&&(this.waypoint.destroy(),this.$element.removeClass(this.options.stuckClass).unwrap())},t.defaults={wrapper:'
',stuckClass:"stuck",direction:"down right"},i.Sticky=t}(); -------------------------------------------------------------------------------- /styles/hgt-syntax.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013 Trulia, Inc. 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | */ 25 | 26 | hll { background-color: #ffffcc } 27 | .c { color: #999988; font-style: italic } /* Comment */ 28 | .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 29 | .k { color: #000000; font-weight: bold } /* Keyword */ 30 | .o { color: #000000; font-weight: bold } /* Operator */ 31 | .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 32 | .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */ 33 | .c1 { color: #999988; font-style: italic } /* Comment.Single */ 34 | .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 35 | .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 36 | .ge { color: #000000; font-style: italic } /* Generic.Emph */ 37 | .gr { color: #aa0000 } /* Generic.Error */ 38 | .gh { color: #999999 } /* Generic.Heading */ 39 | .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 40 | .go { color: #888888 } /* Generic.Output */ 41 | .gp { color: #555555 } /* Generic.Prompt */ 42 | .gs { font-weight: bold } /* Generic.Strong */ 43 | .gu { color: #aaaaaa } /* Generic.Subheading */ 44 | .gt { color: #aa0000 } /* Generic.Traceback */ 45 | .kc { color: #000000; font-weight: bold } /* Keyword.Constant */ 46 | .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */ 47 | .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */ 48 | .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */ 49 | .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */ 50 | .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 51 | .m { color: #009999 } /* Literal.Number */ 52 | .s { color: #d01040 } /* Literal.String */ 53 | .na { color: #008080 } /* Name.Attribute */ 54 | .nb { color: #0086B3 } /* Name.Builtin */ 55 | .nc { color: #445588; font-weight: bold } /* Name.Class */ 56 | .no { color: #008080 } /* Name.Constant */ 57 | .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */ 58 | .ni { color: #800080 } /* Name.Entity */ 59 | .ne { color: #990000; font-weight: bold } /* Name.Exception */ 60 | .nf { color: #990000; font-weight: bold } /* Name.Function */ 61 | .nl { color: #990000; font-weight: bold } /* Name.Label */ 62 | .nn { color: #555555 } /* Name.Namespace */ 63 | .nt { color: #000080 } /* Name.Tag */ 64 | .nv { color: #008080 } /* Name.Variable */ 65 | .ow { color: #000000; font-weight: bold } /* Operator.Word */ 66 | .w { color: #bbbbbb } /* Text.Whitespace */ 67 | .mf { color: #009999 } /* Literal.Number.Float */ 68 | .mh { color: #009999 } /* Literal.Number.Hex */ 69 | .mi { color: #009999 } /* Literal.Number.Integer */ 70 | .mo { color: #009999 } /* Literal.Number.Oct */ 71 | .sb { color: #d01040 } /* Literal.String.Backtick */ 72 | .sc { color: #d01040 } /* Literal.String.Char */ 73 | .sd { color: #d01040 } /* Literal.String.Doc */ 74 | .s2 { color: #d01040 } /* Literal.String.Double */ 75 | .se { color: #d01040 } /* Literal.String.Escape */ 76 | .sh { color: #d01040 } /* Literal.String.Heredoc */ 77 | .si { color: #d01040 } /* Literal.String.Interpol */ 78 | .sx { color: #d01040 } /* Literal.String.Other */ 79 | .sr { color: #009926 } /* Literal.String.Regex */ 80 | .s1 { color: #d01040 } /* Literal.String.Single */ 81 | .ss { color: #990073 } /* Literal.String.Symbol */ 82 | .bp { color: #999999 } /* Name.Builtin.Pseudo */ 83 | .vc { color: #008080 } /* Name.Variable.Class */ 84 | .vg { color: #008080 } /* Name.Variable.Global */ 85 | .vi { color: #008080 } /* Name.Variable.Instance */ 86 | .il { color: #009999 } /* Literal.Number.Integer.Long */ 87 | -------------------------------------------------------------------------------- /styles/hgt.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Author: Mathis Hofer 3 | * 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2015 Puzzle ITC GmbH 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in 16 | * all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | * THE SOFTWARE. 25 | */ 26 | 27 | .hgt-body { 28 | background: #fff; 29 | } 30 | 31 | .hgt-pagehead, 32 | .hgt-menu, 33 | .hgt-content .styleguide, 34 | .hgt-footer { 35 | font-size: 13px; 36 | line-height: 1.4; 37 | } 38 | 39 | .hgt-pagehead, 40 | .hgt-menu, 41 | .hgt-content .styleguide, 42 | .hgt-content > h1, 43 | .hgt-content > h2, 44 | .hgt-content > h3, 45 | .hgt-content > h4, 46 | .hgt-content > h5, 47 | .hgt-content > h6, 48 | .hgt-footer { 49 | font-family: Helvetica,arial,freesans,clean,sans-serif; 50 | color: #333; 51 | } 52 | 53 | .hgt-pagehead-nav a, 54 | .hgt-content .styleguide a, 55 | .hgt-footer a { 56 | color: #4183C4; 57 | text-decoration: none; 58 | } 59 | 60 | .hgt-content .styleguide a:hover, 61 | .hgt-footer a:hover { 62 | text-decoration: underline; 63 | } 64 | 65 | .hgt-container { 66 | box-sizing: border-box; 67 | width: 980px; 68 | margin-right: auto; 69 | margin-left: auto; 70 | } 71 | 72 | .hgt-columns { 73 | box-sizing: border-box; 74 | margin-right: -10px; 75 | margin-left: -10px; 76 | } 77 | 78 | .hgt-columns:after { 79 | display: table; 80 | clear: both; 81 | content: ""; 82 | } 83 | 84 | .hgt-columns:before { 85 | display: table; 86 | content: ""; 87 | } 88 | 89 | .hgt-column { 90 | box-sizing: border-box; 91 | display: block; 92 | float: left; 93 | width: 100%; 94 | padding-right: 10px; 95 | padding-left: 10px; 96 | } 97 | 98 | .hgt-column.one-fourth { 99 | width: 25%; 100 | } 101 | 102 | .hgt-column.three-fourths { 103 | width: 75%; 104 | } 105 | 106 | .hgt-pagehead { 107 | box-sizing: border-box; 108 | position: relative; 109 | margin-bottom: 20px; 110 | padding-top: 20px; 111 | padding-bottom: 20px; 112 | border-bottom: 1px solid #EEE; 113 | } 114 | 115 | .hgt-pagehead-title { 116 | box-sizing: border-box; 117 | margin-top: 0; 118 | margin-bottom: 0; 119 | font-size: 20px; 120 | font-weight: normal; 121 | line-height: 28px; 122 | } 123 | 124 | .hgt-pagehead-nav { 125 | box-sizing: border-box; 126 | display: block; 127 | float: right; 128 | margin-bottom: -20px; 129 | } 130 | 131 | .hgt-pagehead-nav-item { 132 | box-sizing: border-box; 133 | float: left; 134 | padding: 6px 10px 21px; 135 | margin-left: 20px; 136 | font-size: 14px; 137 | color: #777; 138 | } 139 | 140 | .hgt-pagehead-nav-item { 141 | text-decoration: none; 142 | } 143 | 144 | .hgt-pagehead-nav-item:hover { 145 | color: #333; 146 | text-decoration: none; 147 | } 148 | 149 | .hgt-pagehead-nav-item.selected { 150 | color: #333; 151 | border-bottom: 2px solid #D26911; 152 | } 153 | 154 | .hgt-menu { 155 | display: block; 156 | list-style: outside none none; 157 | margin-bottom: 15px; 158 | list-style: outside none none; 159 | background-color: #FFF; 160 | border: 1px solid #D8D8D8; 161 | border-radius: 3px; 162 | } 163 | 164 | .hgt-menu-item { 165 | position: relative; 166 | display: block; 167 | padding: 8px 10px; 168 | color: #4078C0; 169 | text-shadow: 0 1px 0 #FFF; 170 | border-bottom: 1px solid #EEE; 171 | text-decoration: none; 172 | } 173 | 174 | .hgt-menu-item:hover { 175 | text-decoration: none; 176 | background-color: #F9F9F9; 177 | } 178 | 179 | .hgt-menu-item.selected { 180 | font-weight: bold; 181 | color: #222; 182 | cursor: default; 183 | background-color: #FFF; 184 | } 185 | 186 | .hgt-menu-item.selected:before { 187 | position: absolute; 188 | top: 0; 189 | left: 0; 190 | bottom: 0; 191 | width: 2px; 192 | content: ""; 193 | background-color: #D26911; 194 | } 195 | 196 | .hgt-menu-item:first-child:before { 197 | border-top-left-radius: 2px; 198 | } 199 | 200 | .hgt-sticky { 201 | position: fixed; 202 | } 203 | 204 | .hgt-menu.hgt-sticky { 205 | top: 5px; 206 | width: 228px; 207 | } 208 | 209 | .hgt-content .styleguide { 210 | font-family: "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif; 211 | font-size: 16px; 212 | line-height: 1.6; 213 | word-wrap: break-word; 214 | } 215 | 216 | .hgt-content h1.styleguide, 217 | .hgt-content h2.styleguide, 218 | .hgt-content h3.styleguide, 219 | .hgt-content h4.styleguide, 220 | .hgt-content h5.styleguide, 221 | .hgt-content h6.styleguide, 222 | .hgt-content > h1, 223 | .hgt-content > h2, 224 | .hgt-content > h3, 225 | .hgt-content > h4, 226 | .hgt-content > h5, 227 | .hgt-content > h6 { 228 | box-sizing: border-box; 229 | position: relative; 230 | margin-top: 1em; 231 | margin-bottom: 16px; 232 | font-weight: bold; 233 | line-height: 1.4; 234 | } 235 | 236 | .hgt-content h1.styleguide { 237 | padding-bottom: 0.3em; 238 | font-size: 2.25em; 239 | line-height: 1.2; 240 | border-bottom: 1px solid #EEE; 241 | } 242 | 243 | .hgt-content h2.styleguide { 244 | padding-bottom: 0.3em; 245 | font-size: 1.75em; 246 | line-height: 1.225; 247 | border-bottom: 1px solid #EEE; 248 | } 249 | 250 | .hgt-content h3.styleguide { 251 | font-size: 1.5em; 252 | line-height: 1.43; 253 | } 254 | 255 | .hgt-content h4.styleguide { 256 | font-size: 1.25em; 257 | } 258 | 259 | .hgt-content h5.styleguide { 260 | font-size: 1em; 261 | } 262 | 263 | .hgt-content h6.styleguide { 264 | font-size: 1em; 265 | color: #777; 266 | } 267 | 268 | .hgt-content p.styleguide, 269 | .hgt-content blockquote.styleguide, 270 | .hgt-content dl.styleguide, 271 | .hgt-content table.styleguide, 272 | .hgt-content pre.styleguide { 273 | box-sizing: border-box; 274 | margin: 0 0 16px; 275 | } 276 | 277 | .hgt-content ul.styleguide { 278 | list-style: disc; 279 | box-sizing: border-box; 280 | margin: 0 0 16px; 281 | padding-left: 1em; 282 | } 283 | 284 | .hgt-content ol.styleguide { 285 | list-style: decimal; 286 | box-sizing: border-box; 287 | margin: 0 0 16px; 288 | padding-left: 1em; 289 | } 290 | 291 | .hgt-content code.styleguide, 292 | .hgt-content tt.styleguide { 293 | box-sizing: border-box; 294 | padding: 0.2em 0; 295 | margin: 0 3px 0 0; 296 | font-size: 13.6px; /* 85% of 16px */ 297 | font-family: Consolas,"Liberation Mono",Menlo,Courier,monospace; 298 | background-color: rgba(0, 0, 0, 0.04); 299 | border-radius: 3px; 300 | } 301 | 302 | .hgt-content code.styleguide:before, 303 | .hgt-content code.styleguide:after, 304 | .hgt-content tt.styleguide:before, 305 | .hgt-content tt.styleguide:after { 306 | letter-spacing: -0.2em; 307 | content: " "; 308 | } 309 | 310 | .hgt-content .codeBlock pre { 311 | margin-top: 0; 312 | margin-bottom: 0; 313 | font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace; 314 | } 315 | 316 | .hgt-content .codeBlock .highlight pre, 317 | .hgt-content .codeBlock pre { 318 | padding: 16px; 319 | overflow: auto; 320 | font-size: 13.6px; /* 85% of 16px */ 321 | line-height: 1.45; 322 | background-color: #F7F7F7; 323 | border-radius: 3px; 324 | } 325 | 326 | .hgt-content .codeBlock pre { 327 | word-wrap: normal; 328 | } 329 | 330 | .hgt-content > :first-child { 331 | margin-top: 0 !important; 332 | } 333 | 334 | .hgt-content .codeExample, 335 | .hgt-content .jsExample { 336 | border: 1px solid #EEE; 337 | border-radius: 4px; 338 | margin: 10px 0; 339 | } 340 | 341 | .hgt-content .jsExample { 342 | border-top: 0; 343 | } 344 | 345 | .hgt-content .codeExample:before, 346 | .hgt-content .jsExample:before { 347 | font-family: "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif; 348 | color: #222; 349 | border: 1px solid #EEE; 350 | border-radius: 4px; 351 | border-bottom-left-radius: 0; 352 | border-top-right-radius: 0; 353 | position: relative; 354 | padding: 2px; 355 | display: block; 356 | } 357 | 358 | /* .hgt-content .codeExample:before { */ 359 | /* content: "Example"; */ 360 | /* background-color: #f9f9f9; */ 361 | /* width: 50px; */ 362 | /* top: -1px; */ 363 | /* left: -1px; */ 364 | /* font-size: 12px; */ 365 | /* } */ 366 | /* .hgt-content .jsExample:before { */ 367 | /* content: "JS Example"; */ 368 | /* background-color: #f9f9f9; */ 369 | /* width: 65px; */ 370 | /* top: -11px; */ 371 | /* left: -11px; */ 372 | /* font-size: 12px; */ 373 | /* } */ 374 | 375 | .hgt-content .exampleOutput { 376 | padding: 16px; 377 | } 378 | 379 | .hgt-content .codeBlock { 380 | border-top-left-radius: 0; 381 | border-top-right-radius: 0; 382 | border-top: 1px solid #EEE; 383 | } 384 | 385 | .hgt-content table .codeBlock { 386 | background-color: transparent; 387 | border-top: none; 388 | border-radius: 0; 389 | } 390 | 391 | .hgt-footer { 392 | box-sizing: border-box; 393 | position: relative; 394 | margin-top: 40px; 395 | padding-top: 40px; 396 | padding-bottom: 40px; 397 | font-size: 12px; 398 | line-height: 1.5; 399 | color: #777; 400 | border-top: 1px solid #EEE; 401 | } 402 | 403 | .hgt-footer:after { 404 | display: table; 405 | clear: both; 406 | content: ""; 407 | } 408 | 409 | .hgt-footer:before { 410 | display: table; 411 | content: ""; 412 | } 413 | --------------------------------------------------------------------------------