This is a global warnning message
Note
A sphinx theme sponsored by Typlog. Designed by Hsiaoming Yang.
This sphinx theme is designed based on the looks and feels on Typlog heavily.
Typlog is a blogging service. If you have interests in blogging, take a look into it.
This project is licensed under BSD 3.
Copyright (c) 2018, Hsiaoming Yang
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the creator nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Guide on how to use sphinx typlog theme.
Installing sphinx typlog theme is easy with pip:
$ pip install sphinx-typlog-theme
You can also add sphinx-typlog-theme
into your requirements.txt.
To use sphinx typlog theme in your documentation, configure it in
conf.py
:
html_theme = 'sphinx_typlog_theme'
If you are using Sphinx < 1.7, you can add it into html_theme_path
:
import sphinx_typlog_theme
html_theme_path = [sphinx_typlog_theme.get_path()]
There are some options for you to configure the theme in conf.py
:
html_theme_options = {}
Put a logo file in your docs _static
folder, e.g. the filename is
logo.png
:
html_theme_options = {
'logo': 'logo.png'
}
With logo configured, there will be a logo image on sidebar.
You can hide the name under your logo image with:
html_theme_options = {
'logo_name': 'false'
}
Add a description under your logo and logo_name:
html_theme_options = {
'description': 'Your project description'
}
Add a theme color, it will be shown as the hover color for links etc:
html_theme_options = {
'color': '#E8371A'
}
Configure your GitHub repo with github_user
and github_repo
:
html_theme_options = {
'github_user': 'lepture',
'github_repo': 'mistune'
}
Remember to include the github.html
template:
html_sidebars = {
'**': [
'github.html',
...
]
}
Track your site with Google Analytics:
html_theme_options = {
'analytics_id': 'UA-xxx'
}
This page is showing markup styles, they have no meanings.
Table of Contents
Debug Note
The default admonition has no colors. It is gray.
Attention
Attention please!
Caution
Attention please!
Danger
This is a danger area.
Error
This is an error message.
Hint
This is hint message.
Important
This is an impoartant message.
Note
This page is showing markup styles, they have no meanings.
Oh. Except this message.
Tip
A small tip please.
Warning
Please don’t do anything harmful to me.
New in version 2.5: The spam parameter.
Changed in version 2.5: The spam parameter.
Deprecated since version 3.1: Use spam()
instead.
See also
It is also available at https://typlog.com/
LICENSE AGREEMENT
|
|
|
Here is an example on code highlight:
@app.route('/', methods=['GET')
def hello(name='world'):
return 'Hello {}'.format(name)
class API(object):
"""API docstring style"""
def __init__(self, request):
# comment
self.request = request
Using code-block
with other options.
function test() {
console.log('hi');
}
1 2 3 | fn main() {
println!("Hello World!");
}
|
Here is an example on block quote:
Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than dense.Readability counts.Special cases aren’t special enough to break the rules.Although practicality beats purity.Errors should never pass silently.Unless explicitly silenced.In the face of ambiguity, refuse the temptation to guess.There should be one– and preferably only one –obvious way to do it.Although that way may not be obvious at first unless you’re Dutch.Now is better than never.Although never is often better than right now.If the implementation is hard to explain, it’s a bad idea.If the implementation is easy to explain, it may be a good idea.Namespaces are one honking great idea – let’s do more of those!
-a | command-line option “a” |
-b file | options can have arguments and long descriptions |
--long | options can be long also |
--input=file | long options can also have arguments |
/V | DOS/VMS-style options too |
A plain text mixed with bold and italic. And we have code
too.
Let’s try a link https://lepture.com.
Plain text Typical result Footnote references, like [5]. Note that footnotes may get rearranged, e.g., to the bottom of the “page”.
Autonumbered footnotes are possible, like using [1] and [2].
They may be assigned ‘autonumber labels’ - for instance, [4] and [3].
[5] | A numerical footnote. Note
there’s no colon after the ] . |
[1] | This is the first one. |
[2] | This is the second one. |
[3] | a.k.a. third |
[4] | a.k.a. fourth |
Let’s have a preview of what badges look like:
sphinx_typlog_theme.
get_path
()¶Shortcut for users to access this theme. If you are using Sphinx < 1.7, you can add it into html_theme_path:
import sphinx_typlog_theme
html_theme_path = [sphinx_typlog_theme.get_path()]
Returns: | theme path |
---|
sphinx_typlog_theme.
add_github_roles
(app, repo)¶Add gh
role to your sphinx documents. It can generate GitHub
links easily:
:gh:`issue#57` will generate the issue link
:gh:`PR#85` will generate the pull request link
Use this function in conf.py
to enable this feature:
def setup(app):
sphinx_typlog_theme.add_github_roles(app, 'lepture/authlib')
Parameters: |
|
---|
sphinx_typlog_theme.
add_badge_roles
(app)¶Add badge
role to your sphinx documents. It can create
a colorful badge inline.
Create and activate a new virtual environment, then run the following commands in the project root:
make install
To run the development server:
make serve
Then open http://127.0.0.1:5234 in your browser.