├── public ├── imgs │ ├── alipay.png │ ├── favicon.ico │ ├── gogs-lg.png │ ├── macaron.png │ ├── brands │ │ ├── igt.png │ │ ├── notabug.png │ │ ├── prosnav.jpg │ │ ├── xizhe.png │ │ ├── yeeuu.png │ │ ├── cnssuestc.jpg │ │ ├── gxbolian.jpg │ │ └── tripleback.png │ └── screenshoots │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── 7.png │ │ ├── 8.png │ │ └── 9.png ├── scss │ ├── main.scss │ ├── _markdown.scss │ ├── _home.scss │ ├── _common.scss │ └── _unsemantic.scss ├── css │ ├── prettify.css │ └── main.css └── js │ ├── gogsweb.js │ ├── prettify.js │ └── gogsweb.min.js ├── .gitignore ├── .bra.toml ├── .gopmfile ├── conf ├── app.ini └── locale │ ├── locale_zh-CN.ini │ ├── locale_en-US.ini │ ├── locale_ru-RU.ini │ └── locale_fr-FR.ini ├── README.md ├── templates ├── page.tmpl ├── macaron │ ├── head.tmpl │ ├── navbar.tmpl │ └── footer.tmpl ├── gogs │ ├── head.tmpl │ ├── footer.tmpl │ └── navbar.tmpl ├── base │ ├── disqus.tmpl │ └── docs.tmpl ├── document_gogs.tmpl ├── document_macaron.tmpl └── home_gogs.tmpl ├── routers ├── macaron.go └── gogs.go ├── modules ├── base │ └── template.go ├── setting │ └── setting.go └── log │ └── log.go ├── models ├── http.go ├── press.go └── models.go ├── gogsweb.go └── LICENSE /public/imgs/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/alipay.png -------------------------------------------------------------------------------- /public/imgs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/favicon.ico -------------------------------------------------------------------------------- /public/imgs/gogs-lg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/gogs-lg.png -------------------------------------------------------------------------------- /public/imgs/macaron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/macaron.png -------------------------------------------------------------------------------- /public/imgs/brands/igt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/brands/igt.png -------------------------------------------------------------------------------- /public/imgs/brands/notabug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/brands/notabug.png -------------------------------------------------------------------------------- /public/imgs/brands/prosnav.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/brands/prosnav.jpg -------------------------------------------------------------------------------- /public/imgs/brands/xizhe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/brands/xizhe.png -------------------------------------------------------------------------------- /public/imgs/brands/yeeuu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/brands/yeeuu.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/1.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/2.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/3.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/4.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/5.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/6.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/7.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/8.png -------------------------------------------------------------------------------- /public/imgs/screenshoots/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/screenshoots/9.png -------------------------------------------------------------------------------- /public/imgs/brands/cnssuestc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/brands/cnssuestc.jpg -------------------------------------------------------------------------------- /public/imgs/brands/gxbolian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/brands/gxbolian.jpg -------------------------------------------------------------------------------- /public/imgs/brands/tripleback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gogs/gogsweb/HEAD/public/imgs/brands/tripleback.png -------------------------------------------------------------------------------- /public/scss/main.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | Copyright © Gogs 2014, all right reversed. 3 | */ 4 | @import "unsemantic"; 5 | @import "common"; 6 | @import "home"; 7 | @import "markdown"; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | gogsweb 3 | *.exe 4 | *.exe~ 5 | config.codekit 6 | conf/docTree.json 7 | docs/ 8 | .idea/ 9 | .sass-cache 10 | conf/custom.ini 11 | gogsweb.sublime-project 12 | gogsweb.sublime-workspace -------------------------------------------------------------------------------- /.bra.toml: -------------------------------------------------------------------------------- 1 | [run] 2 | init_cmds = [["./gogsweb"]] 3 | watch_all = true 4 | watch_dirs = [ 5 | "$WORKDIR/conf", 6 | "$WORKDIR/models", 7 | "$WORKDIR/modules", 8 | "$WORKDIR/routers" 9 | ] 10 | watch_exts = [".go", ".ini"] 11 | build_delay = 1500 12 | cmds = [ 13 | ["go", "install"], 14 | ["go", "build"], 15 | ["./gogsweb"] 16 | ] -------------------------------------------------------------------------------- /.gopmfile: -------------------------------------------------------------------------------- 1 | [target] 2 | path = github.com/gogits/gogsweb 3 | 4 | [deps] 5 | github.com/Unknwon/com = 6 | github.com/Unknwon/goconfig = 7 | github.com/Unknwon/macaron = 8 | github.com/macaron-contrib/i18n = 9 | github.com/robfig/cron = 10 | github.com/slene/blackfriday = 11 | 12 | [res] 13 | include = templates|public|conf 14 | 15 | -------------------------------------------------------------------------------- /conf/app.ini: -------------------------------------------------------------------------------- 1 | apps = gogs,macaron 2 | 3 | [app] 4 | run_mode = dev 5 | http_port = 8091 6 | https = false 7 | https_cert = 8 | https_key = 9 | 10 | [i18n] 11 | langs = en-US,zh-CN,fr-FR 12 | names = English,简体中文,Français 13 | 14 | [github] 15 | client_id = 16 | client_secret = 17 | 18 | [gogs] 19 | repo_name = gogits/docs 20 | 21 | [macaron] 22 | repo_name = macaron-contrib/docs 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Gogs Web 2 | ======== 3 | 4 | An open source project for official documentation website of [Gogs](http://gogs.io) and [Macaron](http://macaron.gogs.io). 5 | 6 | ## Introduction 7 | 8 | As a study example of [Macaron](http://macaron.gogs.io) framework, this project has following features to show you: 9 | 10 | - Multiple sites in one program. 11 | - TODO 12 | 13 | ## Configuration 14 | 15 | TODO 16 | 17 | ## License 18 | 19 | Gogs Web is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text. -------------------------------------------------------------------------------- /templates/page.tmpl: -------------------------------------------------------------------------------- 1 | {{template "gogs/head" .}} 2 | {{template "gogs/navbar" .}} 3 |
4 |
5 |
6 |
7 |
8 | {{.Data|str2html}} 9 |
10 |
11 | 14 | {{template "base/disqus" .}} 15 |
16 |
17 |
18 | {{template "gogs/footer" .}} -------------------------------------------------------------------------------- /public/css/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /templates/macaron/head.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Macaron - {{.i18n.Tr "macaron_desc"}} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /templates/gogs/head.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gogs: Go Git Service - {{.i18n.Tr "gogs_desc"}} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /templates/base/disqus.tmpl: -------------------------------------------------------------------------------- 1 |
2 | 13 | 14 | comments powered by Disqus -------------------------------------------------------------------------------- /templates/gogs/footer.tmpl: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /templates/base/docs.tmpl: -------------------------------------------------------------------------------- 1 | {{with .Doc}} 2 | {{range .Docs}} 3 | 21 | {{end}} 22 | {{end}} -------------------------------------------------------------------------------- /routers/macaron.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package routers 16 | 17 | import ( 18 | "github.com/Unknwon/macaron" 19 | "github.com/macaron-contrib/i18n" 20 | ) 21 | 22 | func MacaronDocs(ctx *macaron.Context, locale i18n.Locale) { 23 | docs(ctx, locale, "macaron") 24 | } 25 | 26 | func MacaronStatic(ctx *macaron.Context) { 27 | docsStatic(ctx, "macaron") 28 | } 29 | -------------------------------------------------------------------------------- /templates/macaron/navbar.tmpl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/gogs/navbar.tmpl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/document_gogs.tmpl: -------------------------------------------------------------------------------- 1 | {{template "gogs/head" .}} 2 | {{template "gogs/navbar" .}} 3 |
4 |
5 |
6 | 7 | 15 |
16 |
17 |
18 |
19 | {{.Data|str2html}} 20 |
21 |
22 | 25 | {{template "base/disqus" .}} 26 |
27 |
28 |
29 | {{template "gogs/footer" .}} -------------------------------------------------------------------------------- /templates/macaron/footer.tmpl: -------------------------------------------------------------------------------- 1 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /templates/document_macaron.tmpl: -------------------------------------------------------------------------------- 1 | {{template "macaron/head" .}} 2 | {{template "macaron/navbar" .}} 3 |
4 |
5 |
6 | 7 | 15 |
16 |
17 |
18 |
19 | {{.Data|str2html}} 20 |
21 |
22 | 25 | {{template "base/disqus" .}} 26 |
27 |
28 |
29 | {{template "macaron/footer" .}} -------------------------------------------------------------------------------- /conf/locale/locale_zh-CN.ini: -------------------------------------------------------------------------------- 1 | gogs_desc = 极易搭建的自助 Git 服务 2 | macaron_desc = 高生产力和模块化设计的 Go Web 框架 3 | 4 | menu = 菜单 5 | home = 首页 6 | download = 下载安装 7 | docs = 使用手册 8 | blog = 官方博客 9 | 10 | try_demo = 在线体验 11 | screenshots = 界面预览 12 | scroll = 滑动 13 | get_started = 开始使用 14 | who_are_use = 使用 Gogs 的团队及公司 15 | 16 | about = 关于我们 17 | team = 开发团队 18 | donate = 捐赠我们 19 | 20 | easy_install = 易安装 21 | easy_install_desc = 您除了可以根据操作系统平台通过 二进制运行,还可以通过 DockerVagrant,以及 包管理 安装。 22 | cross_platform = 跨平台 23 | cross_platform_desc = 任何 Go 语言 支持的平台都可以运行 Gogs,包括 Windows、Mac、Linux 以及 ARM。 24 | lightweight = 轻量级 25 | lightweight_desc = 一个廉价的树莓派的配置足以满足 Gogs 的最低系统硬件要求。 26 | opensource = 开源化 27 | opensource_desc = 所有的代码都开源在 GitHub 上,赶快加入我们来共同发展这个伟大的项目! 28 | 29 | faq = 常见问题 30 | known_issues = 已知问题 31 | troubleshooting = 故障排查 32 | cheat_sheet = 配置文件手册 33 | release_notes = 公告与高阶指南 34 | subscribe_news = 订阅新闻邮件 -------------------------------------------------------------------------------- /modules/base/template.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Unknown 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package base 16 | 17 | import ( 18 | "errors" 19 | "html/template" 20 | ) 21 | 22 | func Dict(values ...interface{}) (map[string]interface{}, error) { 23 | if len(values)%2 != 0 { 24 | return nil, errors.New("invalid dict call") 25 | } 26 | dict := make(map[string]interface{}, len(values)/2) 27 | for i := 0; i < len(values); i += 2 { 28 | key, ok := values[i].(string) 29 | if !ok { 30 | return nil, errors.New("dict keys must be strings") 31 | } 32 | dict[key] = values[i+1] 33 | } 34 | return dict, nil 35 | } 36 | 37 | func Str2html(raw string) template.HTML { 38 | return template.HTML(raw) 39 | } 40 | -------------------------------------------------------------------------------- /conf/locale/locale_en-US.ini: -------------------------------------------------------------------------------- 1 | gogs_desc = A painless self-hosted Git service 2 | macaron_desc = High productive and modular design web framework in Go 3 | 4 | menu = Menu 5 | home = Home 6 | download = Download 7 | docs = Documentation 8 | blog = Blog 9 | 10 | try_demo = Try a Demo 11 | screenshots = Screenshots 12 | scroll = Scroll 13 | get_started = Getting Started 14 | who_are_use = Who Is Using Gogs 15 | 16 | about = About 17 | team = Team 18 | donate = Donate 19 | 20 | easy_install = Easy to install 21 | easy_install_desc = Simply run the binary for your platform. Or ship Gogs with Docker or Vagrant, or get it packaged. 22 | cross_platform = Cross-platform 23 | cross_platform_desc = Gogs runs anywhere Go can compile for: Windows, Mac, Linux, ARM, etc. 24 | lightweight = Lightweight 25 | lightweight_desc = Gogs has low minimal requirements and can run on an inexpensive Raspberry Pi. 26 | opensource = Open Source 27 | opensource_desc = It's all on GitHub! Join us by contributing to make this project even better. 28 | 29 | faq = FAQs 30 | known_issues = Known issues 31 | troubleshooting = Troubleshooting 32 | cheat_sheet = Configuration Cheat Sheet 33 | release_notes = Release notes and tips 34 | subscribe_news = Subscribe Newsletter -------------------------------------------------------------------------------- /conf/locale/locale_ru-RU.ini: -------------------------------------------------------------------------------- 1 | gogs_desc = Хранилище Git-репозиториев, написанное на Go 2 | macaron_desc = Высокопроизводительный модульный веб-фреймворк на Go 3 | 4 | menu = Меню 5 | home = Главная 6 | download = Скачать 7 | docs = Документация 8 | blog = Блог 9 | 10 | try_demo = Попробовать 11 | screenshots = Скриншоты 12 | scroll = Прокрутка 13 | get_started = С чего начать 14 | who_are_use = Кто использует Gogs 15 | 16 | about = О проекте 17 | team = Команда 18 | donate = Поддержать 19 | 20 | easy_install = Простой в установке 21 | easy_install_desc = Просто запустите файл для вашей платформы. Или воспользуйтесь Docker или Vagrant. Или просто установите пакет для вашей системы. 22 | cross_platform = Кросс-платформенный 23 | cross_platform_desc = Gogs работает везде, где работает Go: Windows, Mac, Linux, ARM, и т.д. 24 | lightweight = Легкий 25 | lightweight_desc = Минимальные системные требования позволяют запустить Gogs даже на Raspberry Pi. 26 | opensource = Открытый 27 | opensource_desc = Весь код на GitHub! Присоединяйтесь к развитию проекта. 28 | 29 | faq = FAQ 30 | known_issues = Известные проблемы 31 | troubleshooting = Решение проблем 32 | cheat_sheet = Шпаргалка по настройке 33 | release_notes = Замечания к релизу и советы -------------------------------------------------------------------------------- /conf/locale/locale_fr-FR.ini: -------------------------------------------------------------------------------- 1 | gogs_desc = Un service git auto-hébergé sans-douleur 2 | macaron_desc = Productions élevé et conception modulaire framework web écrit en Go 3 | 4 | menu = Menu 5 | home = Accueil 6 | download = Téléchargement 7 | docs = Documentation 8 | blog = Blog 9 | 10 | try_demo = Essayer la démo 11 | screenshots = Captures d'écran 12 | scroll = Faites défiler 13 | get_started = Prise en main 14 | who_are_use = Qui utilise Gogs 15 | 16 | about = A propos 17 | team = L'équipe 18 | donate = Donner 19 | 20 | easy_install = Facile à installer 21 | easy_install_desc = Simplement en exécutant le binaire sur votre plate-forme. Ou exécuter Gogs avec Docker ou Vagrant, ou l'obtenir par packaged. 22 | cross_platform = Multi-platforme 23 | cross_platform_desc = Gogs fonctionne partout où Go peut compiler : Windows, Mac, Linux, ARM, etc. 24 | lightweight = Léger 25 | lightweight_desc = Gogs a des exigences minimales faibles et peut fonctionner sur un Raspberry Pi peu coûteux. 26 | opensource = Libre de droit 27 | opensource_desc = Il est disponible sur GitHub ! Rejoignez-nous en contribuant à ce projet pour qu'il soit meilleur. 28 | 29 | faq = FAQs 30 | known_issues = Problèmes connus 31 | troubleshooting = Guide de dépannage 32 | cheat_sheet = Fiche de configuration de triche 33 | release_notes = Notes de publication et conseils 34 | -------------------------------------------------------------------------------- /models/http.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package models 16 | 17 | import ( 18 | "flag" 19 | "net" 20 | "net/http" 21 | "time" 22 | 23 | "github.com/gogits/gogsweb/modules/log" 24 | ) 25 | 26 | var ( 27 | dialTimeout = flag.Duration("dial_timeout", 10*time.Second, "Timeout for dialing an HTTP connection.") 28 | requestTimeout = flag.Duration("request_timeout", 20*time.Second, "Time out for roundtripping an HTTP request.") 29 | ) 30 | 31 | func timeoutDial(network, addr string) (net.Conn, error) { 32 | return net.DialTimeout(network, addr, *dialTimeout) 33 | } 34 | 35 | type transport struct { 36 | t http.Transport 37 | } 38 | 39 | func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) { 40 | timer := time.AfterFunc(*requestTimeout, func() { 41 | t.t.CancelRequest(req) 42 | log.Error("Canceled request for %s", req.URL) 43 | }) 44 | defer timer.Stop() 45 | resp, err := t.t.RoundTrip(req) 46 | return resp, err 47 | } 48 | 49 | var ( 50 | httpTransport = &transport{t: http.Transport{Dial: timeoutDial, ResponseHeaderTimeout: *requestTimeout / 2}} 51 | httpClient = &http.Client{Transport: httpTransport} 52 | ) 53 | -------------------------------------------------------------------------------- /public/js/gogsweb.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | // Small devices menu. 3 | $('#menu-link').click(function () { 4 | $('#wide-nav').slideToggle('fast'); 5 | }); 6 | 7 | $('main').click(function () { 8 | if ($('#menu-link').is(':visible')) { 9 | $('#wide-nav').slideUp('fast'); 10 | } 11 | }); 12 | 13 | // Language option button. 14 | $('#lang').on('change', function () { 15 | document.location.href = this.options[this.selectedIndex].value; 16 | }); 17 | 18 | // Render code blocks. 19 | $('.markdown').find('pre > code').parent().addClass('prettyprint'); 20 | prettyPrint(); 21 | 22 | // Encode url. 23 | var $doc = $('.docs-markdown'); 24 | $doc.find('a').each(function () { 25 | var node = $(this); 26 | var link = node.attr('href'); 27 | var index = link.indexOf('#'); 28 | if (link.indexOf('http') === 0 && link.indexOf(window.location.hostname) === -1) { 29 | return; 30 | } 31 | if (index < 0 || index + 1 > link.length) { 32 | return; 33 | } 34 | var val = link.substring(index + 1, link.length); 35 | val = encodeURIComponent(decodeURIComponent(val).toLowerCase().replace(/\s+/g, '-')); 36 | node.attr('href', link.substring(0, index) + '#' + val); 37 | }); 38 | 39 | // Set anchor. 40 | $doc.find('h1, h2, h3, h4, h5, h6').each(function () { 41 | var node = $(this); 42 | if (node.hasClass('ui')) { 43 | return; 44 | } 45 | var val = encodeURIComponent(node.text().toLowerCase().replace(/\s+/g, "-")); 46 | node = node.wrap('
'); 47 | node.append(''); 48 | }); 49 | }); -------------------------------------------------------------------------------- /modules/setting/setting.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package setting 16 | 17 | import ( 18 | "fmt" 19 | 20 | "github.com/Unknwon/com" 21 | "github.com/Unknwon/macaron" 22 | "gopkg.in/ini.v1" 23 | ) 24 | 25 | const ( 26 | CFG_PATH = "conf/app.ini" 27 | CFG_CUSTOM_PATH = "conf/custom.ini" 28 | ) 29 | 30 | type App struct { 31 | Name string 32 | RepoName string 33 | } 34 | 35 | var ( 36 | Cfg *ini.File 37 | 38 | Apps []App 39 | HttpPort int 40 | Https bool 41 | HttpsCert string 42 | HttpsKey string 43 | Langs, Names []string 44 | GithubCred string 45 | ) 46 | 47 | func setGithubCredentials(id, secret string) { 48 | GithubCred = "client_id=" + id + "&client_secret=" + secret 49 | } 50 | 51 | func init() { 52 | var err error 53 | Cfg, err = ini.Load(CFG_PATH) 54 | if err != nil { 55 | panic(fmt.Errorf("fail to load config file '%s': %v", CFG_PATH, err)) 56 | } 57 | if com.IsFile(CFG_CUSTOM_PATH) { 58 | if err = Cfg.Append(CFG_CUSTOM_PATH); err != nil { 59 | panic(fmt.Errorf("fail to load config file '%s': %v", CFG_CUSTOM_PATH, err)) 60 | } 61 | } 62 | 63 | appNames := Cfg.Section("").Key("apps").Strings(",") 64 | Apps = make([]App, len(appNames)) 65 | for i, name := range appNames { 66 | Apps[i] = App{name, Cfg.Section(name).Key("repo_name").String()} 67 | } 68 | 69 | sec := Cfg.Section("app") 70 | if sec.Key("run_mode").MustString("dev") == "prod" { 71 | macaron.Env = macaron.PROD 72 | } 73 | HttpPort = sec.Key("http_port").MustInt(8091) 74 | Https = sec.Key("https").MustBool() 75 | HttpsCert = sec.Key("https_cert").String() 76 | HttpsKey = sec.Key("https_key").String() 77 | 78 | Langs = Cfg.Section("i18n").Key("langs").Strings(",") 79 | Names = Cfg.Section("i18n").Key("names").Strings(",") 80 | 81 | setGithubCredentials(Cfg.Section("github").Key("client_id").String(), Cfg.Section("github").Key("client_secret").String()) 82 | } 83 | -------------------------------------------------------------------------------- /public/scss/_markdown.scss: -------------------------------------------------------------------------------- 1 | .markdown { 2 | font-size: 15px; 3 | font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; 4 | pre { 5 | margin-bottom: 1em; 6 | background-color: #F8F8F8; 7 | border: 0px; 8 | font-size: 13px; 9 | line-height: 19px; 10 | overflow: auto; 11 | padding: 8px 12px; 12 | border-radius: 3px; 13 | code { 14 | margin: 0px; 15 | padding: 0px; 16 | background-color: transparent; 17 | border: medium none; 18 | word-wrap: normal; 19 | max-width: initial; 20 | display: inline; 21 | overflow: initial; 22 | line-height: inherit; 23 | } 24 | } 25 | h1 { 26 | font-size: 60px; 27 | } 28 | h2 { 29 | font-size: 40px; 30 | margin: 10px 0 25px 0; 31 | border-bottom: 1px solid #EEE; 32 | } 33 | h3 { 34 | font-size: 30px; 35 | margin: 15px 0px; 36 | } 37 | h4 { 38 | font-size: 20px; 39 | margin: 10px 0px; 40 | } 41 | a { 42 | color: #4183C4; 43 | } 44 | table { 45 | border-collapse: collapse; 46 | border-spacing: 0px; 47 | display: block; 48 | overflow: auto; 49 | width: 100%; 50 | margin: 0px 0px 9px; 51 | tr { 52 | background-color: #FFF; 53 | border: 1px solid #CCC; 54 | } 55 | td { 56 | border: 1px solid #DDD; 57 | padding: 6px 13px; 58 | } 59 | } 60 | p img { 61 | max-width: 99%; 62 | height: auto; 63 | margin: 0 auto; 64 | display: block; 65 | } 66 | blockquote { 67 | border-left: 4px solid #ddd; 68 | margin-bottom: 16px; 69 | p { 70 | font-size: 14px; 71 | padding: 5px 15px; 72 | color: #777; 73 | } 74 | } 75 | } 76 | 77 | .docs-markdown { 78 | .anchor-wrap { 79 | margin-top: -50px; 80 | padding-top: 50px; 81 | } 82 | 83 | h1 a.anchor, 84 | h2 a.anchor, 85 | h3 a.anchor, 86 | h4 a.anchor, 87 | h5 a.anchor, 88 | h6 a.anchor { 89 | text-decoration:none; 90 | line-height:1; 91 | padding-left:0; 92 | margin-left:5px; 93 | top:15%; 94 | } 95 | 96 | a span.octicon { 97 | font-size: 16px; 98 | font-family: "FontAwesome"; 99 | line-height: 1; 100 | display: inline-block; 101 | text-decoration: none; 102 | -webkit-font-smoothing: antialiased; 103 | } 104 | 105 | a span.octicon-link { 106 | display: none; 107 | color: #000; 108 | } 109 | 110 | a span.octicon-link:before { 111 | content: "\f0c1"; 112 | } 113 | 114 | h1:hover .octicon-link, 115 | h2:hover .octicon-link, 116 | h3:hover .octicon-link, 117 | h4:hover .octicon-link, 118 | h5:hover .octicon-link, 119 | h6:hover .octicon-link { 120 | display:inline-block 121 | } 122 | } -------------------------------------------------------------------------------- /modules/log/log.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Unknown 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package log 16 | 17 | import ( 18 | "fmt" 19 | "os" 20 | "time" 21 | ) 22 | 23 | const ( 24 | PREFIX = "[Gogs Web]" 25 | TIME_FORMAT = "06-01-02 15:04:05" 26 | ) 27 | 28 | var ( 29 | LEVEL_FLAGS = [...]string{"DEBUG", " INFO", " WARN", "ERROR", "FATAL"} 30 | ) 31 | 32 | const ( 33 | DEBUG = iota 34 | INFO 35 | WARNING 36 | ERROR 37 | FATAL 38 | ) 39 | 40 | func Print(level int, format string, args ...interface{}) { 41 | switch level { 42 | case DEBUG: 43 | fmt.Printf("%s \033[36m%s\033[0m [\033[34m%s\033[0m] %s\n", 44 | PREFIX, time.Now().Format(TIME_FORMAT), LEVEL_FLAGS[level], 45 | fmt.Sprintf(format, args...)) 46 | case INFO: 47 | fmt.Printf("%s \033[36m%s\033[0m [\033[32m%s\033[0m] %s\n", 48 | PREFIX, time.Now().Format(TIME_FORMAT), LEVEL_FLAGS[level], 49 | fmt.Sprintf(format, args...)) 50 | case WARNING: 51 | fmt.Printf("%s \033[36m%s\033[0m [\033[33m%s\033[0m] %s\n", 52 | PREFIX, time.Now().Format(TIME_FORMAT), LEVEL_FLAGS[level], 53 | fmt.Sprintf(format, args...)) 54 | case ERROR: 55 | fmt.Printf("%s \033[36m%s\033[0m [\033[31m%s\033[0m] %s\n", 56 | PREFIX, time.Now().Format(TIME_FORMAT), LEVEL_FLAGS[level], 57 | fmt.Sprintf(format, args...)) 58 | case FATAL: 59 | fmt.Printf("%s \033[36m%s\033[0m [\033[35m%s\033[0m] %s\n", 60 | PREFIX, time.Now().Format(TIME_FORMAT), LEVEL_FLAGS[level], 61 | fmt.Sprintf(format, args...)) 62 | os.Exit(1) 63 | default: 64 | fmt.Printf("%s %s %s %s\n", 65 | PREFIX, time.Now().Format(TIME_FORMAT), LEVEL_FLAGS[level], 66 | fmt.Sprintf(format, args...)) 67 | } 68 | } 69 | 70 | func Debug(format string, args ...interface{}) { 71 | Print(DEBUG, format, args...) 72 | } 73 | 74 | func Warn(format string, args ...interface{}) { 75 | Print(WARNING, format, args...) 76 | } 77 | 78 | func Info(format string, args ...interface{}) { 79 | Print(INFO, format, args...) 80 | } 81 | 82 | func Error(format string, args ...interface{}) { 83 | Print(ERROR, format, args...) 84 | } 85 | 86 | func Fatal(format string, args ...interface{}) { 87 | Print(FATAL, format, args...) 88 | } 89 | -------------------------------------------------------------------------------- /routers/gogs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package routers 16 | 17 | import ( 18 | "io" 19 | "os" 20 | "path" 21 | "strings" 22 | 23 | "github.com/Unknwon/macaron" 24 | "github.com/macaron-contrib/i18n" 25 | 26 | "github.com/gogits/gogsweb/models" 27 | ) 28 | 29 | func GogsHome(ctx *macaron.Context) { 30 | ctx.Data["IsPageHome"] = true 31 | ctx.HTML(200, "home_gogs", ctx.Data) 32 | } 33 | 34 | func Donate(ctx *macaron.Context, locale i18n.Locale) { 35 | ctx.Data["Link"] = "/donate" 36 | df := models.GetDoc("gogs", "donate", locale.Lang) 37 | ctx.Data["Data"] = string(df.Data) 38 | ctx.HTML(200, "page", ctx.Data) 39 | } 40 | 41 | func docs(ctx *macaron.Context, locale i18n.Locale, name string) { 42 | docRoot := models.GetDocByLocale(name, locale.Lang) 43 | if docRoot == nil { 44 | docRoot = models.GetDocByLocale(name, "en-US") 45 | } 46 | 47 | link := strings.TrimPrefix(ctx.Params("*"), "/") 48 | link = strings.TrimSuffix(link, ".html") 49 | link = strings.TrimSuffix(link, ".md") 50 | ctx.Data["Link"] = "/docs/" + link 51 | 52 | var doc *models.DocNode 53 | if len(link) == 0 { 54 | ctx.Redirect("/docs/intro/") 55 | return 56 | } 57 | 58 | doc, _ = docRoot.GetNodeByLink(link) 59 | if doc == nil { 60 | doc, _ = docRoot.GetNodeByLink(link + "/") 61 | } 62 | if doc == nil { 63 | ctx.Error(404) 64 | return 65 | } 66 | 67 | ctx.Data["DocRoot"] = docRoot 68 | ctx.Data["Doc"] = doc 69 | ctx.Data["Title"] = doc.Name 70 | ctx.Data["Data"] = doc.GetContent() 71 | ctx.HTML(200, "document_"+name, ctx.Data) 72 | } 73 | 74 | func GogsDocs(ctx *macaron.Context, locale i18n.Locale) { 75 | docs(ctx, locale, "gogs") 76 | } 77 | 78 | func docsStatic(ctx *macaron.Context, name string) { 79 | if len(ctx.Params(":all")) > 0 { 80 | f, err := os.Open(path.Join("docs", name, "images", ctx.Params(":all"))) 81 | if err != nil { 82 | ctx.JSON(500, map[string]interface{}{ 83 | "error": err.Error(), 84 | }) 85 | return 86 | } 87 | defer f.Close() 88 | 89 | _, err = io.Copy(ctx.RW(), f) 90 | if err != nil { 91 | ctx.JSON(500, map[string]interface{}{ 92 | "error": err.Error(), 93 | }) 94 | return 95 | } 96 | return 97 | } 98 | ctx.Error(404) 99 | } 100 | 101 | func GogsStatic(ctx *macaron.Context) { 102 | docsStatic(ctx, "gogs") 103 | } 104 | -------------------------------------------------------------------------------- /public/scss/_home.scss: -------------------------------------------------------------------------------- 1 | body { 2 | background: #FFF; 3 | } 4 | #logo { 5 | display: none 6 | } 7 | nav { 8 | text-align: center; 9 | } 10 | h1 { 11 | font-size: 98px; 12 | } 13 | h2 { 14 | font-size: 56px; 15 | } 16 | #home-link { 17 | display: none; 18 | } 19 | #home-logo { 20 | max-width: 250px; 21 | margin-top: 30px; 22 | margin-right: 50px; 23 | float: left; 24 | } 25 | #promo-area { 26 | padding-bottom: 50px; 27 | padding-top: 0; 28 | } 29 | #promo-area h1, 30 | #promo-area h2 { 31 | text-shadow: 0 2px 1px rgba(0, 0, 0, .5); 32 | } 33 | #promo-area { 34 | background: #428BCA; 35 | color: #FFF; 36 | } 37 | #promo-container { 38 | margin-left: 300px; 39 | } 40 | .points { 41 | color: #666; 42 | } 43 | .points b { 44 | color: #000; 45 | font-size: 20px; 46 | display: inline-block; 47 | } 48 | .points .fa { 49 | color: #D9453D; 50 | /*#2585D1;*/ 51 | font-size: 52px; 52 | margin-right: 10px; 53 | vertical-align: middle; 54 | } 55 | .carousel { 56 | position: relative; 57 | background: #E0E0E0; 58 | max-height: 400px; 59 | width: 100%; 60 | white-space: nowrap; 61 | padding: 0; 62 | } 63 | .carousel .images { 64 | overflow-x: auto; 65 | width: 100%; 66 | text-align: center; 67 | } 68 | .carousel img { 69 | max-height: 400px; 70 | margin-right: 5px; 71 | z-index: 1; 72 | } 73 | .carousel .fader { 74 | height: 100%; 75 | background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); 76 | background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1))); 77 | background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); 78 | background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); 79 | background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); 80 | background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); 81 | filter: "progid: DXImageTransform.Microsoft.gradient(startColorstr='#001e5799', endColorstr='#e0e0e0', GradientType=1)"; 82 | width: 10%; 83 | z-index: 2; 84 | position: absolute; 85 | right: 0; 86 | top: 0; 87 | } 88 | .ribbon { 89 | background: #FFFDE0; 90 | border-top: 1px solid #FDF48B; 91 | border-bottom: 1px solid #FDF48B; 92 | margin-top: 20px; 93 | } 94 | #clientele { 95 | img { 96 | max-height: 50px; 97 | background: #FFF; 98 | padding: 10px; 99 | border: 1px solid #CCC; 100 | border-radius: 5px; 101 | } 102 | a:hover { 103 | text-decoration: none; 104 | img { 105 | border-color: #428BCA; 106 | } 107 | } 108 | } 109 | @media (max-width: 860px) { 110 | #home-logo { 111 | margin-top: 75px; 112 | max-width: 200px; 113 | } 114 | #promo-container { 115 | margin-left: 250px; 116 | } 117 | } 118 | @media (max-width: 767px) { 119 | .grid-33:not(:first-child).points { 120 | margin-top: 50px; 121 | } 122 | .carousel { 123 | max-height: 300px; 124 | } 125 | } 126 | @media(max-width: 640px) { 127 | #promo-area { 128 | text-align: center; 129 | } 130 | #home-logo { 131 | float: none; 132 | margin: 0 auto; 133 | display: block; 134 | } 135 | #promo-container { 136 | margin-left: 0; 137 | } 138 | } 139 | .nav-macaron { 140 | background: #191A1B; 141 | a { 142 | color: #FFFFFF; 143 | &:hover { 144 | color: #B6D1DD; 145 | } 146 | } 147 | } -------------------------------------------------------------------------------- /gogsweb.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | // An open source project for official documentation website of Gogs. 16 | package main 17 | 18 | import ( 19 | "fmt" 20 | "html/template" 21 | "net/http" 22 | "strings" 23 | 24 | "github.com/Unknwon/macaron" 25 | "github.com/macaron-contrib/i18n" 26 | "github.com/macaron-contrib/switcher" 27 | 28 | "github.com/gogits/gogsweb/models" 29 | "github.com/gogits/gogsweb/modules/base" 30 | "github.com/gogits/gogsweb/modules/log" 31 | "github.com/gogits/gogsweb/modules/setting" 32 | "github.com/gogits/gogsweb/routers" 33 | ) 34 | 35 | const APP_VER = "0.3.2.0808" 36 | 37 | var funcMap = map[string]interface{}{ 38 | "dict": base.Dict, 39 | "str2html": base.Str2html, 40 | } 41 | 42 | func newGogsInstance() *macaron.Macaron { 43 | m := macaron.Classic() 44 | 45 | // Middlewares. 46 | m.Use(macaron.Renderer(macaron.RenderOptions{ 47 | Funcs: []template.FuncMap{funcMap}, 48 | })) 49 | m.Use(i18n.I18n(i18n.Options{ 50 | Langs: setting.Langs, 51 | Names: setting.Names, 52 | Redirect: true, 53 | })) 54 | 55 | // Routers. 56 | m.Get("/", routers.GogsHome) 57 | m.Get("/docs", routers.GogsDocs) 58 | m.Get("/docs/images/:all", routers.GogsStatic) 59 | m.Get("/docs/*", routers.GogsDocs) 60 | m.Get("/donate", routers.Donate) 61 | 62 | return m 63 | } 64 | 65 | func newMacaronInstance() *macaron.Macaron { 66 | m := macaron.Classic() 67 | 68 | // Middlewares. 69 | m.Use(macaron.Renderer(macaron.RenderOptions{ 70 | Funcs: []template.FuncMap{funcMap}, 71 | })) 72 | m.Use(i18n.I18n(i18n.Options{ 73 | Langs: setting.Langs, 74 | Names: setting.Names, 75 | Redirect: true, 76 | })) 77 | 78 | // Routers. 79 | m.Get("/", routers.MacaronDocs) 80 | m.Get("/docs", routers.MacaronDocs) 81 | m.Get("/docs/images/:all", routers.MacaronStatic) 82 | m.Get("/docs/*", routers.MacaronDocs) 83 | 84 | return m 85 | } 86 | 87 | func main() { 88 | log.Info("Gogs Web %s", APP_VER) 89 | log.Info("Run Mode: %s", strings.Title(macaron.Env)) 90 | 91 | models.InitModels() 92 | 93 | m1 := newGogsInstance() 94 | m2 := newMacaronInstance() 95 | hs := switcher.NewHostSwitcher() 96 | hs.Set("gogs.io", m1) 97 | hs.Set("macaron.gogs.io", m2) 98 | 99 | var err error 100 | 101 | // In dev mode, listen two ports just for convenience. 102 | if macaron.Env == macaron.DEV { 103 | // Gogs. 104 | listenAddr := fmt.Sprintf("0.0.0.0:%d", setting.HttpPort) 105 | log.Info("Listen: http://%s", listenAddr) 106 | go http.ListenAndServe(listenAddr, m1) 107 | 108 | // Macaron. 109 | listenAddr = fmt.Sprintf("0.0.0.0:%d", setting.HttpPort+1) 110 | log.Info("Listen: http://%s", listenAddr) 111 | err = http.ListenAndServe(listenAddr, m2) 112 | } else { 113 | schema := "http" 114 | if setting.Https { 115 | schema = "https" 116 | } 117 | listenAddr := fmt.Sprintf("0.0.0.0:%d", setting.HttpPort) 118 | log.Info("Listen: %v://%s", schema, listenAddr) 119 | if setting.Https { 120 | err = http.ListenAndServeTLS(listenAddr, setting.HttpsCert, setting.HttpsKey, hs) 121 | } else { 122 | err = http.ListenAndServe(listenAddr, hs) 123 | } 124 | } 125 | if err != nil { 126 | log.Fatal("Fail to start server: %v", err) 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /templates/home_gogs.tmpl: -------------------------------------------------------------------------------- 1 | {{template "gogs/head" .}} 2 | {{template "gogs/navbar" .}} 3 |
4 |
5 |
6 |
7 | 8 |
9 |

Gogs

10 |

{{.i18n.Tr "gogs_desc"}}

11 |   {{.i18n.Tr "download"}} 12 | {{.i18n.Tr "try_demo"}} » 13 | 14 |

15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 | 24 |
25 |
26 |
27 | 28 | {{.i18n.Tr "easy_install"}} 29 |

{{.i18n.Tr "easy_install_desc" | str2html}}

30 |
31 |
32 | 33 | {{.i18n.Tr "cross_platform"}} 34 |

{{.i18n.Tr "cross_platform_desc" | str2html}}

35 |
36 |
37 | 38 | {{.i18n.Tr "lightweight"}} 39 |

{{.i18n.Tr "lightweight_desc" | str2html}}

40 |
41 |
42 | 43 | {{.i18n.Tr "opensource"}} 44 |

{{.i18n.Tr "opensource_desc" | str2html}}

45 |
46 |
47 |
48 | 49 |

50 | {{.i18n.Tr "screenshots"}} 51 |

52 |
53 | 54 | {{.i18n.Tr "scroll"}} 55 | 56 |
57 | 58 | 72 | 73 |
74 |

{{.i18n.Tr "get_started"}}

75 | 76 | 93 |
94 | 95 |
96 |

{{.i18n.Tr "who_are_use"}}

97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 |
123 | 124 | 129 |
130 |
131 | {{template "gogs/footer" .}} -------------------------------------------------------------------------------- /models/press.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Beego Web Authors 2 | // Copyright 2014 Unknwon 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 5 | // not use this file except in compliance with the License. You may obtain 6 | // a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | // License for the specific language governing permissions and limitations 14 | // under the License. 15 | 16 | package models 17 | 18 | import ( 19 | "bufio" 20 | "bytes" 21 | "fmt" 22 | "io" 23 | "io/ioutil" 24 | "os" 25 | "path/filepath" 26 | "sort" 27 | "strconv" 28 | "strings" 29 | "time" 30 | 31 | "github.com/Unknwon/com" 32 | ) 33 | 34 | type DocList []*DocNode 35 | 36 | func (s DocList) Len() int { return len(s) } 37 | func (s DocList) Swap(i, j int) { s[i], s[j] = s[j], s[i] } 38 | func (s DocList) Less(i, j int) bool { return s[i].Sort < s[j].Sort } 39 | 40 | type DocNode struct { 41 | root bool 42 | IsDir bool 43 | Path string 44 | RelPath string 45 | FileRelPath string 46 | FilePath string 47 | Date time.Time 48 | Name string 49 | Sort int 50 | Link string 51 | Docs DocList 52 | dirs map[string]*DocNode 53 | Root *DocRoot 54 | Parent *DocNode 55 | } 56 | 57 | func (d *DocNode) SortDocs() { 58 | sort.Sort(d.Docs) 59 | } 60 | 61 | func (d *DocNode) HasContent() bool { 62 | return len(d.FilePath) > 0 63 | } 64 | 65 | func (d *DocNode) GetContent() string { 66 | if !d.HasContent() { 67 | return "" 68 | } 69 | 70 | body, err := ioutil.ReadFile(d.FilePath) 71 | if err != nil { 72 | return "" 73 | } 74 | 75 | if i := bytes.Index(body, []byte("---")); i != -1 { 76 | body = body[i+3:] 77 | if i = bytes.Index(body, []byte("---")); i != -1 { 78 | body = body[i+3:] 79 | i = 0 80 | m := 0 81 | mFor: 82 | for { 83 | if len(body) > 0 { 84 | if body[0] == ' ' || body[0] == '\n' { 85 | if body[0] == '\n' { 86 | m += 1 87 | } 88 | if m == 2 { 89 | break mFor 90 | } 91 | } else { 92 | break mFor 93 | } 94 | body = body[1:] 95 | } else { 96 | break mFor 97 | } 98 | } 99 | 100 | return string(markdown(body)) 101 | } 102 | } 103 | 104 | return "" 105 | } 106 | 107 | type DocRoot struct { 108 | Wd string 109 | Path string 110 | Doc *DocNode 111 | links map[string]*DocNode 112 | } 113 | 114 | func (d *DocRoot) GetNodeByLink(link string) (*DocNode, bool) { 115 | n, ok := d.links[link] 116 | return n, ok 117 | } 118 | 119 | func (d *DocRoot) walkParse() error { 120 | var err error 121 | if d.Path, err = filepath.Abs(d.Path); err != nil { 122 | return err 123 | } 124 | 125 | defer func() { 126 | if err == nil { 127 | d.sortAll(d.Doc) 128 | } 129 | }() 130 | 131 | err = filepath.Walk(d.Path, d.walk) 132 | return err 133 | } 134 | 135 | func (d *DocRoot) sortAll(node *DocNode) { 136 | for _, n := range node.Docs { 137 | if n.IsDir { 138 | d.sortAll(n) 139 | } 140 | } 141 | node.SortDocs() 142 | } 143 | 144 | func (d *DocRoot) makeDirNode(path string) error { 145 | relPath, _ := filepath.Rel(d.Path, path) 146 | 147 | var docDir *DocNode 148 | 149 | if d.Doc == nil { 150 | d.Doc = new(DocNode) 151 | d.Doc.dirs = make(map[string]*DocNode) 152 | docDir = d.Doc 153 | 154 | } else { 155 | list := strings.Split(relPath, string(filepath.Separator)) 156 | node := d.Doc 157 | for _, p := range list { 158 | if n, ok := node.dirs[p]; ok { 159 | node = n 160 | } else { 161 | n = new(DocNode) 162 | n.dirs = make(map[string]*DocNode) 163 | n.Parent = node 164 | node.Docs = append(node.Docs, n) 165 | node.dirs[p] = n 166 | node = n 167 | } 168 | } 169 | 170 | docDir = node 171 | } 172 | 173 | docDir.Root = d 174 | docDir.Path = path 175 | docDir.RelPath = relPath 176 | docDir.IsDir = true 177 | 178 | return nil 179 | } 180 | 181 | func (d *DocRoot) getDirNode(path string) *DocNode { 182 | node := d.Doc 183 | list := strings.Split(path, string(filepath.Separator)) 184 | for _, p := range list { 185 | if n, ok := node.dirs[p]; ok { 186 | node = n 187 | } 188 | } 189 | return node 190 | } 191 | 192 | func (d *DocRoot) makeFileNode(path string) error { 193 | file, err := os.Open(path) 194 | if err != nil { 195 | return err 196 | } 197 | defer file.Close() 198 | 199 | relPath, _ := filepath.Rel(d.Path, path) 200 | relPath = strings.Replace(relPath, "\\", "/", -1) 201 | 202 | docDir := d.getDirNode(filepath.Dir(relPath)) 203 | 204 | var bingo bool 205 | var doc *DocNode 206 | rd := bufio.NewReader(file) 207 | no := 0 208 | for { 209 | line, _, err := rd.ReadLine() 210 | if err == io.EOF { 211 | break 212 | } 213 | 214 | if no > 3 && !bingo { 215 | break 216 | } 217 | 218 | if no > 20 && bingo { 219 | return fmt.Errorf("document %s not contained ended tag `---`", path) 220 | } 221 | 222 | data := string(bytes.TrimSpace(line)) 223 | 224 | if len(data) == 3 && data == "---" { 225 | 226 | if bingo { 227 | if doc.root { 228 | if len(docDir.FilePath) > 0 { 229 | return fmt.Errorf("node %s has a document %s, can not replicate by %s", 230 | docDir.Path, docDir.FilePath, path) 231 | } 232 | 233 | docDir.Name = doc.Name 234 | docDir.Date = doc.Date 235 | docDir.Link = doc.Link 236 | docDir.Sort = doc.Sort 237 | 238 | mFor: 239 | for { 240 | l, _, er := rd.ReadLine() 241 | if er != nil { 242 | break mFor 243 | } 244 | if len(bytes.TrimSpace(l)) > 0 { 245 | docDir.FilePath = path 246 | break mFor 247 | } 248 | } 249 | 250 | if len(docDir.Link) == 0 { 251 | docDir.Link = docDir.RelPath + "/" 252 | } 253 | 254 | docDir.FileRelPath = relPath 255 | 256 | doc = docDir 257 | } else { 258 | doc.RelPath = relPath 259 | doc.FilePath = path 260 | if len(doc.Link) == 0 { 261 | // doc.Link = doc.RelPath 262 | doc.Link = strings.TrimSuffix(doc.RelPath, filepath.Ext(doc.RelPath)) 263 | } 264 | 265 | docDir.Docs = append(docDir.Docs, doc) 266 | } 267 | 268 | if dc, ok := d.links[doc.Link]; ok { 269 | return fmt.Errorf("document %s's link %s is already used by %s", path, doc.Link, dc.Path) 270 | } 271 | 272 | d.links[doc.Link] = doc 273 | 274 | break 275 | } 276 | 277 | doc = new(DocNode) 278 | doc.Path = path 279 | doc.Root = d 280 | doc.Parent = docDir 281 | 282 | bingo = true 283 | } 284 | 285 | if bingo { 286 | parts := strings.SplitN(data, ":", 2) 287 | if len(parts) == 2 { 288 | name := strings.TrimSpace(parts[0]) 289 | value := strings.TrimSpace(parts[1]) 290 | switch name { 291 | case "root": 292 | doc.root, _ = strconv.ParseBool(value) 293 | case "name": 294 | doc.Name = value 295 | case "date": 296 | doc.Date, err = com.DateParse(value, "Y-m-d H:i") 297 | if err != nil { 298 | return err 299 | } 300 | case "link": 301 | doc.Link = value 302 | case "sort": 303 | n, _ := strconv.ParseInt(value, 10, 64) 304 | doc.Sort = int(n) 305 | } 306 | } 307 | } 308 | } 309 | 310 | return nil 311 | } 312 | 313 | func (d *DocRoot) walk(path string, info os.FileInfo, err error) error { 314 | if err != nil { 315 | return filepath.SkipDir 316 | } 317 | 318 | if !info.IsDir() && info.Size() == 0 { 319 | return nil 320 | } 321 | 322 | if info.IsDir() { 323 | if err := d.makeDirNode(path); err != nil { 324 | return err 325 | } 326 | } else { 327 | return d.makeFileNode(path) 328 | } 329 | 330 | return nil 331 | } 332 | 333 | func ParseDocs(path string) (*DocRoot, error) { 334 | root := new(DocRoot) 335 | root.Path = path 336 | root.links = make(map[string]*DocNode) 337 | 338 | if err := root.walkParse(); err == nil { 339 | return root, err 340 | } else { 341 | return nil, err 342 | } 343 | } 344 | -------------------------------------------------------------------------------- /public/scss/_common.scss: -------------------------------------------------------------------------------- 1 | /* Eric Meyer's Reset CSS v2.0 */ 2 | 3 | html, 4 | body, 5 | div, 6 | span, 7 | applet, 8 | object, 9 | iframe, 10 | h1, 11 | h2, 12 | h3, 13 | h4, 14 | h5, 15 | h6, 16 | p, 17 | blockquote, 18 | pre, 19 | a, 20 | abbr, 21 | acronym, 22 | address, 23 | big, 24 | cite, 25 | code, 26 | del, 27 | dfn, 28 | em, 29 | img, 30 | ins, 31 | kbd, 32 | q, 33 | s, 34 | samp, 35 | small, 36 | strike, 37 | sub, 38 | sup, 39 | tt, 40 | var, 41 | b, 42 | u, 43 | i, 44 | center, 45 | dl, 46 | dt, 47 | dd, 48 | ol, 49 | ul, 50 | li, 51 | fieldset, 52 | form, 53 | label, 54 | legend, 55 | caption, 56 | tfoot, 57 | article, 58 | aside, 59 | canvas, 60 | details, 61 | embed, 62 | figure, 63 | figcaption, 64 | footer, 65 | header, 66 | hgroup, 67 | menu, 68 | nav, 69 | output, 70 | ruby, 71 | section, 72 | summary, 73 | time, 74 | mark, 75 | audio, 76 | video { 77 | border: 0; 78 | font-size: 100%; 79 | font: inherit; 80 | vertical-align: baseline; 81 | margin: 0; 82 | padding: 0 83 | } 84 | article, 85 | aside, 86 | details, 87 | figcaption, 88 | figure, 89 | footer, 90 | header, 91 | hgroup, 92 | menu, 93 | nav, 94 | section { 95 | display: block 96 | } 97 | body { 98 | line-height: 1 99 | } 100 | ol, 101 | ul { 102 | list-style: none 103 | } 104 | blockquote, 105 | q { 106 | quotes: none 107 | } 108 | blockquote:before, 109 | blockquote:after, 110 | q:before, 111 | q:after { 112 | content: none 113 | } 114 | table { 115 | border-collapse: collapse; 116 | border-spacing: 0 117 | } 118 | body { 119 | font: normal 18px/1.4em 'Lato', sans-serif, Microsoft Yahei; 120 | background: #EFEFEF; 121 | } 122 | a { 123 | color: #D9453D; 124 | text-decoration: none; 125 | } 126 | a:hover { 127 | color: #FF635A; 128 | text-decoration: underline; 129 | } 130 | b { 131 | font-weight: bold; 132 | } 133 | p { 134 | margin: 1em 0; 135 | } 136 | p:first-child { 137 | margin-top: 0; 138 | } 139 | nav, 140 | main { 141 | -webkit-box-sizing: border-box; 142 | -moz-box-sizing: border-box; 143 | -o-box-sizing: border-box; 144 | box-sizing: border-box; 145 | } 146 | nav { 147 | z-index: 2; 148 | padding: 10px 25px; 149 | background: #428BCA; 150 | color: #FFF; 151 | } 152 | #logo { 153 | max-height: 65px; 154 | vertical-align: middle; 155 | margin-right: 50px; 156 | } 157 | #menu-link { 158 | display: none; 159 | } 160 | nav a { 161 | display: inline-block; 162 | padding: 20px; 163 | color: #C8E0FF; 164 | transition: color .2s; 165 | } 166 | nav a:hover { 167 | color: #FFF; 168 | text-decoration: none; 169 | } 170 | iframe { 171 | width: 100px; 172 | height: 1.5em; 173 | vertical-align: middle; 174 | margin-bottom: 15px; 175 | } 176 | #lang { 177 | float: right; 178 | margin-top: 24px; 179 | } 180 | h1, 181 | h2 { 182 | font-family: 'PT Sans Narrow', sans-serif; 183 | line-height: 1.25em; 184 | } 185 | h1 { 186 | font-size: 54px; 187 | font-weight: bold; 188 | } 189 | h2 { 190 | font-size: 40px; 191 | margin-bottom: .5em; 192 | } 193 | main { 194 | position: relative; 195 | z-index: 1; 196 | } 197 | main section { 198 | padding: 50px 0; 199 | } 200 | main > .grid-container:first-child { 201 | margin: 30px auto; 202 | } 203 | .side-nav { 204 | font-size: 14px; 205 | line-height: 1em; 206 | } 207 | .side-nav ol, 208 | .side-nav ul { 209 | list-style-type: none; 210 | } 211 | .side-nav li.group { 212 | margin-left: 0; 213 | } 214 | .side-nav .section { 215 | font-weight: bold; 216 | color: #666; 217 | margin-top: 1em; 218 | } 219 | .content { 220 | background: #FFF; 221 | box-shadow: 0 0 5px rgba(0, 0, 0, .3); 222 | } 223 | article { 224 | padding: 3%; 225 | } 226 | button, 227 | .button, 228 | input[type=button] { 229 | padding: 10px 25px; 230 | border-radius: 5px; 231 | color: #FFF; 232 | margin-right: 10px; 233 | margin-top: 5px; 234 | margin-bottom: 5px; 235 | display: inline-block; 236 | transition: background .2s; 237 | } 238 | button:hover, 239 | .button:hover, 240 | input[type=button]:hover { 241 | color: #FFF; 242 | text-decoration: none; 243 | } 244 | .blue { 245 | background: #428BCA; 246 | } 247 | .blue:hover { 248 | background: #539CDB; 249 | } 250 | .darkblue { 251 | background: #285370; 252 | } 253 | .darkblue:hover { 254 | background: #276996; 255 | } 256 | .green { 257 | background: #65AD4E; 258 | } 259 | .green:hover { 260 | background: #71BF57; 261 | } 262 | .red { 263 | background: #DB3F36; 264 | } 265 | .red:hover { 266 | background: #C4362E; 267 | } 268 | .clear { 269 | border: 0; 270 | padding: 0; 271 | margin: 0; 272 | clear: both; 273 | } 274 | code { 275 | font-size: 13px; 276 | font-family: 'Monaco', monospace; 277 | padding: 3px 5px; 278 | background-color: rgba(0,0,0,0.05); 279 | border-radius: 3px; 280 | } 281 | ul, 282 | ol { 283 | margin: .5em 0; 284 | } 285 | ul:first-child, 286 | ol:first-child { 287 | margin-top: 0; 288 | } 289 | ul { 290 | list-style-type: disc; 291 | } 292 | ol { 293 | list-style-type: decimal; 294 | } 295 | li { 296 | margin-left: 2em; 297 | } 298 | .scroll-help { 299 | font-size: 18px; 300 | text-align: center; 301 | margin-bottom: .25em; 302 | color: #AAA; 303 | font-style: italic; 304 | } 305 | .scroll-help .fa { 306 | margin: 0 10px; 307 | } 308 | .nowrap { 309 | white-space: nowrap; 310 | } 311 | .text-left { 312 | text-align: left; 313 | } 314 | .text-center { 315 | text-align: center; 316 | } 317 | .text-right { 318 | text-align: right; 319 | } 320 | .hide-on-wide { 321 | display: none; 322 | } 323 | .block { 324 | display: block; 325 | } 326 | footer { 327 | padding: 50px 0; 328 | background: #222; 329 | color: #DDD; 330 | font-size: 16px; 331 | } 332 | footer .block { 333 | color: #DDD; 334 | } 335 | footer .white { 336 | color: #DDD; 337 | } 338 | footer a.white:hover { 339 | color: #FFF; 340 | text-decoration: none; 341 | } 342 | footer img { 343 | vertical-align: middle; 344 | } 345 | footer .button { 346 | font-size: 18px; 347 | } 348 | #footer-col-2 { 349 | text-align: center; 350 | } 351 | #footer-col-3 { 352 | text-align: right; 353 | } 354 | .social-media a { 355 | display: inline-block; 356 | border-radius: 2px; 357 | padding: 3px 8px; 358 | text-decoration: none; 359 | color: #FFF; 360 | font-size: 18px; 361 | text-align: center; 362 | margin: 0 3px; 363 | } 364 | .social-media .github { 365 | background: #AAA; 366 | } 367 | .social-media .github:hover { 368 | background: #CCC; 369 | } 370 | .social-media .twitter { 371 | background: #00ACED; 372 | } 373 | .social-media .twitter:hover { 374 | background: #21C2FF; 375 | } 376 | .social-media .google { 377 | background: #C03D20; 378 | } 379 | .social-media .google:hover { 380 | background: #D56060; 381 | } 382 | .social-media .weibo { 383 | background: #3B5998; 384 | } 385 | .social-media .weibo:hover { 386 | background: #4C70BA; 387 | } 388 | .sep { 389 | width: 30%; 390 | max-width: 250px; 391 | border: 0; 392 | background: none; 393 | border-top: 1px dotted #AAA; 394 | margin: 35px auto; 395 | } 396 | @media (max-width: 1200px) { 397 | h2 { 398 | font-size: 36px; 399 | } 400 | main section { 401 | padding: 35px 0; 402 | } 403 | } 404 | @media (max-width: 860px) { 405 | #logo { 406 | margin-right: 15px; 407 | } 408 | nav a { 409 | font-size: 14px; 410 | padding: 20px 10px; 411 | } 412 | footer { 413 | font-size: 14px; 414 | } 415 | } 416 | @media (max-width: 767px) { 417 | #get-started-buttons { 418 | text-align: center !important; 419 | } 420 | footer div { 421 | text-align: center !important; 422 | } 423 | footer .button { 424 | padding: 5px 10px; 425 | margin-top: 20px; 426 | font-size: 14px; 427 | } 428 | #footer-col-1 { 429 | margin-bottom: 20px; 430 | } 431 | #footer-col-2 { 432 | text-align: center; 433 | } 434 | #footer-col-3 { 435 | text-align: right; 436 | } 437 | article { 438 | margin-top: 50px; 439 | } 440 | } 441 | @media (min-width: 651px) { 442 | #wide-nav { 443 | display: inline-block !important; 444 | } 445 | } 446 | @media (max-width: 650px) { 447 | #logo { 448 | float: left; 449 | } 450 | nav { 451 | text-align: right !important; 452 | } 453 | nav a { 454 | font-size: 16px; 455 | } 456 | #menu-link { 457 | display: inline-block; 458 | } 459 | #lang { 460 | float: none; 461 | } 462 | #wide-nav { 463 | display: none; 464 | } 465 | #wide-nav a { 466 | text-align: left; 467 | display: block; 468 | padding: 8px; 469 | border-bottom: 1px solid #5DA2CF; 470 | } 471 | h1 { 472 | font-size: 42px; 473 | } 474 | h2 { 475 | font-size: 32px; 476 | } 477 | article { 478 | font-size: 16px; 479 | } 480 | .hide-on-wide { 481 | display: inline-block; 482 | } 483 | } 484 | #disqus_thread { 485 | margin-top: 20px; 486 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and 10 | distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by the copyright 13 | owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all other entities 16 | that control, are controlled by, or are under common control with that entity. 17 | For the purposes of this definition, "control" means (i) the power, direct or 18 | indirect, to cause the direction or management of such entity, whether by 19 | contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the 20 | outstanding shares, or (iii) beneficial ownership of such entity. 21 | 22 | "You" (or "Your") shall mean an individual or Legal Entity exercising 23 | permissions granted by this License. 24 | 25 | "Source" form shall mean the preferred form for making modifications, including 26 | but not limited to software source code, documentation source, and configuration 27 | files. 28 | 29 | "Object" form shall mean any form resulting from mechanical transformation or 30 | translation of a Source form, including but not limited to compiled object code, 31 | generated documentation, and conversions to other media types. 32 | 33 | "Work" shall mean the work of authorship, whether in Source or Object form, made 34 | available under the License, as indicated by a copyright notice that is included 35 | in or attached to the work (an example is provided in the Appendix below). 36 | 37 | "Derivative Works" shall mean any work, whether in Source or Object form, that 38 | is based on (or derived from) the Work and for which the editorial revisions, 39 | annotations, elaborations, or other modifications represent, as a whole, an 40 | original work of authorship. For the purposes of this License, Derivative Works 41 | shall not include works that remain separable from, or merely link (or bind by 42 | name) to the interfaces of, the Work and Derivative Works thereof. 43 | 44 | "Contribution" shall mean any work of authorship, including the original version 45 | of the Work and any modifications or additions to that Work or Derivative Works 46 | thereof, that is intentionally submitted to Licensor for inclusion in the Work 47 | by the copyright owner or by an individual or Legal Entity authorized to submit 48 | on behalf of the copyright owner. For the purposes of this definition, 49 | "submitted" means any form of electronic, verbal, or written communication sent 50 | to the Licensor or its representatives, including but not limited to 51 | communication on electronic mailing lists, source code control systems, and 52 | issue tracking systems that are managed by, or on behalf of, the Licensor for 53 | the purpose of discussing and improving the Work, but excluding communication 54 | that is conspicuously marked or otherwise designated in writing by the copyright 55 | owner as "Not a Contribution." 56 | 57 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf 58 | of whom a Contribution has been received by Licensor and subsequently 59 | incorporated within the Work. 60 | 61 | 2. Grant of Copyright License. 62 | 63 | Subject to the terms and conditions of this License, each Contributor hereby 64 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, 65 | irrevocable copyright license to reproduce, prepare Derivative Works of, 66 | publicly display, publicly perform, sublicense, and distribute the Work and such 67 | Derivative Works in Source or Object form. 68 | 69 | 3. Grant of Patent License. 70 | 71 | Subject to the terms and conditions of this License, each Contributor hereby 72 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, 73 | irrevocable (except as stated in this section) patent license to make, have 74 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where 75 | such license applies only to those patent claims licensable by such Contributor 76 | that are necessarily infringed by their Contribution(s) alone or by combination 77 | of their Contribution(s) with the Work to which such Contribution(s) was 78 | submitted. If You institute patent litigation against any entity (including a 79 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a 80 | Contribution incorporated within the Work constitutes direct or contributory 81 | patent infringement, then any patent licenses granted to You under this License 82 | for that Work shall terminate as of the date such litigation is filed. 83 | 84 | 4. Redistribution. 85 | 86 | You may reproduce and distribute copies of the Work or Derivative Works thereof 87 | in any medium, with or without modifications, and in Source or Object form, 88 | provided that You meet the following conditions: 89 | 90 | You must give any other recipients of the Work or Derivative Works a copy of 91 | this License; and 92 | You must cause any modified files to carry prominent notices stating that You 93 | changed the files; and 94 | You must retain, in the Source form of any Derivative Works that You distribute, 95 | all copyright, patent, trademark, and attribution notices from the Source form 96 | of the Work, excluding those notices that do not pertain to any part of the 97 | Derivative Works; and 98 | If the Work includes a "NOTICE" text file as part of its distribution, then any 99 | Derivative Works that You distribute must include a readable copy of the 100 | attribution notices contained within such NOTICE file, excluding those notices 101 | that do not pertain to any part of the Derivative Works, in at least one of the 102 | following places: within a NOTICE text file distributed as part of the 103 | Derivative Works; within the Source form or documentation, if provided along 104 | with the Derivative Works; or, within a display generated by the Derivative 105 | Works, if and wherever such third-party notices normally appear. The contents of 106 | the NOTICE file are for informational purposes only and do not modify the 107 | License. You may add Your own attribution notices within Derivative Works that 108 | You distribute, alongside or as an addendum to the NOTICE text from the Work, 109 | provided that such additional attribution notices cannot be construed as 110 | modifying the License. 111 | You may add Your own copyright statement to Your modifications and may provide 112 | additional or different license terms and conditions for use, reproduction, or 113 | distribution of Your modifications, or for any such Derivative Works as a whole, 114 | provided Your use, reproduction, and distribution of the Work otherwise complies 115 | with the conditions stated in this License. 116 | 117 | 5. Submission of Contributions. 118 | 119 | Unless You explicitly state otherwise, any Contribution intentionally submitted 120 | for inclusion in the Work by You to the Licensor shall be under the terms and 121 | conditions of this License, without any additional terms or conditions. 122 | Notwithstanding the above, nothing herein shall supersede or modify the terms of 123 | any separate license agreement you may have executed with Licensor regarding 124 | such Contributions. 125 | 126 | 6. Trademarks. 127 | 128 | This License does not grant permission to use the trade names, trademarks, 129 | service marks, or product names of the Licensor, except as required for 130 | reasonable and customary use in describing the origin of the Work and 131 | reproducing the content of the NOTICE file. 132 | 133 | 7. Disclaimer of Warranty. 134 | 135 | Unless required by applicable law or agreed to in writing, Licensor provides the 136 | Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, 137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, 138 | including, without limitation, any warranties or conditions of TITLE, 139 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are 140 | solely responsible for determining the appropriateness of using or 141 | redistributing the Work and assume any risks associated with Your exercise of 142 | permissions under this License. 143 | 144 | 8. Limitation of Liability. 145 | 146 | In no event and under no legal theory, whether in tort (including negligence), 147 | contract, or otherwise, unless required by applicable law (such as deliberate 148 | and grossly negligent acts) or agreed to in writing, shall any Contributor be 149 | liable to You for damages, including any direct, indirect, special, incidental, 150 | or consequential damages of any character arising as a result of this License or 151 | out of the use or inability to use the Work (including but not limited to 152 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or 153 | any and all other commercial damages or losses), even if such Contributor has 154 | been advised of the possibility of such damages. 155 | 156 | 9. Accepting Warranty or Additional Liability. 157 | 158 | While redistributing the Work or Derivative Works thereof, You may choose to 159 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or 160 | other liability obligations and/or rights consistent with this License. However, 161 | in accepting such obligations, You may act only on Your own behalf and on Your 162 | sole responsibility, not on behalf of any other Contributor, and only if You 163 | agree to indemnify, defend, and hold each Contributor harmless for any liability 164 | incurred by, or claims asserted against, such Contributor by reason of your 165 | accepting any such warranty or additional liability. 166 | 167 | END OF TERMS AND CONDITIONS 168 | 169 | APPENDIX: How to apply the Apache License to your work 170 | 171 | To apply the Apache License to your work, attach the following boilerplate 172 | notice, with the fields enclosed by brackets "[]" replaced with your own 173 | identifying information. (Don't include the brackets!) The text should be 174 | enclosed in the appropriate comment syntax for the file format. We also 175 | recommend that a file or class name and description of purpose be included on 176 | the same "printed page" as the copyright notice for easier identification within 177 | third-party archives. 178 | 179 | Copyright [yyyy] [name of copyright owner] 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); 182 | you may not use this file except in compliance with the License. 183 | You may obtain a copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable law or agreed to in writing, software 188 | distributed under the License is distributed on an "AS IS" BASIS, 189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 190 | See the License for the specific language governing permissions and 191 | limitations under the License. -------------------------------------------------------------------------------- /models/models.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | // Package models is for loading and updating documentation files. 16 | package models 17 | 18 | import ( 19 | "bytes" 20 | "encoding/json" 21 | "errors" 22 | "os" 23 | "path" 24 | "strings" 25 | "sync" 26 | "time" 27 | 28 | "github.com/Unknwon/com" 29 | "github.com/Unknwon/macaron" 30 | "github.com/robfig/cron" 31 | "github.com/russross/blackfriday" 32 | 33 | "github.com/gogits/gogsweb/modules/log" 34 | "github.com/gogits/gogsweb/modules/setting" 35 | ) 36 | 37 | var ( 38 | docs = make(map[string]map[string]*DocRoot) 39 | ) 40 | 41 | type oldDocNode struct { 42 | Sha string 43 | Path string 44 | Type string 45 | } 46 | 47 | // docTrees descriables a documentation file structure tree. 48 | type docTree struct { 49 | Tree []oldDocNode 50 | } 51 | 52 | var docTrees = map[string]*docTree{} 53 | 54 | type docFile struct { 55 | Title string 56 | Data []byte 57 | } 58 | 59 | var ( 60 | docLock = &sync.RWMutex{} 61 | docMaps = map[string]map[string]*docFile{} 62 | ) 63 | 64 | func GetDocByLocale(name, lang string) *DocRoot { 65 | return docs[name][lang] 66 | } 67 | 68 | func InitModels() { 69 | for _, app := range setting.Apps { 70 | parseDocs(app.Name) 71 | initDocMap(app.Name) 72 | } 73 | 74 | if macaron.Env == macaron.DEV { 75 | return 76 | } 77 | 78 | c := cron.New() 79 | c.AddFunc("0 */5 * * * *", checkFileUpdates) 80 | c.Start() 81 | 82 | if needCheckUpdate() { 83 | checkFileUpdates() 84 | setting.Cfg.Section("app").Key("update_check_time").SetValue(com.ToStr(time.Now().Unix())) 85 | if err := setting.Cfg.SaveTo(setting.CFG_CUSTOM_PATH); err != nil { 86 | log.Error("Fail to save settings: %v", err) 87 | } 88 | } 89 | } 90 | 91 | func parseDocs(name string) { 92 | if docs[name] == nil { 93 | docs[name] = make(map[string]*DocRoot) 94 | } 95 | 96 | for _, lang := range setting.Langs { 97 | root, err := ParseDocs(path.Join("docs", name, lang)) 98 | if err != nil { 99 | log.Error("Fail to parse docs: %v", err) 100 | } 101 | 102 | if root != nil { 103 | docs[name][lang] = root 104 | } 105 | } 106 | } 107 | 108 | func needCheckUpdate() bool { 109 | // Does not have record for check update. 110 | stamp, err := setting.Cfg.Section("app").Key("update_check_time").Int64() 111 | if err != nil { 112 | return true 113 | } 114 | 115 | for _, app := range setting.Apps { 116 | if !com.IsFile("conf/docTree_" + app.Name + ".json") { 117 | return true 118 | } 119 | } 120 | 121 | return time.Unix(stamp, 0).Add(5 * time.Minute).Before(time.Now()) 122 | } 123 | 124 | func initDocMap(name string) { 125 | docTrees[name] = &docTree{} 126 | treeName := "conf/docTree_" + name + ".json" 127 | isConfExist := com.IsFile(treeName) 128 | if isConfExist { 129 | f, err := os.Open(treeName) 130 | if err != nil { 131 | log.Error("Fail to open '%s': %v", treeName, err) 132 | return 133 | } 134 | defer f.Close() 135 | 136 | d := json.NewDecoder(f) 137 | if err = d.Decode(docTrees[name]); err != nil { 138 | log.Error("Fail to decode '%s': %v", treeName, err) 139 | return 140 | } 141 | } else { 142 | // Generate 'docTree'. 143 | docTrees[name].Tree = append(docTrees[name].Tree, oldDocNode{Path: ""}) 144 | } 145 | 146 | docLock.Lock() 147 | defer docLock.Unlock() 148 | 149 | docMap := make(map[string]*docFile) 150 | 151 | for _, l := range setting.Langs { 152 | os.MkdirAll(path.Join("docs", name, l), os.ModePerm) 153 | for _, v := range docTrees[name].Tree { 154 | var fullName string 155 | if isConfExist { 156 | fullName = v.Path 157 | } else { 158 | fullName = l + "/" + v.Path 159 | } 160 | 161 | docMap[fullName] = getFile(path.Join("docs", name, fullName)) 162 | } 163 | } 164 | 165 | docMaps[name] = docMap 166 | } 167 | 168 | // loadFile returns []byte of file data by given path. 169 | func loadFile(filePath string) ([]byte, error) { 170 | f, err := os.Open(filePath) 171 | if err != nil { 172 | return []byte(""), errors.New("Fail to open file: " + err.Error()) 173 | } 174 | 175 | fi, err := f.Stat() 176 | if err != nil { 177 | return []byte(""), errors.New("Fail to get file information: " + err.Error()) 178 | } 179 | 180 | d := make([]byte, fi.Size()) 181 | f.Read(d) 182 | return d, nil 183 | } 184 | 185 | type CustomRender struct { 186 | blackfriday.Renderer 187 | } 188 | 189 | var ( 190 | tab = []byte("\t") 191 | spaces = []byte(" ") 192 | ) 193 | 194 | func (cr *CustomRender) BlockCode(out *bytes.Buffer, text []byte, lang string) { 195 | var tmp bytes.Buffer 196 | cr.Renderer.BlockCode(&tmp, text, lang) 197 | out.Write(bytes.Replace(tmp.Bytes(), tab, spaces, -1)) 198 | } 199 | 200 | func markdown(raw []byte) []byte { 201 | htmlFlags := 0 202 | htmlFlags |= blackfriday.HTML_USE_XHTML 203 | htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS 204 | htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS 205 | htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES 206 | htmlFlags |= blackfriday.HTML_OMIT_CONTENTS 207 | htmlFlags |= blackfriday.HTML_COMPLETE_PAGE 208 | 209 | renderer := &CustomRender{ 210 | Renderer: blackfriday.HtmlRenderer(htmlFlags, "", ""), 211 | } 212 | 213 | // set up the parser 214 | extensions := 0 215 | extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS 216 | extensions |= blackfriday.EXTENSION_TABLES 217 | extensions |= blackfriday.EXTENSION_FENCED_CODE 218 | extensions |= blackfriday.EXTENSION_AUTOLINK 219 | extensions |= blackfriday.EXTENSION_STRIKETHROUGH 220 | extensions |= blackfriday.EXTENSION_HARD_LINE_BREAK 221 | extensions |= blackfriday.EXTENSION_SPACE_HEADERS 222 | extensions |= blackfriday.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK 223 | 224 | body := blackfriday.Markdown(raw, renderer, extensions) 225 | return body 226 | } 227 | 228 | func getFile(filePath string) *docFile { 229 | if strings.Contains(filePath, "images") || 230 | len(strings.Split(filePath, "/")) <= 3 { 231 | return nil 232 | } 233 | 234 | df := &docFile{} 235 | p, err := loadFile(filePath + ".md") 236 | if err != nil { 237 | log.Error("Fail to load MD file: %v", err) 238 | return nil 239 | } 240 | 241 | // Parse and render. 242 | s := string(p) 243 | i := strings.Index(s, "\n") 244 | if i > -1 { 245 | // Has title. 246 | df.Title = strings.TrimSpace( 247 | strings.Replace(s[:i+1], "#", "", -1)) 248 | if len(s) >= i+2 { 249 | df.Data = []byte(strings.TrimSpace(s[i+2:])) 250 | } 251 | } else { 252 | df.Data = p 253 | } 254 | 255 | df.Data = markdown(df.Data) 256 | return df 257 | } 258 | 259 | // GetDoc returns 'docFile' by given name and language version. 260 | func GetDoc(app, fullName, lang string) *docFile { 261 | filePath := path.Join("docs", app, lang, fullName) 262 | 263 | if macaron.Env == macaron.DEV { 264 | return getFile(filePath) 265 | } 266 | 267 | docLock.RLock() 268 | defer docLock.RUnlock() 269 | return docMaps[app][lang+"/"+fullName] 270 | } 271 | 272 | var checkTicker *time.Ticker 273 | 274 | func checkTickerTimer(checkChan <-chan time.Time) { 275 | for { 276 | <-checkChan 277 | checkFileUpdates() 278 | } 279 | } 280 | 281 | type rawFile struct { 282 | name string 283 | rawURL string 284 | data []byte 285 | } 286 | 287 | func (rf *rawFile) Name() string { 288 | return rf.name 289 | } 290 | 291 | func (rf *rawFile) RawUrl() string { 292 | return rf.rawURL 293 | } 294 | 295 | func (rf *rawFile) Data() []byte { 296 | return rf.data 297 | } 298 | 299 | func (rf *rawFile) SetData(p []byte) { 300 | rf.data = p 301 | } 302 | 303 | func checkFileUpdates() { 304 | log.Debug("Checking file updates") 305 | 306 | type tree struct { 307 | AppName, ApiUrl, RawUrl, TreeName, Prefix string 308 | } 309 | 310 | trees := make([]*tree, len(setting.Apps)) 311 | for i, app := range setting.Apps { 312 | trees[i] = &tree{ 313 | AppName: app.Name, 314 | ApiUrl: "https://api.github.com/repos/" + app.RepoName + "/git/trees/master?recursive=1&" + setting.GithubCred, 315 | RawUrl: "https://raw.github.com/" + app.RepoName + "/master/", 316 | TreeName: "conf/docTree_" + app.Name + ".json", 317 | Prefix: "docs/" + app.Name + "/", 318 | } 319 | } 320 | 321 | for _, tree := range trees { 322 | var tmpTree struct { 323 | Tree []*oldDocNode 324 | } 325 | 326 | if err := com.HttpGetJSON(httpClient, tree.ApiUrl, &tmpTree); err != nil { 327 | log.Error("Fail to get trees: %v", err) 328 | return 329 | } 330 | 331 | var saveTree struct { 332 | Tree []*oldDocNode 333 | } 334 | saveTree.Tree = make([]*oldDocNode, 0, len(tmpTree.Tree)) 335 | 336 | // Compare SHA. 337 | files := make([]com.RawFile, 0, len(tmpTree.Tree)) 338 | for _, node := range tmpTree.Tree { 339 | // Skip non-md files and "README.md". 340 | if node.Type != "blob" || (!strings.HasSuffix(node.Path, ".md") && 341 | !strings.Contains(node.Path, "images") && 342 | !strings.HasSuffix(node.Path, ".json")) || 343 | strings.HasPrefix(strings.ToLower(node.Path), "readme") { 344 | continue 345 | } 346 | 347 | name := strings.TrimSuffix(node.Path, ".md") 348 | 349 | if checkSHA(tree.AppName, name, node.Sha, tree.Prefix) { 350 | log.Info("Need to update: %s", name) 351 | files = append(files, &rawFile{ 352 | name: name, 353 | rawURL: tree.RawUrl + node.Path, 354 | }) 355 | } 356 | 357 | saveTree.Tree = append(saveTree.Tree, &oldDocNode{ 358 | Path: name, 359 | Sha: node.Sha, 360 | }) 361 | // For save purpose, reset name. 362 | node.Path = name 363 | } 364 | 365 | // Fetch files. 366 | if err := com.FetchFiles(httpClient, files, nil); err != nil { 367 | log.Error("Fail to fetch files: %v", err) 368 | return 369 | } 370 | 371 | // Update data. 372 | for _, f := range files { 373 | os.MkdirAll(path.Join(tree.Prefix, path.Dir(f.Name())), os.ModePerm) 374 | suf := ".md" 375 | if strings.Contains(f.Name(), "images") || 376 | strings.HasSuffix(f.Name(), ".json") { 377 | suf = "" 378 | } 379 | fw, err := os.Create(tree.Prefix + f.Name() + suf) 380 | if err != nil { 381 | log.Error("Fail to open file: %v", err) 382 | continue 383 | } 384 | 385 | _, err = fw.Write(f.Data()) 386 | fw.Close() 387 | if err != nil { 388 | log.Error("Fail to write data: %v", err) 389 | continue 390 | } 391 | } 392 | 393 | // Save documentation information. 394 | f, err := os.Create(tree.TreeName) 395 | if err != nil { 396 | log.Error("Fail to save data: %v", err) 397 | return 398 | } 399 | 400 | e := json.NewEncoder(f) 401 | err = e.Encode(&saveTree) 402 | if err != nil { 403 | log.Error("Fail to encode data: %v", err) 404 | return 405 | } 406 | f.Close() 407 | } 408 | 409 | log.Debug("Finish check file updates") 410 | for _, app := range setting.Apps { 411 | parseDocs(app.Name) 412 | initDocMap(app.Name) 413 | } 414 | } 415 | 416 | // checkSHA returns true if the documentation file need to update. 417 | func checkSHA(app, name, sha, prefix string) bool { 418 | var tree docTree 419 | 420 | if strings.HasPrefix(prefix, "docs/") { 421 | tree = *docTrees[app] 422 | } 423 | 424 | for _, v := range tree.Tree { 425 | if v.Path == name { 426 | // Found. 427 | if v.Sha != sha { 428 | // Need to update. 429 | return true 430 | } 431 | return false 432 | } 433 | } 434 | // Not found. 435 | return true 436 | } 437 | -------------------------------------------------------------------------------- /public/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;a122||(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;ah[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",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 22 | /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], 23 | ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), 24 | ["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"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",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, 25 | hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); 26 | p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); 27 | return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i="0"&&"7">=n?parseInt(e.substring(1),8):"u"===n||"x"===n?parseInt(e.substring(2),16):e.charCodeAt(1)}function n(e){return 32>e?(16>e?"\\x0":"\\x")+e.toString(16):(e=String.fromCharCode(e),"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e)}function r(e){var r=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="^"===r[0],s=["["];a&&s.push("^");for(var a=a?1:0,i=r.length;i>a;++a){var o=r[a];if(/\\[bdsw]/i.test(o))s.push(o);else{var o=t(o),l;i>a+2&&"-"===r[a+1]?(l=t(r[a+2]),a+=2):l=o,e.push([o,l]),65>l||o>122||(65>l||o>90||e.push([32|Math.max(65,o),32|Math.min(l,90)]),97>l||o>122||e.push([-33&Math.max(97,o),-33&Math.min(l,122)]))}}for(e.sort(function(e,t){return e[0]-t[0]||t[1]-e[1]}),r=[],i=[],a=0;ao[0]&&(o[1]+1>o[0]&&s.push("-"),s.push(n(o[1])));return s.push("]"),s.join("")}function a(e){for(var t=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),a=t.length,o=[],l=0,c=0;a>l;++l){var u=t[l];"("===u?++c:"\\"===u.charAt(0)&&(u=+u.substring(1))&&(c>=u?o[u]=-1:t[l]=n(u))}for(l=1;ll;++l)u=t[l],"("===u?(++c,o[c]||(t[l]="(?:")):"\\"===u.charAt(0)&&(u=+u.substring(1))&&c>=u&&(t[l]="\\"+o[u]);for(l=0;a>l;++l)"^"===t[l]&&"^"!==t[l+1]&&(t[l]="");if(e.ignoreCase&&i)for(l=0;a>l;++l)u=t[l],e=u.charAt(0),u.length>=2&&"["===e?t[l]=r(u):"\\"!==e&&(t[l]=u.replace(/[A-Za-z]/g,function(e){return e=e.charCodeAt(0),"["+String.fromCharCode(-33&e,32|e)+"]"}));return t.join("")}for(var s=0,i=!1,o=!1,l=0,c=e.length;c>l;++l){var u=e[l];if(u.ignoreCase)o=!0;else if(/[a-z]/i.test(u.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){i=!0,o=!1;break}}for(var d={b:8,t:9,n:10,v:11,f:12,r:13},p=[],l=0,c=e.length;c>l;++l){if(u=e[l],u.global||u.multiline)throw Error(""+u);p.push("(?:"+a(u)+")")}return RegExp(p.join("|"),o?"gi":"g")}function n(e,t){function n(e){var l=e.nodeType;if(1==l){if(!r.test(e.className)){for(l=e.firstChild;l;l=l.nextSibling)n(l);l=e.nodeName.toLowerCase(),("br"===l||"li"===l)&&(a[o]="\n",i[o<<1]=s++,i[o++<<1|1]=e)}}else(3==l||4==l)&&(l=e.nodeValue,l.length&&(l=t?l.replace(/\r\n?/g,"\n"):l.replace(/[\t\n\r ]+/g," "),a[o]=l,i[o<<1]=s,s+=l.length,i[o++<<1|1]=e))}var r=/(?:^|\s)nocode(?:\s|$)/,a=[],s=0,i=[],o=0;return n(e),{a:a.join("").replace(/\n$/,""),d:i}}function r(e,t,n,r){t&&(e={a:t,e:e},n(e),r.push.apply(r,e.g))}function a(e){for(var t=void 0,n=e.firstChild;n;n=n.nextSibling)var r=n.nodeType,t=1===r?t?e:n:3===r&&x.test(n.nodeValue)?e:t;return t===e?void 0:t}function s(n,a){function s(e){for(var t=e.e,n=[t,"pln"],u=0,d=e.a.match(o)||[],p={},f=0,h=d.length;h>f;++f){var g=d[f],m=p[g],y=void 0,v;if("string"==typeof m)v=!1;else{var b=i[g.charAt(0)];if(b)y=g.match(b[1]),m=b[0];else{for(v=0;l>v;++v)if(b=a[v],y=g.match(b[1])){m=b[0];break}y||(m="pln")}!(v=m.length>=5&&"lang-"===m.substring(0,5))||y&&"string"==typeof y[1]||(v=!1,m="src"),v||(p[g]=m)}if(b=u,u+=g.length,v){v=y[1];var w=g.indexOf(v),x=w+v.length;y[2]&&(x=g.length-y[2].length,w=x-v.length),m=m.substring(5),r(t+b,g.substring(0,w),s,n),r(t+b+w,v,c(m,v),n),r(t+b+x,g.substring(x),s,n)}else n.push(t+b,m)}e.g=n}var i={},o;!function(){for(var r=n.concat(a),s=[],l={},c=0,u=r.length;u>c;++c){var d=r[c],p=d[3];if(p)for(var f=p.length;--f>=0;)i[p.charAt(f)]=d;d=d[1],p=""+d,l.hasOwnProperty(p)||(s.push(d),l[p]=e)}s.push(/[\S\s]/),o=t(s)}();var l=a.length;return s}function i(t){var n=[],r=[];n.push(t.tripleQuotedStrings?["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,e,"'\""]:t.multiLineStrings?["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,e,"'\"`"]:["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,e,"\"'"]),t.verbatimStrings&&r.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,e]);var a=t.hashComments;if(a&&(t.cStyleComments?(n.push(a>1?["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,e,"#"]:["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,e,"#"]),r.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,e])):n.push(["com",/^#[^\n\r]*/,e,"#"])),t.cStyleComments&&(r.push(["com",/^\/\/[^\n\r]*/,e]),r.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,e])),a=t.regexLiterals){var i=(a=a>1?"":"\n\r")?".":"[\\S\\s]";r.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+a+"])(?:[^/\\x5B\\x5C"+a+"]|\\x5C"+i+"|\\x5B(?:[^\\x5C\\x5D"+a+"]|\\x5C"+i+")*(?:\\x5D|$))+/")+")")])}return(a=t.types)&&r.push(["typ",a]),a=(""+t.keywords).replace(/^ | $/g,""),a.length&&r.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),e]),n.push(["pln",/^\s+/,e," \r\n  "]),a="^.[^\\s\\w.$@'\"`/\\\\]*",t.regexLiterals&&(a+="(?!s*/)"),r.push(["lit",/^@[$_a-z][\w$@]*/i,e],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,e],["pln",/^[$_a-z][\w$@]*/i,e],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,e,"0123456789"],["pln",/^\\[\S\s]?/,e],["pun",RegExp(a),e]),s(n,r)}function o(e,t,n){function r(e){var t=e.nodeType;if(1!=t||s.test(e.className)){if((3==t||4==t)&&n){var l=e.nodeValue,c=l.match(i);c&&(t=l.substring(0,c.index),e.nodeValue=t,(l=l.substring(c.index+c[0].length))&&e.parentNode.insertBefore(o.createTextNode(l),e.nextSibling),a(e),t||e.parentNode.removeChild(e))}}else if("br"===e.nodeName)a(e),e.parentNode&&e.parentNode.removeChild(e);else for(e=e.firstChild;e;e=e.nextSibling)r(e)}function a(e){function t(e,n){var r=n?e.cloneNode(!1):e,a=e.parentNode;if(a){var a=t(a,1),s=e.nextSibling;a.appendChild(r);for(var i=s;i;i=s)s=i.nextSibling,a.appendChild(i)}return r}for(;!e.nextSibling;)if(e=e.parentNode,!e)return;for(var e=t(e.nextSibling,0),n;(n=e.parentNode)&&1===n.nodeType;)e=n;c.push(e)}for(var s=/(?:^|\s)nocode(?:\s|$)/,i=/\r\n?|\n/,o=e.ownerDocument,l=o.createElement("li");e.firstChild;)l.appendChild(e.firstChild);for(var c=[l],u=0;uu;++u)l=c[u],l.className="L"+(u+t)%10,l.firstChild||l.appendChild(o.createTextNode(" ")),d.appendChild(l);e.appendChild(d)}function l(e,t){for(var n=t.length;--n>=0;){var r=t[n];C.hasOwnProperty(r)?d.console&&console.warn("cannot override language handler %s",r):C[r]=e}}function c(e,t){return e&&C.hasOwnProperty(e)||(e=/^\s*m;)p[m]!==p[m+2]?(p[g++]=p[m++],p[g++]=p[m++]):m+=2;for(f=g,m=g=0;f>m;){for(var y=p[m],v=p[m+1],b=m+2;f>=b+2&&p[b+1]===v;)b+=2;p[g++]=y,p[g++]=v,m=b}p.length=g;var w=e.c,x;w&&(x=w.style.display,w.style.display="none");try{for(;u>a;){var S=l[a+2]||o,C=p[h+2]||o,b=Math.min(S,C),N=l[a+1],k;if(1!==N.nodeType&&(k=i.substring(r,b))){s&&(k=k.replace(t,"\r")),N.nodeValue=k;var _=N.ownerDocument,T=_.createElement("span");T.className=p[h+1];var E=N.parentNode;E.replaceChild(T,N),T.appendChild(N),S>r&&(l[a+1]=N=_.createTextNode(i.substring(b,S)),E.insertBefore(N,T.nextSibling))}r=b,r>=S&&(a+=2),r>=C&&(h+=2)}}finally{w&&(w.style.display=x)}}catch(R){d.console&&console.log(R&&R.stack||R)}}var d=window,p=["break,continue,do,else,for,if,return,while"],f=[[p,"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"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[f,"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"],g=[f,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],m=[g,"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"],f=[f,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],y=[p,"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"],v=[p,"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"],b=[p,"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"],p=[p,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x=/\S/,S=i({keywords:[h,m,f,"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",y,v,p],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),C={};l(S,["default-code"]),l(s([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),l(s([["pln",/^\s+/,e," \r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,e,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]),l(s([],[["atv",/^[\S\s]+/]]),["uq.val"]),l(i({keywords:h,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),l(i({keywords:"null,true,false"}),["json"]),l(i({keywords:m,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),l(i({keywords:g,cStyleComments:!0}),["java"]),l(i({keywords:p,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),l(i({keywords:y,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),l(i({keywords:"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",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),l(i({keywords:v,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),l(i({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]),l(i({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),l(i({keywords:b,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]),l(s([],[["str",/^[\S\s]+/]]),["regex"]);var N=d.PR={createSimpleLexer:s,registerLangHandler:l,sourceDecorator:i,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:d.prettyPrintOne=function(e,t,n){var r=document.createElement("div");return r.innerHTML="
"+e+"
",r=r.firstChild,n&&o(r,n,!0),u({h:t,j:n,c:r,i:1}),r.innerHTML},prettyPrint:d.prettyPrint=function(t,n){function r(){for(var n=d.PR_SHOULD_USE_CONTINUATION?h.now()+250:1/0;gp;++p)l.push(s[c][p]);var s=e,h=Date;h.now||(h={now:function(){return+new Date}});var g=0,m,y=/\blang(?:uage)?-([\w.]+)(?!\S)/,v=/\bprettyprint\b/,b=/\bprettyprinted\b/,w=/pre|xmp/i,x=/^code$/i,S=/^(?:pre|code|xmp)$/i,C={};r()}};"function"==typeof define&&define.amd&&define("google-code-prettify",[],function(){return N})}()}(),$(document).ready(function(){$("#menu-link").click(function(){$("#wide-nav").slideToggle("fast")}),$("main").click(function(){$("#menu-link").is(":visible")&&$("#wide-nav").slideUp("fast")}),$("#lang").on("change",function(){document.location.href=this.options[this.selectedIndex].value}),$(".markdown").find("pre > code").parent().addClass("prettyprint"),prettyPrint();var e=$(".docs-markdown");e.find("a").each(function(){var e=$(this),t=e.attr("href"),n=t.indexOf("#");if((0!==t.indexOf("http")||-1!==t.indexOf(window.location.hostname))&&!(0>n||n+1>t.length)){var r=t.substring(n+1,t.length);r=encodeURIComponent(decodeURIComponent(r).toLowerCase().replace(/\s+/g,"-")),e.attr("href",t.substring(0,n)+"#"+r)}}),e.find("h1, h2, h3, h4, h5, h6").each(function(){var e=$(this);if(!e.hasClass("ui")){var t=encodeURIComponent(e.text().toLowerCase().replace(/\s+/g,"-"));e=e.wrap('
'),e.append('')}})}); -------------------------------------------------------------------------------- /public/scss/_unsemantic.scss: -------------------------------------------------------------------------------- 1 | /* ============================================ */ 2 | 3 | /* This file has a mobile-to-desktop breakpoint */ 4 | 5 | /* ============================================ */ 6 | 7 | @media screen and (max-width: 400px) { 8 | @-ms-viewport { 9 | width: 320px; 10 | } 11 | } 12 | .clear { 13 | clear: both; 14 | display: block; 15 | overflow: hidden; 16 | visibility: hidden; 17 | width: 0; 18 | height: 0; 19 | } 20 | .grid-container:before, 21 | .clearfix:before, 22 | .grid-container:after, 23 | .clearfix:after { 24 | content: "."; 25 | display: block; 26 | overflow: hidden; 27 | visibility: hidden; 28 | font-size: 0; 29 | line-height: 0; 30 | width: 0; 31 | height: 0; 32 | } 33 | .grid-container:after, 34 | .clearfix:after { 35 | clear: both; 36 | } 37 | .grid-container { 38 | margin-left: auto; 39 | margin-right: auto; 40 | max-width: 1200px; 41 | padding-left: 10px; 42 | padding-right: 10px; 43 | } 44 | .grid-5, 45 | .mobile-grid-5, 46 | .grid-10, 47 | .mobile-grid-10, 48 | .grid-15, 49 | .mobile-grid-15, 50 | .grid-20, 51 | .mobile-grid-20, 52 | .grid-25, 53 | .mobile-grid-25, 54 | .grid-30, 55 | .mobile-grid-30, 56 | .grid-35, 57 | .mobile-grid-35, 58 | .grid-40, 59 | .mobile-grid-40, 60 | .grid-45, 61 | .mobile-grid-45, 62 | .grid-50, 63 | .mobile-grid-50, 64 | .grid-55, 65 | .mobile-grid-55, 66 | .grid-60, 67 | .mobile-grid-60, 68 | .grid-65, 69 | .mobile-grid-65, 70 | .grid-70, 71 | .mobile-grid-70, 72 | .grid-75, 73 | .mobile-grid-75, 74 | .grid-80, 75 | .mobile-grid-80, 76 | .grid-85, 77 | .mobile-grid-85, 78 | .grid-90, 79 | .mobile-grid-90, 80 | .grid-95, 81 | .mobile-grid-95, 82 | .grid-100, 83 | .mobile-grid-100, 84 | .grid-33, 85 | .mobile-grid-33, 86 | .grid-66, 87 | .mobile-grid-66 { 88 | -moz-box-sizing: border-box; 89 | -webkit-box-sizing: border-box; 90 | box-sizing: border-box; 91 | padding-left: 10px; 92 | padding-right: 10px; 93 | } 94 | .grid-parent { 95 | padding-left: 0; 96 | padding-right: 0; 97 | } 98 | @media screen and (max-width: 767px) { 99 | .mobile-grid-100:before, 100 | .mobile-grid-100:after { 101 | content: "."; 102 | display: block; 103 | overflow: hidden; 104 | visibility: hidden; 105 | font-size: 0; 106 | line-height: 0; 107 | width: 0; 108 | height: 0; 109 | } 110 | .mobile-grid-100:after { 111 | clear: both; 112 | } 113 | .mobile-push-5, 114 | .mobile-pull-5, 115 | .mobile-push-10, 116 | .mobile-pull-10, 117 | .mobile-push-15, 118 | .mobile-pull-15, 119 | .mobile-push-20, 120 | .mobile-pull-20, 121 | .mobile-push-25, 122 | .mobile-pull-25, 123 | .mobile-push-30, 124 | .mobile-pull-30, 125 | .mobile-push-35, 126 | .mobile-pull-35, 127 | .mobile-push-40, 128 | .mobile-pull-40, 129 | .mobile-push-45, 130 | .mobile-pull-45, 131 | .mobile-push-50, 132 | .mobile-pull-50, 133 | .mobile-push-55, 134 | .mobile-pull-55, 135 | .mobile-push-60, 136 | .mobile-pull-60, 137 | .mobile-push-65, 138 | .mobile-pull-65, 139 | .mobile-push-70, 140 | .mobile-pull-70, 141 | .mobile-push-75, 142 | .mobile-pull-75, 143 | .mobile-push-80, 144 | .mobile-pull-80, 145 | .mobile-push-85, 146 | .mobile-pull-85, 147 | .mobile-push-90, 148 | .mobile-pull-90, 149 | .mobile-push-95, 150 | .mobile-pull-95, 151 | .mobile-push-33, 152 | .mobile-pull-33, 153 | .mobile-push-66, 154 | .mobile-pull-66 { 155 | position: relative; 156 | } 157 | .hide-on-mobile { 158 | display: none !important; 159 | } 160 | .mobile-grid-5 { 161 | float: left; 162 | width: 5%; 163 | } 164 | .mobile-prefix-5 { 165 | margin-left: 5%; 166 | } 167 | .mobile-suffix-5 { 168 | margin-right: 5%; 169 | } 170 | .mobile-push-5 { 171 | left: 5%; 172 | } 173 | .mobile-pull-5 { 174 | left: -5%; 175 | } 176 | .mobile-grid-10 { 177 | float: left; 178 | width: 10%; 179 | } 180 | .mobile-prefix-10 { 181 | margin-left: 10%; 182 | } 183 | .mobile-suffix-10 { 184 | margin-right: 10%; 185 | } 186 | .mobile-push-10 { 187 | left: 10%; 188 | } 189 | .mobile-pull-10 { 190 | left: -10%; 191 | } 192 | .mobile-grid-15 { 193 | float: left; 194 | width: 15%; 195 | } 196 | .mobile-prefix-15 { 197 | margin-left: 15%; 198 | } 199 | .mobile-suffix-15 { 200 | margin-right: 15%; 201 | } 202 | .mobile-push-15 { 203 | left: 15%; 204 | } 205 | .mobile-pull-15 { 206 | left: -15%; 207 | } 208 | .mobile-grid-20 { 209 | float: left; 210 | width: 20%; 211 | } 212 | .mobile-prefix-20 { 213 | margin-left: 20%; 214 | } 215 | .mobile-suffix-20 { 216 | margin-right: 20%; 217 | } 218 | .mobile-push-20 { 219 | left: 20%; 220 | } 221 | .mobile-pull-20 { 222 | left: -20%; 223 | } 224 | .mobile-grid-25 { 225 | float: left; 226 | width: 25%; 227 | } 228 | .mobile-prefix-25 { 229 | margin-left: 25%; 230 | } 231 | .mobile-suffix-25 { 232 | margin-right: 25%; 233 | } 234 | .mobile-push-25 { 235 | left: 25%; 236 | } 237 | .mobile-pull-25 { 238 | left: -25%; 239 | } 240 | .mobile-grid-30 { 241 | float: left; 242 | width: 30%; 243 | } 244 | .mobile-prefix-30 { 245 | margin-left: 30%; 246 | } 247 | .mobile-suffix-30 { 248 | margin-right: 30%; 249 | } 250 | .mobile-push-30 { 251 | left: 30%; 252 | } 253 | .mobile-pull-30 { 254 | left: -30%; 255 | } 256 | .mobile-grid-35 { 257 | float: left; 258 | width: 35%; 259 | } 260 | .mobile-prefix-35 { 261 | margin-left: 35%; 262 | } 263 | .mobile-suffix-35 { 264 | margin-right: 35%; 265 | } 266 | .mobile-push-35 { 267 | left: 35%; 268 | } 269 | .mobile-pull-35 { 270 | left: -35%; 271 | } 272 | .mobile-grid-40 { 273 | float: left; 274 | width: 40%; 275 | } 276 | .mobile-prefix-40 { 277 | margin-left: 40%; 278 | } 279 | .mobile-suffix-40 { 280 | margin-right: 40%; 281 | } 282 | .mobile-push-40 { 283 | left: 40%; 284 | } 285 | .mobile-pull-40 { 286 | left: -40%; 287 | } 288 | .mobile-grid-45 { 289 | float: left; 290 | width: 45%; 291 | } 292 | .mobile-prefix-45 { 293 | margin-left: 45%; 294 | } 295 | .mobile-suffix-45 { 296 | margin-right: 45%; 297 | } 298 | .mobile-push-45 { 299 | left: 45%; 300 | } 301 | .mobile-pull-45 { 302 | left: -45%; 303 | } 304 | .mobile-grid-50 { 305 | float: left; 306 | width: 50%; 307 | } 308 | .mobile-prefix-50 { 309 | margin-left: 50%; 310 | } 311 | .mobile-suffix-50 { 312 | margin-right: 50%; 313 | } 314 | .mobile-push-50 { 315 | left: 50%; 316 | } 317 | .mobile-pull-50 { 318 | left: -50%; 319 | } 320 | .mobile-grid-55 { 321 | float: left; 322 | width: 55%; 323 | } 324 | .mobile-prefix-55 { 325 | margin-left: 55%; 326 | } 327 | .mobile-suffix-55 { 328 | margin-right: 55%; 329 | } 330 | .mobile-push-55 { 331 | left: 55%; 332 | } 333 | .mobile-pull-55 { 334 | left: -55%; 335 | } 336 | .mobile-grid-60 { 337 | float: left; 338 | width: 60%; 339 | } 340 | .mobile-prefix-60 { 341 | margin-left: 60%; 342 | } 343 | .mobile-suffix-60 { 344 | margin-right: 60%; 345 | } 346 | .mobile-push-60 { 347 | left: 60%; 348 | } 349 | .mobile-pull-60 { 350 | left: -60%; 351 | } 352 | .mobile-grid-65 { 353 | float: left; 354 | width: 65%; 355 | } 356 | .mobile-prefix-65 { 357 | margin-left: 65%; 358 | } 359 | .mobile-suffix-65 { 360 | margin-right: 65%; 361 | } 362 | .mobile-push-65 { 363 | left: 65%; 364 | } 365 | .mobile-pull-65 { 366 | left: -65%; 367 | } 368 | .mobile-grid-70 { 369 | float: left; 370 | width: 70%; 371 | } 372 | .mobile-prefix-70 { 373 | margin-left: 70%; 374 | } 375 | .mobile-suffix-70 { 376 | margin-right: 70%; 377 | } 378 | .mobile-push-70 { 379 | left: 70%; 380 | } 381 | .mobile-pull-70 { 382 | left: -70%; 383 | } 384 | .mobile-grid-75 { 385 | float: left; 386 | width: 75%; 387 | } 388 | .mobile-prefix-75 { 389 | margin-left: 75%; 390 | } 391 | .mobile-suffix-75 { 392 | margin-right: 75%; 393 | } 394 | .mobile-push-75 { 395 | left: 75%; 396 | } 397 | .mobile-pull-75 { 398 | left: -75%; 399 | } 400 | .mobile-grid-80 { 401 | float: left; 402 | width: 80%; 403 | } 404 | .mobile-prefix-80 { 405 | margin-left: 80%; 406 | } 407 | .mobile-suffix-80 { 408 | margin-right: 80%; 409 | } 410 | .mobile-push-80 { 411 | left: 80%; 412 | } 413 | .mobile-pull-80 { 414 | left: -80%; 415 | } 416 | .mobile-grid-85 { 417 | float: left; 418 | width: 85%; 419 | } 420 | .mobile-prefix-85 { 421 | margin-left: 85%; 422 | } 423 | .mobile-suffix-85 { 424 | margin-right: 85%; 425 | } 426 | .mobile-push-85 { 427 | left: 85%; 428 | } 429 | .mobile-pull-85 { 430 | left: -85%; 431 | } 432 | .mobile-grid-90 { 433 | float: left; 434 | width: 90%; 435 | } 436 | .mobile-prefix-90 { 437 | margin-left: 90%; 438 | } 439 | .mobile-suffix-90 { 440 | margin-right: 90%; 441 | } 442 | .mobile-push-90 { 443 | left: 90%; 444 | } 445 | .mobile-pull-90 { 446 | left: -90%; 447 | } 448 | .mobile-grid-95 { 449 | float: left; 450 | width: 95%; 451 | } 452 | .mobile-prefix-95 { 453 | margin-left: 95%; 454 | } 455 | .mobile-suffix-95 { 456 | margin-right: 95%; 457 | } 458 | .mobile-push-95 { 459 | left: 95%; 460 | } 461 | .mobile-pull-95 { 462 | left: -95%; 463 | } 464 | .mobile-grid-33 { 465 | float: left; 466 | width: 33.33333%; 467 | } 468 | .mobile-prefix-33 { 469 | margin-left: 33.33333%; 470 | } 471 | .mobile-suffix-33 { 472 | margin-right: 33.33333%; 473 | } 474 | .mobile-push-33 { 475 | left: 33.33333%; 476 | } 477 | .mobile-pull-33 { 478 | left: -33.33333%; 479 | } 480 | .mobile-grid-66 { 481 | float: left; 482 | width: 66.66667%; 483 | } 484 | .mobile-prefix-66 { 485 | margin-left: 66.66667%; 486 | } 487 | .mobile-suffix-66 { 488 | margin-right: 66.66667%; 489 | } 490 | .mobile-push-66 { 491 | left: 66.66667%; 492 | } 493 | .mobile-pull-66 { 494 | left: -66.66667%; 495 | } 496 | .mobile-grid-100 { 497 | clear: both; 498 | width: 100%; 499 | } 500 | } 501 | @media screen and (min-width: 768px) { 502 | .grid-100:before, 503 | .grid-100:after { 504 | content: "."; 505 | display: block; 506 | overflow: hidden; 507 | visibility: hidden; 508 | font-size: 0; 509 | line-height: 0; 510 | width: 0; 511 | height: 0; 512 | } 513 | .grid-100:after { 514 | clear: both; 515 | } 516 | .push-5, 517 | .pull-5, 518 | .push-10, 519 | .pull-10, 520 | .push-15, 521 | .pull-15, 522 | .push-20, 523 | .pull-20, 524 | .push-25, 525 | .pull-25, 526 | .push-30, 527 | .pull-30, 528 | .push-35, 529 | .pull-35, 530 | .push-40, 531 | .pull-40, 532 | .push-45, 533 | .pull-45, 534 | .push-50, 535 | .pull-50, 536 | .push-55, 537 | .pull-55, 538 | .push-60, 539 | .pull-60, 540 | .push-65, 541 | .pull-65, 542 | .push-70, 543 | .pull-70, 544 | .push-75, 545 | .pull-75, 546 | .push-80, 547 | .pull-80, 548 | .push-85, 549 | .pull-85, 550 | .push-90, 551 | .pull-90, 552 | .push-95, 553 | .pull-95, 554 | .push-33, 555 | .pull-33, 556 | .push-66, 557 | .pull-66 { 558 | position: relative; 559 | } 560 | .hide-on-desktop { 561 | display: none !important; 562 | } 563 | .grid-5 { 564 | float: left; 565 | width: 5%; 566 | } 567 | .prefix-5 { 568 | margin-left: 5%; 569 | } 570 | .suffix-5 { 571 | margin-right: 5%; 572 | } 573 | .push-5 { 574 | left: 5%; 575 | } 576 | .pull-5 { 577 | left: -5%; 578 | } 579 | .grid-10 { 580 | float: left; 581 | width: 10%; 582 | } 583 | .prefix-10 { 584 | margin-left: 10%; 585 | } 586 | .suffix-10 { 587 | margin-right: 10%; 588 | } 589 | .push-10 { 590 | left: 10%; 591 | } 592 | .pull-10 { 593 | left: -10%; 594 | } 595 | .grid-15 { 596 | float: left; 597 | width: 15%; 598 | } 599 | .prefix-15 { 600 | margin-left: 15%; 601 | } 602 | .suffix-15 { 603 | margin-right: 15%; 604 | } 605 | .push-15 { 606 | left: 15%; 607 | } 608 | .pull-15 { 609 | left: -15%; 610 | } 611 | .grid-20 { 612 | float: left; 613 | width: 20%; 614 | } 615 | .prefix-20 { 616 | margin-left: 20%; 617 | } 618 | .suffix-20 { 619 | margin-right: 20%; 620 | } 621 | .push-20 { 622 | left: 20%; 623 | } 624 | .pull-20 { 625 | left: -20%; 626 | } 627 | .grid-25 { 628 | float: left; 629 | width: 25%; 630 | } 631 | .prefix-25 { 632 | margin-left: 25%; 633 | } 634 | .suffix-25 { 635 | margin-right: 25%; 636 | } 637 | .push-25 { 638 | left: 25%; 639 | } 640 | .pull-25 { 641 | left: -25%; 642 | } 643 | .grid-30 { 644 | float: left; 645 | width: 30%; 646 | } 647 | .prefix-30 { 648 | margin-left: 30%; 649 | } 650 | .suffix-30 { 651 | margin-right: 30%; 652 | } 653 | .push-30 { 654 | left: 30%; 655 | } 656 | .pull-30 { 657 | left: -30%; 658 | } 659 | .grid-35 { 660 | float: left; 661 | width: 35%; 662 | } 663 | .prefix-35 { 664 | margin-left: 35%; 665 | } 666 | .suffix-35 { 667 | margin-right: 35%; 668 | } 669 | .push-35 { 670 | left: 35%; 671 | } 672 | .pull-35 { 673 | left: -35%; 674 | } 675 | .grid-40 { 676 | float: left; 677 | width: 40%; 678 | } 679 | .prefix-40 { 680 | margin-left: 40%; 681 | } 682 | .suffix-40 { 683 | margin-right: 40%; 684 | } 685 | .push-40 { 686 | left: 40%; 687 | } 688 | .pull-40 { 689 | left: -40%; 690 | } 691 | .grid-45 { 692 | float: left; 693 | width: 45%; 694 | } 695 | .prefix-45 { 696 | margin-left: 45%; 697 | } 698 | .suffix-45 { 699 | margin-right: 45%; 700 | } 701 | .push-45 { 702 | left: 45%; 703 | } 704 | .pull-45 { 705 | left: -45%; 706 | } 707 | .grid-50 { 708 | float: left; 709 | width: 50%; 710 | } 711 | .prefix-50 { 712 | margin-left: 50%; 713 | } 714 | .suffix-50 { 715 | margin-right: 50%; 716 | } 717 | .push-50 { 718 | left: 50%; 719 | } 720 | .pull-50 { 721 | left: -50%; 722 | } 723 | .grid-55 { 724 | float: left; 725 | width: 55%; 726 | } 727 | .prefix-55 { 728 | margin-left: 55%; 729 | } 730 | .suffix-55 { 731 | margin-right: 55%; 732 | } 733 | .push-55 { 734 | left: 55%; 735 | } 736 | .pull-55 { 737 | left: -55%; 738 | } 739 | .grid-60 { 740 | float: left; 741 | width: 60%; 742 | } 743 | .prefix-60 { 744 | margin-left: 60%; 745 | } 746 | .suffix-60 { 747 | margin-right: 60%; 748 | } 749 | .push-60 { 750 | left: 60%; 751 | } 752 | .pull-60 { 753 | left: -60%; 754 | } 755 | .grid-65 { 756 | float: left; 757 | width: 65%; 758 | } 759 | .prefix-65 { 760 | margin-left: 65%; 761 | } 762 | .suffix-65 { 763 | margin-right: 65%; 764 | } 765 | .push-65 { 766 | left: 65%; 767 | } 768 | .pull-65 { 769 | left: -65%; 770 | } 771 | .grid-70 { 772 | float: left; 773 | width: 70%; 774 | } 775 | .prefix-70 { 776 | margin-left: 70%; 777 | } 778 | .suffix-70 { 779 | margin-right: 70%; 780 | } 781 | .push-70 { 782 | left: 70%; 783 | } 784 | .pull-70 { 785 | left: -70%; 786 | } 787 | .grid-75 { 788 | float: left; 789 | width: 75%; 790 | } 791 | .prefix-75 { 792 | margin-left: 75%; 793 | } 794 | .suffix-75 { 795 | margin-right: 75%; 796 | } 797 | .push-75 { 798 | left: 75%; 799 | } 800 | .pull-75 { 801 | left: -75%; 802 | } 803 | .grid-80 { 804 | float: left; 805 | width: 80%; 806 | } 807 | .prefix-80 { 808 | margin-left: 80%; 809 | } 810 | .suffix-80 { 811 | margin-right: 80%; 812 | } 813 | .push-80 { 814 | left: 80%; 815 | } 816 | .pull-80 { 817 | left: -80%; 818 | } 819 | .grid-85 { 820 | float: left; 821 | width: 85%; 822 | } 823 | .prefix-85 { 824 | margin-left: 85%; 825 | } 826 | .suffix-85 { 827 | margin-right: 85%; 828 | } 829 | .push-85 { 830 | left: 85%; 831 | } 832 | .pull-85 { 833 | left: -85%; 834 | } 835 | .grid-90 { 836 | float: left; 837 | width: 90%; 838 | } 839 | .prefix-90 { 840 | margin-left: 90%; 841 | } 842 | .suffix-90 { 843 | margin-right: 90%; 844 | } 845 | .push-90 { 846 | left: 90%; 847 | } 848 | .pull-90 { 849 | left: -90%; 850 | } 851 | .grid-95 { 852 | float: left; 853 | width: 95%; 854 | } 855 | .prefix-95 { 856 | margin-left: 95%; 857 | } 858 | .suffix-95 { 859 | margin-right: 95%; 860 | } 861 | .push-95 { 862 | left: 95%; 863 | } 864 | .pull-95 { 865 | left: -95%; 866 | } 867 | .grid-33 { 868 | float: left; 869 | width: 33.33333%; 870 | } 871 | .prefix-33 { 872 | margin-left: 33.33333%; 873 | } 874 | .suffix-33 { 875 | margin-right: 33.33333%; 876 | } 877 | .push-33 { 878 | left: 33.33333%; 879 | } 880 | .pull-33 { 881 | left: -33.33333%; 882 | } 883 | .grid-66 { 884 | float: left; 885 | width: 66.66667%; 886 | } 887 | .prefix-66 { 888 | margin-left: 66.66667%; 889 | } 890 | .suffix-66 { 891 | margin-right: 66.66667%; 892 | } 893 | .push-66 { 894 | left: 66.66667%; 895 | } 896 | .pull-66 { 897 | left: -66.66667%; 898 | } 899 | .grid-100 { 900 | clear: both; 901 | width: 100%; 902 | } 903 | } -------------------------------------------------------------------------------- /public/css/main.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | /*! 3 | Copyright © Gogs 2014, all right reversed. 4 | */ 5 | /* ============================================ */ 6 | /* This file has a mobile-to-desktop breakpoint */ 7 | /* ============================================ */ 8 | @media screen and (max-width: 400px) { 9 | @-ms-viewport { 10 | width: 320px; } } 11 | .clear { 12 | clear: both; 13 | display: block; 14 | overflow: hidden; 15 | visibility: hidden; 16 | width: 0; 17 | height: 0; } 18 | 19 | .grid-container:before, 20 | .clearfix:before, 21 | .grid-container:after, 22 | .clearfix:after { 23 | content: "."; 24 | display: block; 25 | overflow: hidden; 26 | visibility: hidden; 27 | font-size: 0; 28 | line-height: 0; 29 | width: 0; 30 | height: 0; } 31 | 32 | .grid-container:after, 33 | .clearfix:after { 34 | clear: both; } 35 | 36 | .grid-container { 37 | margin-left: auto; 38 | margin-right: auto; 39 | max-width: 1200px; 40 | padding-left: 10px; 41 | padding-right: 10px; } 42 | 43 | .grid-5, 44 | .mobile-grid-5, 45 | .grid-10, 46 | .mobile-grid-10, 47 | .grid-15, 48 | .mobile-grid-15, 49 | .grid-20, 50 | .mobile-grid-20, 51 | .grid-25, 52 | .mobile-grid-25, 53 | .grid-30, 54 | .mobile-grid-30, 55 | .grid-35, 56 | .mobile-grid-35, 57 | .grid-40, 58 | .mobile-grid-40, 59 | .grid-45, 60 | .mobile-grid-45, 61 | .grid-50, 62 | .mobile-grid-50, 63 | .grid-55, 64 | .mobile-grid-55, 65 | .grid-60, 66 | .mobile-grid-60, 67 | .grid-65, 68 | .mobile-grid-65, 69 | .grid-70, 70 | .mobile-grid-70, 71 | .grid-75, 72 | .mobile-grid-75, 73 | .grid-80, 74 | .mobile-grid-80, 75 | .grid-85, 76 | .mobile-grid-85, 77 | .grid-90, 78 | .mobile-grid-90, 79 | .grid-95, 80 | .mobile-grid-95, 81 | .grid-100, 82 | .mobile-grid-100, 83 | .grid-33, 84 | .mobile-grid-33, 85 | .grid-66, 86 | .mobile-grid-66 { 87 | -moz-box-sizing: border-box; 88 | -webkit-box-sizing: border-box; 89 | box-sizing: border-box; 90 | padding-left: 10px; 91 | padding-right: 10px; } 92 | 93 | .grid-parent { 94 | padding-left: 0; 95 | padding-right: 0; } 96 | 97 | @media screen and (max-width: 767px) { 98 | .mobile-grid-100:before, 99 | .mobile-grid-100:after { 100 | content: "."; 101 | display: block; 102 | overflow: hidden; 103 | visibility: hidden; 104 | font-size: 0; 105 | line-height: 0; 106 | width: 0; 107 | height: 0; } 108 | 109 | .mobile-grid-100:after { 110 | clear: both; } 111 | 112 | .mobile-push-5, 113 | .mobile-pull-5, 114 | .mobile-push-10, 115 | .mobile-pull-10, 116 | .mobile-push-15, 117 | .mobile-pull-15, 118 | .mobile-push-20, 119 | .mobile-pull-20, 120 | .mobile-push-25, 121 | .mobile-pull-25, 122 | .mobile-push-30, 123 | .mobile-pull-30, 124 | .mobile-push-35, 125 | .mobile-pull-35, 126 | .mobile-push-40, 127 | .mobile-pull-40, 128 | .mobile-push-45, 129 | .mobile-pull-45, 130 | .mobile-push-50, 131 | .mobile-pull-50, 132 | .mobile-push-55, 133 | .mobile-pull-55, 134 | .mobile-push-60, 135 | .mobile-pull-60, 136 | .mobile-push-65, 137 | .mobile-pull-65, 138 | .mobile-push-70, 139 | .mobile-pull-70, 140 | .mobile-push-75, 141 | .mobile-pull-75, 142 | .mobile-push-80, 143 | .mobile-pull-80, 144 | .mobile-push-85, 145 | .mobile-pull-85, 146 | .mobile-push-90, 147 | .mobile-pull-90, 148 | .mobile-push-95, 149 | .mobile-pull-95, 150 | .mobile-push-33, 151 | .mobile-pull-33, 152 | .mobile-push-66, 153 | .mobile-pull-66 { 154 | position: relative; } 155 | 156 | .hide-on-mobile { 157 | display: none !important; } 158 | 159 | .mobile-grid-5 { 160 | float: left; 161 | width: 5%; } 162 | 163 | .mobile-prefix-5 { 164 | margin-left: 5%; } 165 | 166 | .mobile-suffix-5 { 167 | margin-right: 5%; } 168 | 169 | .mobile-push-5 { 170 | left: 5%; } 171 | 172 | .mobile-pull-5 { 173 | left: -5%; } 174 | 175 | .mobile-grid-10 { 176 | float: left; 177 | width: 10%; } 178 | 179 | .mobile-prefix-10 { 180 | margin-left: 10%; } 181 | 182 | .mobile-suffix-10 { 183 | margin-right: 10%; } 184 | 185 | .mobile-push-10 { 186 | left: 10%; } 187 | 188 | .mobile-pull-10 { 189 | left: -10%; } 190 | 191 | .mobile-grid-15 { 192 | float: left; 193 | width: 15%; } 194 | 195 | .mobile-prefix-15 { 196 | margin-left: 15%; } 197 | 198 | .mobile-suffix-15 { 199 | margin-right: 15%; } 200 | 201 | .mobile-push-15 { 202 | left: 15%; } 203 | 204 | .mobile-pull-15 { 205 | left: -15%; } 206 | 207 | .mobile-grid-20 { 208 | float: left; 209 | width: 20%; } 210 | 211 | .mobile-prefix-20 { 212 | margin-left: 20%; } 213 | 214 | .mobile-suffix-20 { 215 | margin-right: 20%; } 216 | 217 | .mobile-push-20 { 218 | left: 20%; } 219 | 220 | .mobile-pull-20 { 221 | left: -20%; } 222 | 223 | .mobile-grid-25 { 224 | float: left; 225 | width: 25%; } 226 | 227 | .mobile-prefix-25 { 228 | margin-left: 25%; } 229 | 230 | .mobile-suffix-25 { 231 | margin-right: 25%; } 232 | 233 | .mobile-push-25 { 234 | left: 25%; } 235 | 236 | .mobile-pull-25 { 237 | left: -25%; } 238 | 239 | .mobile-grid-30 { 240 | float: left; 241 | width: 30%; } 242 | 243 | .mobile-prefix-30 { 244 | margin-left: 30%; } 245 | 246 | .mobile-suffix-30 { 247 | margin-right: 30%; } 248 | 249 | .mobile-push-30 { 250 | left: 30%; } 251 | 252 | .mobile-pull-30 { 253 | left: -30%; } 254 | 255 | .mobile-grid-35 { 256 | float: left; 257 | width: 35%; } 258 | 259 | .mobile-prefix-35 { 260 | margin-left: 35%; } 261 | 262 | .mobile-suffix-35 { 263 | margin-right: 35%; } 264 | 265 | .mobile-push-35 { 266 | left: 35%; } 267 | 268 | .mobile-pull-35 { 269 | left: -35%; } 270 | 271 | .mobile-grid-40 { 272 | float: left; 273 | width: 40%; } 274 | 275 | .mobile-prefix-40 { 276 | margin-left: 40%; } 277 | 278 | .mobile-suffix-40 { 279 | margin-right: 40%; } 280 | 281 | .mobile-push-40 { 282 | left: 40%; } 283 | 284 | .mobile-pull-40 { 285 | left: -40%; } 286 | 287 | .mobile-grid-45 { 288 | float: left; 289 | width: 45%; } 290 | 291 | .mobile-prefix-45 { 292 | margin-left: 45%; } 293 | 294 | .mobile-suffix-45 { 295 | margin-right: 45%; } 296 | 297 | .mobile-push-45 { 298 | left: 45%; } 299 | 300 | .mobile-pull-45 { 301 | left: -45%; } 302 | 303 | .mobile-grid-50 { 304 | float: left; 305 | width: 50%; } 306 | 307 | .mobile-prefix-50 { 308 | margin-left: 50%; } 309 | 310 | .mobile-suffix-50 { 311 | margin-right: 50%; } 312 | 313 | .mobile-push-50 { 314 | left: 50%; } 315 | 316 | .mobile-pull-50 { 317 | left: -50%; } 318 | 319 | .mobile-grid-55 { 320 | float: left; 321 | width: 55%; } 322 | 323 | .mobile-prefix-55 { 324 | margin-left: 55%; } 325 | 326 | .mobile-suffix-55 { 327 | margin-right: 55%; } 328 | 329 | .mobile-push-55 { 330 | left: 55%; } 331 | 332 | .mobile-pull-55 { 333 | left: -55%; } 334 | 335 | .mobile-grid-60 { 336 | float: left; 337 | width: 60%; } 338 | 339 | .mobile-prefix-60 { 340 | margin-left: 60%; } 341 | 342 | .mobile-suffix-60 { 343 | margin-right: 60%; } 344 | 345 | .mobile-push-60 { 346 | left: 60%; } 347 | 348 | .mobile-pull-60 { 349 | left: -60%; } 350 | 351 | .mobile-grid-65 { 352 | float: left; 353 | width: 65%; } 354 | 355 | .mobile-prefix-65 { 356 | margin-left: 65%; } 357 | 358 | .mobile-suffix-65 { 359 | margin-right: 65%; } 360 | 361 | .mobile-push-65 { 362 | left: 65%; } 363 | 364 | .mobile-pull-65 { 365 | left: -65%; } 366 | 367 | .mobile-grid-70 { 368 | float: left; 369 | width: 70%; } 370 | 371 | .mobile-prefix-70 { 372 | margin-left: 70%; } 373 | 374 | .mobile-suffix-70 { 375 | margin-right: 70%; } 376 | 377 | .mobile-push-70 { 378 | left: 70%; } 379 | 380 | .mobile-pull-70 { 381 | left: -70%; } 382 | 383 | .mobile-grid-75 { 384 | float: left; 385 | width: 75%; } 386 | 387 | .mobile-prefix-75 { 388 | margin-left: 75%; } 389 | 390 | .mobile-suffix-75 { 391 | margin-right: 75%; } 392 | 393 | .mobile-push-75 { 394 | left: 75%; } 395 | 396 | .mobile-pull-75 { 397 | left: -75%; } 398 | 399 | .mobile-grid-80 { 400 | float: left; 401 | width: 80%; } 402 | 403 | .mobile-prefix-80 { 404 | margin-left: 80%; } 405 | 406 | .mobile-suffix-80 { 407 | margin-right: 80%; } 408 | 409 | .mobile-push-80 { 410 | left: 80%; } 411 | 412 | .mobile-pull-80 { 413 | left: -80%; } 414 | 415 | .mobile-grid-85 { 416 | float: left; 417 | width: 85%; } 418 | 419 | .mobile-prefix-85 { 420 | margin-left: 85%; } 421 | 422 | .mobile-suffix-85 { 423 | margin-right: 85%; } 424 | 425 | .mobile-push-85 { 426 | left: 85%; } 427 | 428 | .mobile-pull-85 { 429 | left: -85%; } 430 | 431 | .mobile-grid-90 { 432 | float: left; 433 | width: 90%; } 434 | 435 | .mobile-prefix-90 { 436 | margin-left: 90%; } 437 | 438 | .mobile-suffix-90 { 439 | margin-right: 90%; } 440 | 441 | .mobile-push-90 { 442 | left: 90%; } 443 | 444 | .mobile-pull-90 { 445 | left: -90%; } 446 | 447 | .mobile-grid-95 { 448 | float: left; 449 | width: 95%; } 450 | 451 | .mobile-prefix-95 { 452 | margin-left: 95%; } 453 | 454 | .mobile-suffix-95 { 455 | margin-right: 95%; } 456 | 457 | .mobile-push-95 { 458 | left: 95%; } 459 | 460 | .mobile-pull-95 { 461 | left: -95%; } 462 | 463 | .mobile-grid-33 { 464 | float: left; 465 | width: 33.33333%; } 466 | 467 | .mobile-prefix-33 { 468 | margin-left: 33.33333%; } 469 | 470 | .mobile-suffix-33 { 471 | margin-right: 33.33333%; } 472 | 473 | .mobile-push-33 { 474 | left: 33.33333%; } 475 | 476 | .mobile-pull-33 { 477 | left: -33.33333%; } 478 | 479 | .mobile-grid-66 { 480 | float: left; 481 | width: 66.66667%; } 482 | 483 | .mobile-prefix-66 { 484 | margin-left: 66.66667%; } 485 | 486 | .mobile-suffix-66 { 487 | margin-right: 66.66667%; } 488 | 489 | .mobile-push-66 { 490 | left: 66.66667%; } 491 | 492 | .mobile-pull-66 { 493 | left: -66.66667%; } 494 | 495 | .mobile-grid-100 { 496 | clear: both; 497 | width: 100%; } } 498 | @media screen and (min-width: 768px) { 499 | .grid-100:before, 500 | .grid-100:after { 501 | content: "."; 502 | display: block; 503 | overflow: hidden; 504 | visibility: hidden; 505 | font-size: 0; 506 | line-height: 0; 507 | width: 0; 508 | height: 0; } 509 | 510 | .grid-100:after { 511 | clear: both; } 512 | 513 | .push-5, 514 | .pull-5, 515 | .push-10, 516 | .pull-10, 517 | .push-15, 518 | .pull-15, 519 | .push-20, 520 | .pull-20, 521 | .push-25, 522 | .pull-25, 523 | .push-30, 524 | .pull-30, 525 | .push-35, 526 | .pull-35, 527 | .push-40, 528 | .pull-40, 529 | .push-45, 530 | .pull-45, 531 | .push-50, 532 | .pull-50, 533 | .push-55, 534 | .pull-55, 535 | .push-60, 536 | .pull-60, 537 | .push-65, 538 | .pull-65, 539 | .push-70, 540 | .pull-70, 541 | .push-75, 542 | .pull-75, 543 | .push-80, 544 | .pull-80, 545 | .push-85, 546 | .pull-85, 547 | .push-90, 548 | .pull-90, 549 | .push-95, 550 | .pull-95, 551 | .push-33, 552 | .pull-33, 553 | .push-66, 554 | .pull-66 { 555 | position: relative; } 556 | 557 | .hide-on-desktop { 558 | display: none !important; } 559 | 560 | .grid-5 { 561 | float: left; 562 | width: 5%; } 563 | 564 | .prefix-5 { 565 | margin-left: 5%; } 566 | 567 | .suffix-5 { 568 | margin-right: 5%; } 569 | 570 | .push-5 { 571 | left: 5%; } 572 | 573 | .pull-5 { 574 | left: -5%; } 575 | 576 | .grid-10 { 577 | float: left; 578 | width: 10%; } 579 | 580 | .prefix-10 { 581 | margin-left: 10%; } 582 | 583 | .suffix-10 { 584 | margin-right: 10%; } 585 | 586 | .push-10 { 587 | left: 10%; } 588 | 589 | .pull-10 { 590 | left: -10%; } 591 | 592 | .grid-15 { 593 | float: left; 594 | width: 15%; } 595 | 596 | .prefix-15 { 597 | margin-left: 15%; } 598 | 599 | .suffix-15 { 600 | margin-right: 15%; } 601 | 602 | .push-15 { 603 | left: 15%; } 604 | 605 | .pull-15 { 606 | left: -15%; } 607 | 608 | .grid-20 { 609 | float: left; 610 | width: 20%; } 611 | 612 | .prefix-20 { 613 | margin-left: 20%; } 614 | 615 | .suffix-20 { 616 | margin-right: 20%; } 617 | 618 | .push-20 { 619 | left: 20%; } 620 | 621 | .pull-20 { 622 | left: -20%; } 623 | 624 | .grid-25 { 625 | float: left; 626 | width: 25%; } 627 | 628 | .prefix-25 { 629 | margin-left: 25%; } 630 | 631 | .suffix-25 { 632 | margin-right: 25%; } 633 | 634 | .push-25 { 635 | left: 25%; } 636 | 637 | .pull-25 { 638 | left: -25%; } 639 | 640 | .grid-30 { 641 | float: left; 642 | width: 30%; } 643 | 644 | .prefix-30 { 645 | margin-left: 30%; } 646 | 647 | .suffix-30 { 648 | margin-right: 30%; } 649 | 650 | .push-30 { 651 | left: 30%; } 652 | 653 | .pull-30 { 654 | left: -30%; } 655 | 656 | .grid-35 { 657 | float: left; 658 | width: 35%; } 659 | 660 | .prefix-35 { 661 | margin-left: 35%; } 662 | 663 | .suffix-35 { 664 | margin-right: 35%; } 665 | 666 | .push-35 { 667 | left: 35%; } 668 | 669 | .pull-35 { 670 | left: -35%; } 671 | 672 | .grid-40 { 673 | float: left; 674 | width: 40%; } 675 | 676 | .prefix-40 { 677 | margin-left: 40%; } 678 | 679 | .suffix-40 { 680 | margin-right: 40%; } 681 | 682 | .push-40 { 683 | left: 40%; } 684 | 685 | .pull-40 { 686 | left: -40%; } 687 | 688 | .grid-45 { 689 | float: left; 690 | width: 45%; } 691 | 692 | .prefix-45 { 693 | margin-left: 45%; } 694 | 695 | .suffix-45 { 696 | margin-right: 45%; } 697 | 698 | .push-45 { 699 | left: 45%; } 700 | 701 | .pull-45 { 702 | left: -45%; } 703 | 704 | .grid-50 { 705 | float: left; 706 | width: 50%; } 707 | 708 | .prefix-50 { 709 | margin-left: 50%; } 710 | 711 | .suffix-50 { 712 | margin-right: 50%; } 713 | 714 | .push-50 { 715 | left: 50%; } 716 | 717 | .pull-50 { 718 | left: -50%; } 719 | 720 | .grid-55 { 721 | float: left; 722 | width: 55%; } 723 | 724 | .prefix-55 { 725 | margin-left: 55%; } 726 | 727 | .suffix-55 { 728 | margin-right: 55%; } 729 | 730 | .push-55 { 731 | left: 55%; } 732 | 733 | .pull-55 { 734 | left: -55%; } 735 | 736 | .grid-60 { 737 | float: left; 738 | width: 60%; } 739 | 740 | .prefix-60 { 741 | margin-left: 60%; } 742 | 743 | .suffix-60 { 744 | margin-right: 60%; } 745 | 746 | .push-60 { 747 | left: 60%; } 748 | 749 | .pull-60 { 750 | left: -60%; } 751 | 752 | .grid-65 { 753 | float: left; 754 | width: 65%; } 755 | 756 | .prefix-65 { 757 | margin-left: 65%; } 758 | 759 | .suffix-65 { 760 | margin-right: 65%; } 761 | 762 | .push-65 { 763 | left: 65%; } 764 | 765 | .pull-65 { 766 | left: -65%; } 767 | 768 | .grid-70 { 769 | float: left; 770 | width: 70%; } 771 | 772 | .prefix-70 { 773 | margin-left: 70%; } 774 | 775 | .suffix-70 { 776 | margin-right: 70%; } 777 | 778 | .push-70 { 779 | left: 70%; } 780 | 781 | .pull-70 { 782 | left: -70%; } 783 | 784 | .grid-75 { 785 | float: left; 786 | width: 75%; } 787 | 788 | .prefix-75 { 789 | margin-left: 75%; } 790 | 791 | .suffix-75 { 792 | margin-right: 75%; } 793 | 794 | .push-75 { 795 | left: 75%; } 796 | 797 | .pull-75 { 798 | left: -75%; } 799 | 800 | .grid-80 { 801 | float: left; 802 | width: 80%; } 803 | 804 | .prefix-80 { 805 | margin-left: 80%; } 806 | 807 | .suffix-80 { 808 | margin-right: 80%; } 809 | 810 | .push-80 { 811 | left: 80%; } 812 | 813 | .pull-80 { 814 | left: -80%; } 815 | 816 | .grid-85 { 817 | float: left; 818 | width: 85%; } 819 | 820 | .prefix-85 { 821 | margin-left: 85%; } 822 | 823 | .suffix-85 { 824 | margin-right: 85%; } 825 | 826 | .push-85 { 827 | left: 85%; } 828 | 829 | .pull-85 { 830 | left: -85%; } 831 | 832 | .grid-90 { 833 | float: left; 834 | width: 90%; } 835 | 836 | .prefix-90 { 837 | margin-left: 90%; } 838 | 839 | .suffix-90 { 840 | margin-right: 90%; } 841 | 842 | .push-90 { 843 | left: 90%; } 844 | 845 | .pull-90 { 846 | left: -90%; } 847 | 848 | .grid-95 { 849 | float: left; 850 | width: 95%; } 851 | 852 | .prefix-95 { 853 | margin-left: 95%; } 854 | 855 | .suffix-95 { 856 | margin-right: 95%; } 857 | 858 | .push-95 { 859 | left: 95%; } 860 | 861 | .pull-95 { 862 | left: -95%; } 863 | 864 | .grid-33 { 865 | float: left; 866 | width: 33.33333%; } 867 | 868 | .prefix-33 { 869 | margin-left: 33.33333%; } 870 | 871 | .suffix-33 { 872 | margin-right: 33.33333%; } 873 | 874 | .push-33 { 875 | left: 33.33333%; } 876 | 877 | .pull-33 { 878 | left: -33.33333%; } 879 | 880 | .grid-66 { 881 | float: left; 882 | width: 66.66667%; } 883 | 884 | .prefix-66 { 885 | margin-left: 66.66667%; } 886 | 887 | .suffix-66 { 888 | margin-right: 66.66667%; } 889 | 890 | .push-66 { 891 | left: 66.66667%; } 892 | 893 | .pull-66 { 894 | left: -66.66667%; } 895 | 896 | .grid-100 { 897 | clear: both; 898 | width: 100%; } } 899 | /* Eric Meyer's Reset CSS v2.0 */ 900 | html, 901 | body, 902 | div, 903 | span, 904 | applet, 905 | object, 906 | iframe, 907 | h1, 908 | h2, 909 | h3, 910 | h4, 911 | h5, 912 | h6, 913 | p, 914 | blockquote, 915 | pre, 916 | a, 917 | abbr, 918 | acronym, 919 | address, 920 | big, 921 | cite, 922 | code, 923 | del, 924 | dfn, 925 | em, 926 | img, 927 | ins, 928 | kbd, 929 | q, 930 | s, 931 | samp, 932 | small, 933 | strike, 934 | sub, 935 | sup, 936 | tt, 937 | var, 938 | b, 939 | u, 940 | i, 941 | center, 942 | dl, 943 | dt, 944 | dd, 945 | ol, 946 | ul, 947 | li, 948 | fieldset, 949 | form, 950 | label, 951 | legend, 952 | caption, 953 | tfoot, 954 | article, 955 | aside, 956 | canvas, 957 | details, 958 | embed, 959 | figure, 960 | figcaption, 961 | footer, 962 | header, 963 | hgroup, 964 | menu, 965 | nav, 966 | output, 967 | ruby, 968 | section, 969 | summary, 970 | time, 971 | mark, 972 | audio, 973 | video { 974 | border: 0; 975 | font-size: 100%; 976 | font: inherit; 977 | vertical-align: baseline; 978 | margin: 0; 979 | padding: 0; } 980 | 981 | article, 982 | aside, 983 | details, 984 | figcaption, 985 | figure, 986 | footer, 987 | header, 988 | hgroup, 989 | menu, 990 | nav, 991 | section { 992 | display: block; } 993 | 994 | body { 995 | line-height: 1; } 996 | 997 | ol, 998 | ul { 999 | list-style: none; } 1000 | 1001 | blockquote, 1002 | q { 1003 | quotes: none; } 1004 | 1005 | blockquote:before, 1006 | blockquote:after, 1007 | q:before, 1008 | q:after { 1009 | content: none; } 1010 | 1011 | table { 1012 | border-collapse: collapse; 1013 | border-spacing: 0; } 1014 | 1015 | body { 1016 | font: normal 18px/1.4em 'Lato', sans-serif, Microsoft Yahei; 1017 | background: #EFEFEF; } 1018 | 1019 | a { 1020 | color: #D9453D; 1021 | text-decoration: none; } 1022 | 1023 | a:hover { 1024 | color: #FF635A; 1025 | text-decoration: underline; } 1026 | 1027 | b { 1028 | font-weight: bold; } 1029 | 1030 | p { 1031 | margin: 1em 0; } 1032 | 1033 | p:first-child { 1034 | margin-top: 0; } 1035 | 1036 | nav, 1037 | main { 1038 | -webkit-box-sizing: border-box; 1039 | -moz-box-sizing: border-box; 1040 | -o-box-sizing: border-box; 1041 | box-sizing: border-box; } 1042 | 1043 | nav { 1044 | z-index: 2; 1045 | padding: 10px 25px; 1046 | background: #428BCA; 1047 | color: #FFF; } 1048 | 1049 | #logo { 1050 | max-height: 65px; 1051 | vertical-align: middle; 1052 | margin-right: 50px; } 1053 | 1054 | #menu-link { 1055 | display: none; } 1056 | 1057 | nav a { 1058 | display: inline-block; 1059 | padding: 20px; 1060 | color: #C8E0FF; 1061 | transition: color .2s; } 1062 | 1063 | nav a:hover { 1064 | color: #FFF; 1065 | text-decoration: none; } 1066 | 1067 | iframe { 1068 | width: 100px; 1069 | height: 1.5em; 1070 | vertical-align: middle; 1071 | margin-bottom: 15px; } 1072 | 1073 | #lang { 1074 | float: right; 1075 | margin-top: 24px; } 1076 | 1077 | h1, 1078 | h2 { 1079 | font-family: 'PT Sans Narrow', sans-serif; 1080 | line-height: 1.25em; } 1081 | 1082 | h1 { 1083 | font-size: 54px; 1084 | font-weight: bold; } 1085 | 1086 | h2 { 1087 | font-size: 40px; 1088 | margin-bottom: .5em; } 1089 | 1090 | main { 1091 | position: relative; 1092 | z-index: 1; } 1093 | 1094 | main section { 1095 | padding: 50px 0; } 1096 | 1097 | main > .grid-container:first-child { 1098 | margin: 30px auto; } 1099 | 1100 | .side-nav { 1101 | font-size: 14px; 1102 | line-height: 1em; } 1103 | 1104 | .side-nav ol, 1105 | .side-nav ul { 1106 | list-style-type: none; } 1107 | 1108 | .side-nav li.group { 1109 | margin-left: 0; } 1110 | 1111 | .side-nav .section { 1112 | font-weight: bold; 1113 | color: #666; 1114 | margin-top: 1em; } 1115 | 1116 | .content { 1117 | background: #FFF; 1118 | box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); } 1119 | 1120 | article { 1121 | padding: 3%; } 1122 | 1123 | button, 1124 | .button, 1125 | input[type=button] { 1126 | padding: 10px 25px; 1127 | border-radius: 5px; 1128 | color: #FFF; 1129 | margin-right: 10px; 1130 | margin-top: 5px; 1131 | margin-bottom: 5px; 1132 | display: inline-block; 1133 | transition: background .2s; } 1134 | 1135 | button:hover, 1136 | .button:hover, 1137 | input[type=button]:hover { 1138 | color: #FFF; 1139 | text-decoration: none; } 1140 | 1141 | .blue { 1142 | background: #428BCA; } 1143 | 1144 | .blue:hover { 1145 | background: #539CDB; } 1146 | 1147 | .darkblue { 1148 | background: #285370; } 1149 | 1150 | .darkblue:hover { 1151 | background: #276996; } 1152 | 1153 | .green { 1154 | background: #65AD4E; } 1155 | 1156 | .green:hover { 1157 | background: #71BF57; } 1158 | 1159 | .red { 1160 | background: #DB3F36; } 1161 | 1162 | .red:hover { 1163 | background: #C4362E; } 1164 | 1165 | .clear { 1166 | border: 0; 1167 | padding: 0; 1168 | margin: 0; 1169 | clear: both; } 1170 | 1171 | code { 1172 | font-size: 13px; 1173 | font-family: 'Monaco', monospace; 1174 | padding: 3px 5px; 1175 | background-color: rgba(0, 0, 0, 0.05); 1176 | border-radius: 3px; } 1177 | 1178 | ul, 1179 | ol { 1180 | margin: .5em 0; } 1181 | 1182 | ul:first-child, 1183 | ol:first-child { 1184 | margin-top: 0; } 1185 | 1186 | ul { 1187 | list-style-type: disc; } 1188 | 1189 | ol { 1190 | list-style-type: decimal; } 1191 | 1192 | li { 1193 | margin-left: 2em; } 1194 | 1195 | .scroll-help { 1196 | font-size: 18px; 1197 | text-align: center; 1198 | margin-bottom: .25em; 1199 | color: #AAA; 1200 | font-style: italic; } 1201 | 1202 | .scroll-help .fa { 1203 | margin: 0 10px; } 1204 | 1205 | .nowrap { 1206 | white-space: nowrap; } 1207 | 1208 | .text-left { 1209 | text-align: left; } 1210 | 1211 | .text-center { 1212 | text-align: center; } 1213 | 1214 | .text-right { 1215 | text-align: right; } 1216 | 1217 | .hide-on-wide { 1218 | display: none; } 1219 | 1220 | .block { 1221 | display: block; } 1222 | 1223 | footer { 1224 | padding: 50px 0; 1225 | background: #222; 1226 | color: #DDD; 1227 | font-size: 16px; } 1228 | 1229 | footer .block { 1230 | color: #DDD; } 1231 | 1232 | footer .white { 1233 | color: #DDD; } 1234 | 1235 | footer a.white:hover { 1236 | color: #FFF; 1237 | text-decoration: none; } 1238 | 1239 | footer img { 1240 | vertical-align: middle; } 1241 | 1242 | footer .button { 1243 | font-size: 18px; } 1244 | 1245 | #footer-col-2 { 1246 | text-align: center; } 1247 | 1248 | #footer-col-3 { 1249 | text-align: right; } 1250 | 1251 | .social-media a { 1252 | display: inline-block; 1253 | border-radius: 2px; 1254 | padding: 3px 8px; 1255 | text-decoration: none; 1256 | color: #FFF; 1257 | font-size: 18px; 1258 | text-align: center; 1259 | margin: 0 3px; } 1260 | 1261 | .social-media .github { 1262 | background: #AAA; } 1263 | 1264 | .social-media .github:hover { 1265 | background: #CCC; } 1266 | 1267 | .social-media .twitter { 1268 | background: #00ACED; } 1269 | 1270 | .social-media .twitter:hover { 1271 | background: #21C2FF; } 1272 | 1273 | .social-media .google { 1274 | background: #C03D20; } 1275 | 1276 | .social-media .google:hover { 1277 | background: #D56060; } 1278 | 1279 | .social-media .weibo { 1280 | background: #3B5998; } 1281 | 1282 | .social-media .weibo:hover { 1283 | background: #4C70BA; } 1284 | 1285 | .sep { 1286 | width: 30%; 1287 | max-width: 250px; 1288 | border: 0; 1289 | background: none; 1290 | border-top: 1px dotted #AAA; 1291 | margin: 35px auto; } 1292 | 1293 | @media (max-width: 1200px) { 1294 | h2 { 1295 | font-size: 36px; } 1296 | 1297 | main section { 1298 | padding: 35px 0; } } 1299 | @media (max-width: 860px) { 1300 | #logo { 1301 | margin-right: 15px; } 1302 | 1303 | nav a { 1304 | font-size: 14px; 1305 | padding: 20px 10px; } 1306 | 1307 | footer { 1308 | font-size: 14px; } } 1309 | @media (max-width: 767px) { 1310 | #get-started-buttons { 1311 | text-align: center !important; } 1312 | 1313 | footer div { 1314 | text-align: center !important; } 1315 | 1316 | footer .button { 1317 | padding: 5px 10px; 1318 | margin-top: 20px; 1319 | font-size: 14px; } 1320 | 1321 | #footer-col-1 { 1322 | margin-bottom: 20px; } 1323 | 1324 | #footer-col-2 { 1325 | text-align: center; } 1326 | 1327 | #footer-col-3 { 1328 | text-align: right; } 1329 | 1330 | article { 1331 | margin-top: 50px; } } 1332 | @media (min-width: 651px) { 1333 | #wide-nav { 1334 | display: inline-block !important; } } 1335 | @media (max-width: 650px) { 1336 | #logo { 1337 | float: left; } 1338 | 1339 | nav { 1340 | text-align: right !important; } 1341 | 1342 | nav a { 1343 | font-size: 16px; } 1344 | 1345 | #menu-link { 1346 | display: inline-block; } 1347 | 1348 | #lang { 1349 | float: none; } 1350 | 1351 | #wide-nav { 1352 | display: none; } 1353 | 1354 | #wide-nav a { 1355 | text-align: left; 1356 | display: block; 1357 | padding: 8px; 1358 | border-bottom: 1px solid #5DA2CF; } 1359 | 1360 | h1 { 1361 | font-size: 42px; } 1362 | 1363 | h2 { 1364 | font-size: 32px; } 1365 | 1366 | article { 1367 | font-size: 16px; } 1368 | 1369 | .hide-on-wide { 1370 | display: inline-block; } } 1371 | #disqus_thread { 1372 | margin-top: 20px; } 1373 | 1374 | body { 1375 | background: #FFF; } 1376 | 1377 | #logo { 1378 | display: none; } 1379 | 1380 | nav { 1381 | text-align: center; } 1382 | 1383 | h1 { 1384 | font-size: 98px; } 1385 | 1386 | h2 { 1387 | font-size: 56px; } 1388 | 1389 | #home-link { 1390 | display: none; } 1391 | 1392 | #home-logo { 1393 | max-width: 250px; 1394 | margin-top: 30px; 1395 | margin-right: 50px; 1396 | float: left; } 1397 | 1398 | #promo-area { 1399 | padding-bottom: 50px; 1400 | padding-top: 0; } 1401 | 1402 | #promo-area h1, 1403 | #promo-area h2 { 1404 | text-shadow: 0 2px 1px rgba(0, 0, 0, 0.5); } 1405 | 1406 | #promo-area { 1407 | background: #428BCA; 1408 | color: #FFF; } 1409 | 1410 | #promo-container { 1411 | margin-left: 300px; } 1412 | 1413 | .points { 1414 | color: #666; } 1415 | 1416 | .points b { 1417 | color: #000; 1418 | font-size: 20px; 1419 | display: inline-block; } 1420 | 1421 | .points .fa { 1422 | color: #D9453D; 1423 | /*#2585D1;*/ 1424 | font-size: 52px; 1425 | margin-right: 10px; 1426 | vertical-align: middle; } 1427 | 1428 | .carousel { 1429 | position: relative; 1430 | background: #E0E0E0; 1431 | max-height: 400px; 1432 | width: 100%; 1433 | white-space: nowrap; 1434 | padding: 0; } 1435 | 1436 | .carousel .images { 1437 | overflow-x: auto; 1438 | width: 100%; 1439 | text-align: center; } 1440 | 1441 | .carousel img { 1442 | max-height: 400px; 1443 | margin-right: 5px; 1444 | z-index: 1; } 1445 | 1446 | .carousel .fader { 1447 | height: 100%; 1448 | background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, white 100%); 1449 | background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, white)); 1450 | background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, white 100%); 1451 | background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, white 100%); 1452 | background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, white 100%); 1453 | background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, white 100%); 1454 | filter: "progid: DXImageTransform.Microsoft.gradient(startColorstr='#001e5799', endColorstr='#e0e0e0', GradientType=1)"; 1455 | width: 10%; 1456 | z-index: 2; 1457 | position: absolute; 1458 | right: 0; 1459 | top: 0; } 1460 | 1461 | .ribbon { 1462 | background: #FFFDE0; 1463 | border-top: 1px solid #FDF48B; 1464 | border-bottom: 1px solid #FDF48B; 1465 | margin-top: 20px; } 1466 | 1467 | #clientele img { 1468 | max-height: 50px; 1469 | background: #FFF; 1470 | padding: 10px; 1471 | border: 1px solid #CCC; 1472 | border-radius: 5px; } 1473 | #clientele a:hover { 1474 | text-decoration: none; } 1475 | #clientele a:hover img { 1476 | border-color: #428BCA; } 1477 | 1478 | @media (max-width: 860px) { 1479 | #home-logo { 1480 | margin-top: 75px; 1481 | max-width: 200px; } 1482 | 1483 | #promo-container { 1484 | margin-left: 250px; } } 1485 | @media (max-width: 767px) { 1486 | .grid-33:not(:first-child).points { 1487 | margin-top: 50px; } 1488 | 1489 | .carousel { 1490 | max-height: 300px; } } 1491 | @media (max-width: 640px) { 1492 | #promo-area { 1493 | text-align: center; } 1494 | 1495 | #home-logo { 1496 | float: none; 1497 | margin: 0 auto; 1498 | display: block; } 1499 | 1500 | #promo-container { 1501 | margin-left: 0; } } 1502 | .nav-macaron { 1503 | background: #191A1B; } 1504 | .nav-macaron a { 1505 | color: #FFFFFF; } 1506 | .nav-macaron a:hover { 1507 | color: #B6D1DD; } 1508 | 1509 | .markdown { 1510 | font-size: 15px; 1511 | font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; } 1512 | .markdown pre { 1513 | margin-bottom: 1em; 1514 | background-color: #F8F8F8; 1515 | border: 0px; 1516 | font-size: 13px; 1517 | line-height: 19px; 1518 | overflow: auto; 1519 | padding: 8px 12px; 1520 | border-radius: 3px; } 1521 | .markdown pre code { 1522 | margin: 0px; 1523 | padding: 0px; 1524 | background-color: transparent; 1525 | border: medium none; 1526 | word-wrap: normal; 1527 | max-width: initial; 1528 | display: inline; 1529 | overflow: initial; 1530 | line-height: inherit; } 1531 | .markdown h1 { 1532 | font-size: 60px; } 1533 | .markdown h2 { 1534 | font-size: 40px; 1535 | margin: 10px 0 25px 0; 1536 | border-bottom: 1px solid #EEE; } 1537 | .markdown h3 { 1538 | font-size: 30px; 1539 | margin: 15px 0px; } 1540 | .markdown h4 { 1541 | font-size: 20px; 1542 | margin: 10px 0px; } 1543 | .markdown a { 1544 | color: #4183C4; } 1545 | .markdown table { 1546 | border-collapse: collapse; 1547 | border-spacing: 0px; 1548 | display: block; 1549 | overflow: auto; 1550 | width: 100%; 1551 | margin: 0px 0px 9px; } 1552 | .markdown table tr { 1553 | background-color: #FFF; 1554 | border: 1px solid #CCC; } 1555 | .markdown table td { 1556 | border: 1px solid #DDD; 1557 | padding: 6px 13px; } 1558 | .markdown p img { 1559 | max-width: 99%; 1560 | height: auto; 1561 | margin: 0 auto; 1562 | display: block; } 1563 | .markdown blockquote { 1564 | border-left: 4px solid #ddd; 1565 | margin-bottom: 16px; } 1566 | .markdown blockquote p { 1567 | font-size: 14px; 1568 | padding: 5px 15px; 1569 | color: #777; } 1570 | 1571 | .docs-markdown .anchor-wrap { 1572 | margin-top: -50px; 1573 | padding-top: 50px; } 1574 | .docs-markdown h1 a.anchor, 1575 | .docs-markdown h2 a.anchor, 1576 | .docs-markdown h3 a.anchor, 1577 | .docs-markdown h4 a.anchor, 1578 | .docs-markdown h5 a.anchor, 1579 | .docs-markdown h6 a.anchor { 1580 | text-decoration: none; 1581 | line-height: 1; 1582 | padding-left: 0; 1583 | margin-left: 5px; 1584 | top: 15%; } 1585 | .docs-markdown a span.octicon { 1586 | font-size: 16px; 1587 | font-family: "FontAwesome"; 1588 | line-height: 1; 1589 | display: inline-block; 1590 | text-decoration: none; 1591 | -webkit-font-smoothing: antialiased; } 1592 | .docs-markdown a span.octicon-link { 1593 | display: none; 1594 | color: #000; } 1595 | .docs-markdown a span.octicon-link:before { 1596 | content: "\f0c1"; } 1597 | .docs-markdown h1:hover .octicon-link, 1598 | .docs-markdown h2:hover .octicon-link, 1599 | .docs-markdown h3:hover .octicon-link, 1600 | .docs-markdown h4:hover .octicon-link, 1601 | .docs-markdown h5:hover .octicon-link, 1602 | .docs-markdown h6:hover .octicon-link { 1603 | display: inline-block; } 1604 | --------------------------------------------------------------------------------