├── .bowerrc ├── .gitignore ├── .travis.yml ├── test ├── index.html ├── stylesheet-attribute-test.html ├── gistid-attribute-startup-test.html └── gistid-attribute-change-test.html ├── bower.json ├── index.html ├── themes └── monokai.css ├── LICENSE ├── README.md └── github-gist.html /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | bower_components 3 | wct.conf.json 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: stable 3 | before_script: 4 | - npm install -g bower web-component-tester 5 | - bower install 6 | - "export DISPLAY=:99.0" 7 | - "sh -e /etc/init.d/xvfb start" 8 | - sleep 3 # give xvfb some time to start 9 | script: 10 | - wct 11 | notifications: 12 | email: maslov.dmitrij@gmail.com 13 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Tests 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "github-gist", 3 | "version": "1.2.6", 4 | "authors": [ 5 | "Dmitry Maslov " 6 | ], 7 | "description": "A web component to display github gists", 8 | "main": "github-gist.html", 9 | "keywords": [ 10 | "web-components", 11 | "polymer", 12 | "github", 13 | "gist" 14 | ], 15 | "license": "MIT", 16 | "homepage": "https://github.com/dmaslov/github-gist", 17 | "ignore": [ 18 | "**/.*", 19 | "node_modules", 20 | "bower_components", 21 | "wct.conf.js", 22 | ".travis.yml" 23 | ], 24 | "dependencies": { 25 | "polymer": "Polymer/polymer#1.6.1" 26 | }, 27 | "devDependencies": { 28 | "web-component-tester": "Polymer/web-component-tester#4.3.1" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <github-gist> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /themes/monokai.css: -------------------------------------------------------------------------------- 1 | .gist .gist-file{border-color: #fff;} 2 | .gist .blob-code-inner{color: #f8f8f2;} 3 | .gist .blob-num{ 4 | color: #999; 5 | border: solid #999; 6 | border-width: 0 1px 0 0; 7 | } 8 | .gist .blob-wrapper{ 9 | border-bottom-right-radius: 0; 10 | border-bottom-left-radius: 0; 11 | } 12 | .gist .blob-num:hover{color: #f8f8f2;} 13 | .gist .highlight{background: #272822;} 14 | .gist .gist-meta{background: #272822;} 15 | .gist .gist-data{border-bottom: 1px solid #999;} 16 | .gist .blob-num{border-color: #999;} 17 | .gist .pl-k{color: #f92672;} 18 | .gist .pl-e{color: #f8f8f2;} 19 | .gist .pl-pds, .gist .pl-s .pl-pse .pl-s1, .gist .pl-sr, .gist .pl-sr .pl-cce, .gist .pl-sr .pl-sre, .gist .pl-sr .pl-sra{color: #E6DB74;} 20 | .gist .pl-s .pl-s1{color: #f8f8f2;} 21 | .gist .pl-smi{color: #f8f8f2;} 22 | .gist .pl-s{color: #e6db74;} 23 | .gist .pl-en{color: #A6E22E;} 24 | .gist .gist-meta, .gist .gist-meta a{color: #999;} 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Dmitry Maslov 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 all 13 | 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 THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /test/stylesheet-attribute-test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /test/gistid-attribute-startup-test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /test/gistid-attribute-change-test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # <github-gist> [![Build Status](https://travis-ci.org/dmaslov/github-gist.svg?branch=master)](https://travis-ci.org/dmaslov/github-gist) 2 | 3 | A [Polymer](http://polymer-project.org) element for displaying github [gists](https://gist.github.com) 4 | 5 | ## Demo 6 | 7 | > [Check it live](http://dmaslov.github.io/github-gist). 8 | 9 | ## Installation 10 | 11 | Install using [Bower](http://bower.io): 12 | 13 | ```shell 14 | bower install github-gist 15 | ``` 16 | 17 | ## Usage 18 | 19 | * Import Polyfill Web Components support for older browsers: 20 | 21 | ``` 22 | 23 | ``` 24 | 25 | * Import Custom Element: 26 | 27 | ``` 28 | 29 | ``` 30 | 31 | * Start using it! 32 | 33 | ``` 34 | 35 | ``` 36 | 37 | * You can use your own stylesheets 38 | 39 | ![monokai.css](http://i.imgur.com/abADNVW.png) 40 | 41 | Provide path to your external css file to `stylesheet` attribute 42 | 43 | ``` 44 | 45 | ``` 46 | 47 | We added example stylesheet `monokai.css` by [@hofiorg](https://github.com/hofiorg) in `themes` folder. 48 | 49 | ##### Feel free to populate our stylesheet library! 50 | 51 | ## Options 52 | 53 | Attribute | Options | Default | Description 54 | --- | --- | --- | --- 55 | `gistid` | *string* | `` | id of gist that will be loaded 56 | `stylesheet` | *string* | `` | path to css file 57 | 58 | 59 | ## Examples: 60 | 61 | ``` 62 | 63 | ``` 64 | 65 | ## Tests 66 | 67 | ```shell 68 | npm install -g web-component-tester 69 | wct 70 | ``` 71 | ## License 72 | 73 | [MIT License](http://opensource.org/licenses/MIT) 74 | -------------------------------------------------------------------------------- /github-gist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 122 | --------------------------------------------------------------------------------