mirror of https://github.com/gogits/gogs.git
Lunny Xiao
11 years ago
40 changed files with 1413 additions and 476 deletions
@ -0,0 +1,39 @@
|
||||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package base |
||||
|
||||
import ( |
||||
"github.com/slene/blackfriday" |
||||
) |
||||
|
||||
func RenderMarkdown(rawBytes []byte) []byte { |
||||
htmlFlags := 0 |
||||
htmlFlags |= blackfriday.HTML_USE_XHTML |
||||
// htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS
|
||||
// htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
|
||||
// htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
|
||||
htmlFlags |= blackfriday.HTML_SKIP_HTML |
||||
htmlFlags |= blackfriday.HTML_SKIP_STYLE |
||||
htmlFlags |= blackfriday.HTML_SKIP_SCRIPT |
||||
htmlFlags |= blackfriday.HTML_GITHUB_BLOCKCODE |
||||
htmlFlags |= blackfriday.HTML_OMIT_CONTENTS |
||||
htmlFlags |= blackfriday.HTML_COMPLETE_PAGE |
||||
renderer := blackfriday.HtmlRenderer(htmlFlags, "", "") |
||||
|
||||
// set up the parser
|
||||
extensions := 0 |
||||
extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS |
||||
extensions |= blackfriday.EXTENSION_TABLES |
||||
extensions |= blackfriday.EXTENSION_FENCED_CODE |
||||
extensions |= blackfriday.EXTENSION_AUTOLINK |
||||
extensions |= blackfriday.EXTENSION_STRIKETHROUGH |
||||
extensions |= blackfriday.EXTENSION_HARD_LINE_BREAK |
||||
extensions |= blackfriday.EXTENSION_SPACE_HEADERS |
||||
extensions |= blackfriday.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK |
||||
|
||||
body := blackfriday.Markdown(rawBytes, renderer, extensions) |
||||
|
||||
return body |
||||
} |
@ -0,0 +1,317 @@
|
||||
.markdown { |
||||
font-size: 14px; |
||||
} |
||||
|
||||
.markdown a { |
||||
color: #4183C4; |
||||
} |
||||
|
||||
.markdown h1, |
||||
.markdown h2, |
||||
.markdown h3, |
||||
.markdown h4, |
||||
.markdown h5, |
||||
.markdown h6 { |
||||
line-height: 1.7; |
||||
padding: 15px 0 0; |
||||
margin: 0 0 15px; |
||||
color: #666; |
||||
} |
||||
|
||||
.markdown h1, |
||||
.markdown h2 { |
||||
border-bottom: 1px solid #EEE; |
||||
} |
||||
|
||||
.markdown h2 { |
||||
border-bottom: 1px solid #EEE; |
||||
} |
||||
|
||||
.markdown h1 { |
||||
color: #000; |
||||
font-size: 33px |
||||
} |
||||
|
||||
.markdown h2 { |
||||
color: #333; |
||||
font-size: 28px |
||||
} |
||||
|
||||
.markdown h3 { |
||||
font-size: 22px |
||||
} |
||||
|
||||
.markdown h4 { |
||||
font-size: 18px |
||||
} |
||||
|
||||
.markdown h5 { |
||||
font-size: 14px |
||||
} |
||||
|
||||
.markdown h6 { |
||||
font-size: 14px |
||||
} |
||||
|
||||
.markdown table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0; |
||||
display: block; |
||||
overflow: auto; |
||||
width: 100%; |
||||
margin: 0 0 9px; |
||||
} |
||||
|
||||
.markdown table th { |
||||
font-weight: 700 |
||||
} |
||||
|
||||
.markdown table th, |
||||
.markdown table td { |
||||
border: 1px solid #DDD; |
||||
padding: 6px 13px; |
||||
} |
||||
|
||||
.markdown table tr { |
||||
background-color: #FFF; |
||||
border-top: 1px solid #CCC; |
||||
} |
||||
|
||||
.markdown table tr:nth-child(2n) { |
||||
background-color: #F8F8F8 |
||||
} |
||||
|
||||
.markdown li { |
||||
line-height: 1.6; |
||||
margin-top: 6px; |
||||
} |
||||
|
||||
.markdown dl dt { |
||||
font-style: italic; |
||||
margin-top: 9px; |
||||
} |
||||
|
||||
.markdown dl dd { |
||||
margin: 0 0 9px; |
||||
padding: 0 9px; |
||||
} |
||||
|
||||
.markdown blockquote, |
||||
.markdown blockquote p { |
||||
font-size: 14px; |
||||
background-color: #f5f5f5; |
||||
} |
||||
|
||||
.markdown > pre { |
||||
line-height: 1.6; |
||||
overflow: auto; |
||||
background: #fff; |
||||
padding: 6px 10px; |
||||
border: 1px solid #ddd; |
||||
} |
||||
|
||||
.markdown > pre.linenums { |
||||
padding: 0; |
||||
} |
||||
|
||||
.markdown > pre > ol.linenums { |
||||
-webkit-box-shadow: inset 40px 0 0 #f5f5f5, inset 41px 0 0 #ccc; |
||||
box-shadow: inset 40px 0 0 #f5f5f5, inset 41px 0 0 #ccc; |
||||
} |
||||
|
||||
.markdown > pre > code, |
||||
.markdown > pre > ol.linenums > li > code { |
||||
white-space: pre; |
||||
word-wrap: normal; |
||||
} |
||||
|
||||
.markdown > pre > ol.linenums > li > code { |
||||
padding: 0 10px; |
||||
} |
||||
|
||||
.markdown > pre > ol.linenums > li:first-child { |
||||
padding-top: 6px; |
||||
} |
||||
|
||||
.markdown > pre > ol.linenums > li:last-child { |
||||
padding-bottom: 6px; |
||||
} |
||||
|
||||
.markdown > pre > ol.linenums > li { |
||||
border-left: 1px solid #ddd; |
||||
} |
||||
|
||||
.markdown hr { |
||||
border: none; |
||||
color: #ccc; |
||||
height: 4px; |
||||
padding: 0; |
||||
margin: 15px 0; |
||||
border-bottom: 2px solid #EEE; |
||||
} |
||||
|
||||
.markdown blockquote:last-child, |
||||
.markdown ul:last-child, |
||||
.markdown ol:last-child, |
||||
.markdown > pre:last-child, |
||||
.markdown > pre:last-child, |
||||
.markdown p:last-child { |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
.markdown .btn { |
||||
color: #fff; |
||||
} |
||||
|
||||
/* Author: jmblog */ |
||||
/* Project: https://github.com/jmblog/color-themes-for-google-code-prettify */ |
||||
/* GitHub Theme */ |
||||
/* Pretty printing styles. Used with prettify.js. */ |
||||
/* SPAN elements with the classes below are added by prettyprint. */ |
||||
/* plain text */ |
||||
.pln { |
||||
color: #333333; |
||||
} |
||||
|
||||
@media screen { |
||||
/* string content */ |
||||
.str { |
||||
color: #dd1144; |
||||
} |
||||
|
||||
/* a keyword */ |
||||
.kwd { |
||||
color: #333333; |
||||
} |
||||
|
||||
/* a comment */ |
||||
.com { |
||||
color: #999988; |
||||
} |
||||
|
||||
/* a type name */ |
||||
.typ { |
||||
color: #445588; |
||||
} |
||||
|
||||
/* a literal value */ |
||||
.lit { |
||||
color: #445588; |
||||
} |
||||
|
||||
/* punctuation */ |
||||
.pun { |
||||
color: #333333; |
||||
} |
||||
|
||||
/* lisp open bracket */ |
||||
.opn { |
||||
color: #333333; |
||||
} |
||||
|
||||
/* lisp close bracket */ |
||||
.clo { |
||||
color: #333333; |
||||
} |
||||
|
||||
/* a markup tag name */ |
||||
.tag { |
||||
color: navy; |
||||
} |
||||
|
||||
/* a markup attribute name */ |
||||
.atn { |
||||
color: teal; |
||||
} |
||||
|
||||
/* a markup attribute value */ |
||||
.atv { |
||||
color: #dd1144; |
||||
} |
||||
|
||||
/* a declaration */ |
||||
.dec { |
||||
color: #333333; |
||||
} |
||||
|
||||
/* a variable name */ |
||||
.var { |
||||
color: teal; |
||||
} |
||||
|
||||
/* a function name */ |
||||
.fun { |
||||
color: #990000; |
||||
} |
||||
} |
||||
/* Use higher contrast and text-weight for printable form. */ |
||||
@media print, projection { |
||||
.str { |
||||
color: #006600; |
||||
} |
||||
|
||||
.kwd { |
||||
color: #006; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.com { |
||||
color: #600; |
||||
font-style: italic; |
||||
} |
||||
|
||||
.typ { |
||||
color: #404; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.lit { |
||||
color: #004444; |
||||
} |
||||
|
||||
.pun, .opn, .clo { |
||||
color: #444400; |
||||
} |
||||
|
||||
.tag { |
||||
color: #006; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.atn { |
||||
color: #440044; |
||||
} |
||||
|
||||
.atv { |
||||
color: #006600; |
||||
} |
||||
} |
||||
|
||||
/* Specify class=linenums on a pre to get line numbering */ |
||||
ol.linenums { |
||||
margin-top: 0; |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
/* IE indents via margin-left */ |
||||
li.L0, |
||||
li.L1, |
||||
li.L2, |
||||
li.L3, |
||||
li.L4, |
||||
li.L5, |
||||
li.L6, |
||||
li.L7, |
||||
li.L8, |
||||
li.L9 { |
||||
/* */ |
||||
} |
||||
|
||||
/* Alternate shading for lines */ |
||||
li.L1, |
||||
li.L3, |
||||
li.L5, |
||||
li.L7, |
||||
li.L9 { |
||||
/* */ |
||||
} |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,19 +1,12 @@
|
||||
<script> |
||||
$(function(){ |
||||
initCore();{{if .PageIsSignUp}} |
||||
initRegister();{{end}}{{if .PageIsUserSetting}} |
||||
initUserSetting();{{end}} |
||||
}); |
||||
</script> |
||||
<div class="wrapper-push"></div> |
||||
<div class="wrapper-push"></div> |
||||
</div> |
||||
<footer id="footer"> |
||||
<div class="container footer-wrap"> |
||||
<p> |
||||
© 2014 Gogs · ver {{AppVer}} · <i class="fa fa-github"></i><a target="_blank" href="https://github.com/gogits/gogs">GitHub</a> |
||||
</p> |
||||
<p class="desc"></p> |
||||
</div> |
||||
<div class="container footer-wrap"> |
||||
<p>© 2014 Gogs · ver {{AppVer}} · |
||||
<i class="fa fa-github"></i><a target="_blank" href="https://github.com/gogits/gogs">GitHub</a> |
||||
</p> |
||||
<p class="desc"></p> |
||||
</div> |
||||
</footer> |
||||
</body> |
||||
</html> |
@ -0,0 +1,42 @@
|
||||
{{template "base/head" .}} |
||||
{{template "base/navbar" .}} |
||||
{{template "repo/nav" .}} |
||||
{{template "repo/toolbar" .}} |
||||
<div id="gogs-body" class="container"> |
||||
<div id="gogs-source"> |
||||
<div class="panel panel-default branch-box info-box"> |
||||
<div class="panel-heading info-head"> |
||||
<h4>Branches</h4> |
||||
</div> |
||||
<table class="panel-footer table branch-list table table-hover"> |
||||
<thead> |
||||
<tr> |
||||
<th class="name"></th> |
||||
<th class="behind">Behind</th> |
||||
<th class="ahead">Ahead</th> |
||||
<th class="date">Last Commit</th> |
||||
<th class="action"></th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr class="branch-main"> |
||||
<td class="name" colspan="3"> |
||||
<a href="#"><strong>BranchName</strong></a> |
||||
<button class="btn btn-primary btn-sm">base branch</button> |
||||
</td> |
||||
<td class="date">3 years ago</td> |
||||
<td class="action"></td> |
||||
</tr> |
||||
<tr> |
||||
<td class="name"><a href="#"><strong>BranchName</strong></a></td> |
||||
<td class="behind">102 <span class="graph" style="width: 100%"></span></td> |
||||
<td class="ahead"><span class="graph" style="width: 4%"></span>4</td> |
||||
<td class="date">3 years ago</td> |
||||
<td class="action"><a class="btn btn-info btn-sm" href="#">compare</a></td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{{template "base/footer" .}} |
@ -1,12 +0,0 @@
|
||||
{{template "base/head" .}} |
||||
{{template "base/navbar" .}} |
||||
<div class="container"> |
||||
<form action="/repo/delete" method="post" class="form-horizontal"> |
||||
<div class="form-group"> |
||||
<div class="col-md-offset-4 col-md-3"> |
||||
<button type="submit" class="btn btn-danger">Delete repository</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
{{template "base/footer" .}} |
@ -1,42 +1,41 @@
|
||||
<div id="gogs-body-nav" class="gogs-repo-nav"> |
||||
<div class="container"> |
||||
<div class="gogs-repo-btns pull-right"> |
||||
<div class="btn-group" id="gogs-repo-clone"> |
||||
<button type="button" class="btn btn-default"><i class="fa fa-download"></i>Clone</button> |
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> |
||||
<span class="caret"></span> |
||||
<span class="sr-only">Toggle Dropdown</span> |
||||
</button> |
||||
<div class="dropdown-menu" role="menu"> |
||||
<div data-val="down-http">http link</div> |
||||
<div data-val="down-git">git link</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-md-6"> |
||||
<h3><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / {{.Repository.Name}}</h3> |
||||
</div> |
||||
<div class="btn-group" id="gogs-repo-watching"> |
||||
<button type="button" class="btn btn-default"><i class="fa fa-eye"></i>Watch {x}</button> |
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> |
||||
<span class="caret"></span> |
||||
<span class="sr-only">Toggle Dropdown</span> |
||||
</button> |
||||
<div class="dropdown-menu" role="menu"> |
||||
<div class="dropdown-item" data-val="not-watching"> |
||||
<h4 role="presentation" class="dropdown-header">Not Watching</h4> |
||||
<p class="description">You only receive notifications for conversations in which you participate or are @mentioned.</p> |
||||
<p class="divider"></p> |
||||
</div> |
||||
<div class="dropdown-item" data-val="watching"> |
||||
<h4 role="presentation" class="dropdown-header">Watching</h4> |
||||
<p class="description">You receive notifications for all conversations in this repository.</p> |
||||
<div class="col-md-6 actions text-right"> |
||||
<div class="btn-group" id="gogs-repo-clone"> |
||||
<button type="button" class="btn btn-default"><i class="fa fa-download"></i>Clone</button> |
||||
<button type="button" class="btn btn-default dropdown-toggle" data-container="body" data-toggle="popover" data-placement="bottom" data-content="<label>SSH:</label><div class='input-group'><input type='text' class='form-control' value='git@{{AppDomain}}:{{.Owner.Name}}/{{.Repository.Name}}.git'></div>" data-html="1"> |
||||
<span class="caret"></span> |
||||
</button> |
||||
</div> |
||||
<div class="btn-group" id="gogs-repo-watching"> |
||||
<button type="button" class="btn btn-default"><i class="fa fa-eye"></i>Watch {x}</button> |
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> |
||||
<span class="caret"></span> |
||||
<span class="sr-only">Toggle Dropdown</span> |
||||
</button> |
||||
<div class="dropdown-menu" role="menu"> |
||||
<div class="dropdown-item" data-val="not-watching"> |
||||
<h4 role="presentation" class="dropdown-header">Not Watching</h4> |
||||
<p class="description">You only receive notifications for conversations in which you participate or are @mentioned.</p> |
||||
<p class="divider"></p> |
||||
</div> |
||||
<div class="dropdown-item" data-val="watching"> |
||||
<h4 role="presentation" class="dropdown-header">Watching</h4> |
||||
<p class="description">You receive notifications for all conversations in this repository.</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-default"><i class="fa fa-star"></i>Star {{.Repository.NumStars}}</button> |
||||
</div> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-default"><i class="fa fa-code-fork"></i>Fork {{.Repository.NumForks}}</button> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-default"><i class="fa fa-star"></i>Star {{.Repository.NumStars}}</button> |
||||
</div> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-default"><i class="fa fa-code-fork"></i>Fork {{.Repository.NumForks}}</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<h3><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / {{.Repository.Name}}</h3> |
||||
</div> |
||||
</div> |
Loading…
Reference in new issue