- add custom theme

- add local fonts
- add favicon
- add .gitignore
- fix typos
This commit is contained in:
TobiGr 2018-02-23 18:11:07 +01:00
parent 050e71ddd1
commit 8ce9f05e25
14 changed files with 91 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea

View File

@ -3,11 +3,11 @@
## Collector/Extractor pattern
Before we can start coding our own service we need to understand the basic concept of the extractor. There is a pattern
you will find all over the code. It is called to __extractor/collector__ pattern. The idea behind this pattern is that
you will find all over the code. It is called the __extractor/collector__ pattern. The idea behind this pattern is that
the [extractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/Extractor.html)
would produce single peaces of data, and the collector would take it and form usable data for the front end out of it.
The collector also controls the parsing process, and takes care about error handling. So if the extractor fails at any
point the collector will decide weather it should continue parsing or not. This requires the extractor to be made out of
point the collector will decide whether it should continue parsing or not. This requires the extractor to be made out of
many small methods. One method for every data field the collector wants to have. The collectors are provided by NewPipe.
You need to take care of the extractors.
@ -17,10 +17,12 @@ So typical call for retrieving data from a website would look like this:
```java
Info info;
try {
Extractor extractor = new Extractor(ome_meta_info); // Create a new Extractor with a given context provided as parameter.
info = Info.getInfo(extractor); // Retrieves the data form extractor and builds info package.
// Create a new Extractor with a given context provided as parameter.
Extractor extractor = new Extractor(ome_meta_info);
// Retrieves the data form extractor and builds info package.
info = Info.getInfo(extractor);
} catch(Exception e) {
// handler errors when collector decided to break up extraction
// handle errors when collector decided to break up extraction
}
```

View File

@ -1,2 +1,4 @@
site_name: NewPipe Tutorial
theme: readthedocs
theme:
name: readthedocs
custom_dir: theme

60
theme/css/local_fonts.css Normal file
View File

@ -0,0 +1,60 @@
/*
Stylesheet to load all local fonts except Font-Awesome because that is done by the theme.
Add all new fonts below.
*/
@font-face {
font-family: 'Inconsolata';
font-style: normal;
font-weight: 400;
src: local('Inconsolata'), local('Inconsolata-Regular'), url(../fonts/Inconsolata-Regular.ttf) format('truetype');
}
@font-face {
font-family: 'Inconsolata';
font-style: normal;
font-weight: 700;
src: local('Inconsolata Bold'), local('Inconsolata-Bold'), url(../fonts/Inconsolata-Bold.ttf) format('truetype');
}
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 400;
src: local('Lato Regular'), local('Lato-Regular'), url(../fonts/Lato-Regular.ttf) format('truetype');
}
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 700;
src: local('Lato Bold'), local('Lato-Bold'), url(../fonts/Lato-Bold.ttf) format('truetype');
}
@font-face {
font-family: 'Lato';
font-style: italic;
font-weight: 400;
src: local('Lato Italic'), local('Lato-Italic'), url(../fonts/Lato-Italic.ttf) format('truetype');
}
@font-face {
font-family: 'Lato';
font-style: italic;
font-weight: 700;
src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(../fonts/Lato-BoldItalic.ttf) format('truetype');
}
@font-face {
font-family: 'Roboto Slab';
font-style: normal;
font-weight: 400;
src: local('Roboto Slab Regular'), local('RobotoSlab-Regular'), url(../fonts/RobotoSlab-Regular.ttf) format('truetype');
}
@font-face {
font-family: 'Roboto Slab';
font-style: normal;
font-weight: 700;
src: local('Roboto Slab Bold'), local('RobotoSlab-Bold'), url(../fonts/RobotoSlab-Bold.ttf) format('truetype');
}

Binary file not shown.

Binary file not shown.

BIN
theme/fonts/Lato-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
theme/fonts/Lato-Italic.ttf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
theme/img/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

20
theme/main.html Normal file
View File

@ -0,0 +1,20 @@
{% extends "base.html" %}
{#
Override the stylesheets loading fonts from fonts.googleapis.com to prevent tracking
The stylesheet
This issue was discussed at https://github.com/TeamNewPipe/tutorial/issues/1
You can find the original file at https://github.com/mkdocs/mkdocs/blob/master/mkdocs/themes/readthedocs/base.html
#}
{%- block styles %}
<link rel="stylesheet" href="{{ base_url }}/css/local_fonts.css" type="text/css" />
<link rel="stylesheet" href="{{ base_url }}/css/theme.css" type="text/css" />
<link rel="stylesheet" href="{{ base_url }}/css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="{{ base_url }}/css/highlight.css" type="text/css" />
{%- for path in extra_css %}
<link href="{{ path }}" rel="stylesheet">
{%- endfor %}
{%- endblock %}