Skip to content

Commit

Permalink
[Mod] use sphinx again
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoric committed May 29, 2019
1 parent e0eb418 commit 98973fd
Show file tree
Hide file tree
Showing 8 changed files with 395 additions and 6 deletions.
156 changes: 156 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
@import url("vendor.css");

html {
position: relative;
min-height: 100%;
}

body {
/* Margin bottom by footer height */
margin-bottom: 60px;
/*padding-top: 50px; */ /* uncomment if navbar should be fixed */
}

body,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
}

h1 {
font-size: 42px;
font-weight: 500;
}

h2 {
font-weight: 300;
font-size: 34px;
}

ul, ol {
margin: 0 0 10px 20px;
padding: 0;
}

code {
padding: 0;
}

/* -- sidebar --------------------------------------------------------------- */
.page-sidebar {
margin-top: 25px;
border: 1px solid #cad7e1;
background-color: #FFF;
}

.search > input[type="text"] {
width: 165px;
}

/* dirty but works ¯\_(ツ)_/¯ */
@media (max-width:1200px) and (min-width:768px) {
.search > input[type="text"] {
width: 100px;
}
}

.page-sidebarwrapper {
padding: 10px;
line-height: 1.3;
}

.page-sidebarwrapper ul li a {
display: block;
padding: 3px 0;
}

a.reference {
border: none;
text-decoration: none;
}

a.reference:hover {
text-decoration: underline;
border: none;
}

a.reference:active {
text-decoration: underline;
border: none;
}


a:visited {
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

a:active {
text-decoration: underline;
}

img.screenshot {
width: 100%;
box-shadow: 0 4px 16px rgba(85, 85, 85, 0.8);
border-radius: 6px;
margin: 15px 0;
}

.page-content {
padding-top: 0px;
margin-top: 25px;
margin-bottom: 20px;
}

.paper {
background-color: #FFF;
padding: 20px;
border: 1px solid #cad7e1;
position: relative;
}

.paper:before {
content: "";
position: absolute;
top: -1px;
right: -1px;
border-width: 0 40px 40px 0;
border-style: solid;
border-color: #ccc #F6F9FC;
z-index: 3;
}

footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
padding: 20px 0;
background-color: #333333;
}

.copyright,
.made-in,
.powered-by {
margin: 0;
}

pre {
display: block;
margin: 0 0 12px;
line-height: 1.42857;
word-break: break-all;
word-wrap: break-word;
color: #333;
background-color: #f5f5f5;
border: 1px solid #cad7e1;
border-radius: 0;
}
9 changes: 9 additions & 0 deletions docs/_static/vendor.css

Large diffs are not rendered by default.

Binary file added docs/_static/vnpy.ico
Binary file not shown.
140 changes: 140 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{% extends 'basic/layout.html' %}

{%- block extrahead %}
{{ super() }}
<link rel="stylesheet" href="{{ pathto('_static/custom.css', 1) }}" type="text/css" />
{% if theme_touch_icon %}
<link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
{% endif %}
{% if theme_canonical_url %}
<link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html"/>
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
{% endblock %}

{# Disable base theme's top+bottom related navs; we have our own in sidebar #}
{%- block relbar1 %}{% endblock %}
{%- block relbar2 %}{% endblock %}

{# Nav should appear before content, not after #}
{%- block content %}
<nav class="navbar navbar-default navbar-fixed-top topnav" role="navigation">
<div class="container topnav">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topnav-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand topnav" href="https://www.vnpy.com/">vn.py — By Traders, For Traders</a>
</div>
<div class="collapse navbar-collapse" id="topnav-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="/">主页</a>
</li>
<li>
<a href="/forum/">社区</a>
</li>
<li>
<a href="/docs/">文档</a>
</li>
<li>
<a href="https://www.github.com/vnpy/vnpy" target="_blank">Github</a>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>

{%- macro sidebar() %}
{%- if render_sidebar %}
<div class="page-sidebar" role="navigation" aria-label="main navigation">
<div class="page-sidebarwrapper">
{%- block sidebarlogo %}
{%- if logo %}
<p class="logo">
<a href="{{ pathto(master_doc) }}"><img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/></a>
</p>
{%- endif %}
{%- endblock %}
{%- if sidebars != None %}
{#- new style sidebar: explicitly include/exclude templates #}
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
{%- endif %}
</div>
</div>
{%- endif %}
{%- endmacro %}

{%- if theme_fixed_sidebar|lower == 'true' %}
<div class="container">
{% if render_sidebar %}
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-3">
{{ sidebar() }}
</div>
{% endif %}

{%- block document %}

<div class="col-xs-12 col-sm-8 col-md-8 col-lg-9 page-content" role="main">
<div class="paper">
{% block body %} {% endblock %}
</div>
</div>

{%- endblock %}

<div class="clearer"></div>
</div>
{%- else %}
{{ super() }}
{%- endif %}
{%- endblock %}

{%- block footer %}
<footer class="flaskbb-footer">
<div class="container">
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<p class="copyright text-muted small pull-left">
© 2015 -
<!--<script type="text/javascript">document.write(new Date().getFullYear());</script>-->
2019
&nbsp;&nbsp;&nbsp;&nbsp;
vn.py Team
</p>
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<p class="made-in text-muted small" style="text-align: center">
By Traders, For Traders
</p>
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<p class="powered-by text-muted small pull-right">
powered by <a href="https://flaskbb.org">FlaskBB</a>
</p>
</div>
</div>
</div>
</footer>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
{% if theme_analytics_id %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ theme_analytics_id }}']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
{% endif %}
{%- endblock %}
22 changes: 22 additions & 0 deletions docs/_templates/relations.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{# Changes to the original: capitalized 'Documentation Overview' #}
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="{{ pathto(master_doc) }}">Documentation Overview</a><ul>
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}">{{ parent.title }}</a><ul>
{%- endfor %}
{%- if prev %}
<li>Previous: <a href="{{ prev.link|e }}" title="{{ _('previous chapter')
}}">{{ prev.title }}</a></li>
{%- endif %}
{%- if next %}
<li>Next: <a href="{{ next.link|e }}" title="{{ _('next chapter')
}}">{{ next.title }}</a></li>
{%- endif %}
{%- for parent in parents %}
</ul></li>
{%- endfor %}
</ul></li>
</ul>
</div>
13 changes: 13 additions & 0 deletions docs/_templates/searchbox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{# Changes to the original: capitalized 'Quick Search' #}
{%- if pagename != "search" and builder != "singlehtml" %}
<div id="searchbox" style="display: none" role="search">
<h3>{{ _('Quick Search') }}</h3>
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" />
<input type="submit" value="{{ _('Go') }}" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
{%- endif %}
6 changes: 6 additions & 0 deletions docs/_templates/sidebarintro.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h3>Useful Links</h3>
<ul>
<li><a href="https://flaskbb.org">FlaskBB Website</a></li>
<li><a href="https://forums.flaskbb.org">FlaskBB Forums</a></li>
<li><a href="https://github.com/sh4nks/flaskbb">FlaskBB @ GitHub</a></li>
</ul>
Loading

0 comments on commit 98973fd

Please sign in to comment.