Add Initial Documentation

This commit is contained in:
bundabrg 2020-06-15 19:45:25 +08:00
parent 14564dde5d
commit 9f4a789b82
49 changed files with 7025 additions and 0 deletions

44
.github/workflows/documentation.yml vendored Normal file
View file

@ -0,0 +1,44 @@
# This workflow will create documentation and publish to Github pages. For now it does this in my (Bundabrg) repo when in a specific branch
name: documentation
on: [push]
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.6'
architecture: 'x64'
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r ./requirements.txt
- run: mkdocs build
- name: Deploy to Github Pages
if: github.ref == 'refs/heads/feature/plugins'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./build/docs
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: documentation
path: build/docs

64
docs/contributing.md Normal file
View file

@ -0,0 +1,64 @@
# Contributing
Here are some ways that you can help contribute to this project.
## New ideas or Bug Reports
Need something? Found a bug? Or just have a brilliant idea? Head to the [Issues](https://github.com/GeyserMC/Geyser/issues) and create a new one.
Please feel free to reach out to us on [Discord](http://discord.geysermc.org/) if
you're interested in helping out with Geyser.
## Contributing Code
If you know Java then take a look at open issues and create a pull request.
Do the following to build the code:
```shell
git clone https://github.com/GeyserMC/Geyser
cd EduSupport
git submodule update --init --recursive
mvn clean install
```
## Contributing Documentation
If you can help improve the documentation it would be highly appreciated. Have a look under the `docs` folder for the existing documentation.
The documentation is built using `mkdocs`. You can set up a hot-build dev environment that will auto-refresh changes as they are made.
### Requirements
* python3
* pip3
* npm (only if changing themes)
Install dependencies by running:
```shell
pip3 install -r requirements.txt
```
!!! note
It's recommended to use a `virtualenv` so that you don't pollute your system environment.
### Dev Environment
To start a http document server on `http://127.0.0.1:8000` execute:
```shell
mkdocs serve
```
### Change PDF Theme
Edit the PDF theme under `docs/theme/pdf`. Rebuild by doing the following:
```shell
cd docs/theme/pdf
npm install
npm run build-compressed
```
This will update `pdf.css` under `docs/css/pdf.css`. Rebuilding the docs will now use the new theme.

9
docs/css/mkpdf.css Normal file
View file

@ -0,0 +1,9 @@
@import "https://use.fontawesome.com/releases/v5.8.1/css/all.css";
a.pdf-download-btn{
font-size: .8rem;
}
a.pdf-download-btn small{
display: none;
}

1
docs/css/pdf.css Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,12 @@
#version-selector {
float: right;
display: flex;
align-items: center;
margin: 0 10px;
}
#version-selector > select {
width: auto;
height: auto;
padding: 1px;
}

98
docs/events.md Normal file
View file

@ -0,0 +1,98 @@
# Events
Geyser has an Event Manager that allows one to listen to or trigger an event easily. Events can be easily defined
either by defining a method to be an event handler or by providing a lambda. Each event handler will be executed
in turn based upon their priority.
## Triggering an Event
An event is derived from either `GeyserEvent` or `CancellableGeyserEvent`.
!!! example
```java
public class MyCustomEvent extends GeyserEvent {
}
```
The event is triggered through the `triggerEvent` method of the Event Manager.
!!! example
```java
eventManager.triggerEvent(new MyCustomEvent());
```
## Listening to an Event
There are two ways to listen for an event. One can either create an event handler method or one can create an anonymous
lamda to be executed when the event is triggered.
### Class Event Handler
An event handler method is a method that is annotated with `@Event`. The class it belongs to must also be registered
with the event manager.
!!! example
```java
public class MyClass {
@Event
public void onEnable(EventContext ctx, MyCustomEvent event) {
System.err.println("Hello World");
}
}
...
GeyserConnecter.getInstance().getEventManager.registerEvents(new MyClass());
```
!!! important
Plugins should use the `registerEvents` method inherited from `GeyserPlugin`.
The `@Event` annotation has the following optional parameters:
* **priority** - Integer from 0 - 100. Default `50`. Event Handlers are executed in order from lowest to highest priority.
* **ignoreCancelled** - Boolean. Default `true`. If true then if an event is cancelled the handler will not be executed.
The `EventContext` will be discussed later. `EnableEvent` is an event and is also discussed later.
### Anonymous Lambda
An event can be hooked through the `on` method of the EventManager provided with an anonymous function. This allows
code to be placed logically close to where it is related in the code instead of having to set up a separate class and
method listeners.
!!! example
```java
GeyserConnector.getInstance().getEventManager().on(MyCustomEvent.class, (ctx, event) -> {
System.err.println("Hello World");
});
```
!!! important
Plugins should use the `on` method inherited from `GeyserPlugin`.
This method takes 2 optional parameters specifying the priority of the event and if the handler should ignore cancelled events.
### Event Context
The event handler receives an EventContext in addition to the Event class. The EventContext holds anything related to the
EventHandler itself and presently only allows an EventHandler to `unregister` itself.
## Events
Geyser has the following predefined Events.
### DisableEvent
Triggered when a Plugin is disabled.
### EnableEvent
**cancellable**
Triggered when a Plugin is enabled. If cancelled then the plugin will be unloaded and no `DisableEvent` will be triggered.

BIN
docs/img/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
docs/img/header_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

BIN
docs/img/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

32
docs/index.md Normal file
View file

@ -0,0 +1,32 @@
![Logo](img/title.png)
Geyser is a bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition, closing the gap from those wanting to play true cross-platform.
Geyser is an open collaboration project by CubeCraft Games.
## What is Geyser?
Geyser is a proxy, bridging the gap between Minecraft: Bedrock Edition and Minecraft: Java Edition servers.
The ultimate goal of this project is to allow Minecraft: Bedrock Edition users to join Minecraft: Java Edition servers as seamlessly as possible. **Please note, this project is still a work in progress and should not be used on production. Expect bugs!**
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have now joined us here!
!!! note
Currently supporting Minecraft Bedrock v1.14.6(0) and Minecraft Java v1.15.2.
## Setting Up
Take a look [here](https://github.com/GeyserMC/Geyser/wiki#Setup) for how to set up Geyser.
[![YouTube Video](https://img.youtube.com/vi/U7dZZ8w7Gi4/0.jpg)](https://www.youtube.com/watch?v=U7dZZ8w7Gi4)
## Links:
- Website: https://geysermc.org
- Docs: https://github.com/GeyserMC/Geyser/wiki
- Download: http://ci.geysermc.org
- Discord: http://discord.geysermc.org/
- Donate: https://patreon.com/GeyserMC
## Libraries Used:
- [NukkitX Bedrock Protocol Library](https://github.com/NukkitX/Protocol)
- [Steveice10's Java Protocol Library](https://github.com/Steveice10/MCProtocolLib)
- [TerminalConsoleAppender](https://github.com/Minecrell/TerminalConsoleAppender)
- [Simple Logging Facade for Java (slf4j)](https://github.com/qos-ch/slf4j)

47
docs/js/version_select.js Normal file
View file

@ -0,0 +1,47 @@
window.addEventListener("DOMContentLoaded", function() {
var BASE_URL = window.location.origin + "/" + window.location.pathname.split("/")[1];
var CURRENT_VERSION = window.location.pathname.split("/")[3];
var CURRENT_LANGUAGE = window.location.pathname.split("/")[2];
function makeSelect(options, selected) {
var select = document.createElement("select");
select.classList.add("form-control");
options.forEach(function(i) {
var option = new Option(i.text, i.value, undefined,
i.value === selected);
select.add(option);
});
return select;
}
var xhr = new XMLHttpRequest();
xhr.open("GET", BASE_URL + "/versions.json");
xhr.onload = function() {
var versions = JSON.parse(this.responseText);
var realVersion = versions.find(function(i) {
return i.version === CURRENT_VERSION ||
i.aliases.includes(CURRENT_VERSION);
}).version;
var select = makeSelect(versions.map(function(i) {
return {text: i.title, value: i.version};
}), realVersion);
select.addEventListener("change", function(event) {
window.location.href = BASE_URL + "/" + CURRENT_LANGUAGE + "/" + this.value;
});
var container = document.createElement("div");
container.id = "version-selector";
container.appendChild(select);
var title = document.querySelector("nav.md-header-nav");
var height = window.getComputedStyle(title).getPropertyValue("height");
container.style.height = height;
title.appendChild(container);
};
xhr.send();
});

108
docs/plugins.md Normal file
View file

@ -0,0 +1,108 @@
# Plugins
Geyser provides support for third party plugins which can be placed into a `plugins` folder under the Geyser data folder.
Plugins provide a way to extend the features of Geyser without needing to deal with the Geyser code. It is hoped that
developers will be able to create plugins that would be of use to others.
This page describes how to write a plugin.
## Maven
Add the following to the relevant section of your `pom.xml`
```xml
<repositories>
<!-- Bundabrg's Repo -->
<repository>
<id>bundabrg-repo</id>
<url>https://repo.worldguard.com.au/repository/maven-public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<!-- Geyser -->
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>connector</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
```
!!! info
Plugin support is presently only available through a feature branch and thus there will be references to a third party
maven repository that holds a build of this branch. This will change in the future.
## Example Plugin
```java
@Plugin(
name = "ExamplePlugin",
version = "1.1.0-dev",
authors = {"bundabrg"},
description = "Provides an example plugin"
)
public class MyPlugin extends GeyserPlugin {
public MyPlugin(PluginManager pluginManager, PluginClassLoader pluginClassLoader) {
super(pluginManager, pluginClassLoader);
}
@Event
public void onEnable(EventContext ctx, EnableEvent event) {
System.err.println("I'm alive");
// Register another class with event handlers
registerEvents(new MyAdditionalClass());
// Example of lambda event hook
on(DisableEvent.class, (ctx, event) -> {
System.err.println("I'm also dead");
}, PRIORITY.HIGH);
}
@Event
public void onDisable(EventContext ctx, DisableEvent event) {
System.err.println("I'm dead");
}
}
```
## Plugin EntryPoint
A plugin must at a minimum define a class that extends `GeyserPlugin` and be annotated with `@Plugin`. The annotation
provides details about the plugin such as its version and author(s).
The following fields are available for `@Plugin`:
* **name** - Name of the plugin. Used in the logs.
* **version** - Version of the plugin.
* **authors** - A list of authors
* **description** - A short description of the plugin
* **global** - Should the plugin make its classes available to other plugins (default: true)
## Plugin Events
A plugin will generally hook into several events and provides its own event registration inherited from `GeyserPlugin`.
A plugin class will look for any methods annotated with `@Event` and will treat them as Event Handlers, using reflection
to determine which event is being trapped. In the previous example the plugin has trapped both the `EnableEvent` and `DisableEvent`.
Please refer to [events](events.md) for more information about the event system.
!!! note
There is no need to register the plugin class for events as it will be registered by default.
!!! note
The plugin class itself provides many of the registration methods found in the Event Manager to track which events belong to the plugin. You
should use the plugins own registration methods in preference to those in the Event Manger. This includes
`registerEvents` and `on`.

11
docs/theme/pdf/.gitignore vendored Normal file
View file

@ -0,0 +1,11 @@
*.tgz
.yarn-integrity
pids
*.pid
*.seed
*.pid.lock
report.css
node_modules/
jspm_packages/
.npm

BIN
docs/theme/pdf/FiraSans-Bold.otf vendored Normal file

Binary file not shown.

BIN
docs/theme/pdf/FiraSans-Italic.otf vendored Normal file

Binary file not shown.

BIN
docs/theme/pdf/FiraSans-Light.otf vendored Normal file

Binary file not shown.

BIN
docs/theme/pdf/FiraSans-LightItalic.otf vendored Normal file

Binary file not shown.

BIN
docs/theme/pdf/FiraSans-Regular.otf vendored Normal file

Binary file not shown.

21
docs/theme/pdf/LICENSE vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Gerry Ntabuhashe
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

2
docs/theme/pdf/README.md vendored Normal file
View file

@ -0,0 +1,2 @@
# mkpdfs-design-sample
An mkpdfs design sample to customize the layout of generated pdfs

2930
docs/theme/pdf/fonts/font-awesome.css vendored Normal file

File diff suppressed because it is too large Load diff

24
docs/theme/pdf/fonts/material-icons.css vendored Normal file
View file

@ -0,0 +1,24 @@
/*!
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE
* DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
* SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
* LIMITATIONS UNDER THE LICENSE.
*/
@font-face {
font-family: "Material Icons";
font-style: normal;
font-weight: 400;
src: local("Material Icons"),
local("MaterialIcons-Regular"),
url("specimen/MaterialIcons-Regular.woff2") format("woff2"),
url("specimen/MaterialIcons-Regular.woff") format("woff"),
url("specimen/MaterialIcons-Regular.ttf") format("truetype");
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

1505
docs/theme/pdf/package-lock.json generated vendored Normal file

File diff suppressed because it is too large Load diff

37
docs/theme/pdf/package.json vendored Normal file
View file

@ -0,0 +1,37 @@
{
"name": "mkpdfs-design-sample",
"version": "1.0.0",
"description": "The default mkpdfs design to use when generating the pdf report. This style will only be used for the pdf, not to be use for the webversion of the documentation as it can conflict with other themes.",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "node-sass report.scss ../../css/pdf.css",
"build-compressed": "node-sass report.scss ../../css/pdf.css --output-style compressed"
},
"repository": {
"type": "git",
"url": "git+https://github.com/comwes/mkpdfs-design-sample"
},
"keywords": [
"mkdocs",
"documentation",
"pdf",
"markdown",
"plugin"
],
"devDependencies": {
"material-design-color": "^2.3.2",
"material-shadows": "^3.0.1",
"modularscale-sass": "^3.0.8",
"node-sass": "^4.11.0"
},
"author": {
"name": "Comwes, Gerry Ntabuhashe",
"email": "public@comwes.eu, gnt@comwes.eu",
"url": "https://comwes.eu, https://mkpdfs.comwes.eu"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/comwes/mkpdfs-design-sample/issues"
},
"homepage": "https://github.com/comwes/mkpdfs-design-sample#readme"
}

323
docs/theme/pdf/report.scss vendored Normal file
View file

@ -0,0 +1,323 @@
@import "https://fonts.googleapis.com/icon?family=Material+Icons";
@import "stylesheets/extensions.scss";
$bgColor: rgb(63, 81, 181);
$bgTextColor: #fff;
@font-face {
font-family: Fira Sans;
font-weight: 400;
src: url(FiraSans-Regular.otf);
}
@font-face {
font-family: Fira Sans;
font-style: italic;
font-weight: 400;
src: url(FiraSans-Italic.otf);
}
@font-face {
font-family: Fira Sans;
font-weight: 300;
src: url(FiraSans-Light.otf);
}
@font-face {
font-family: Fira Sans;
font-style: italic;
font-weight: 300;
src: url(FiraSans-LightItalic.otf);
}
@font-face {
font-family: Fira Sans;
font-weight: bold;
src: url(FiraSans-Bold.otf);
}
@page {
@top-left {
background: $bgColor;
content: counter(page);
height: 1cm;
color: $bgTextColor;
text-align: center;
width: 1cm;
}
@top-center {
background: $bgColor;
content: '';
display: block;
height: .05cm;
opacity: .5;
width: 100%;
}
@top-right {
content: string(heading);
font-size: 9pt;
height: 1cm;
vertical-align: middle;
width: 100%;
}
@bottom-right {
content: string(copyright);
font-size: 9pt;
height: 1cm;
vertical-align: middle;
width: 100%;
}
}
@page :blank {
@top-left {
background: none;
content: '';
}
@top-center {
content: none;
}
@top-right {
content: none;
}
@bottom-right {
content: none;
}
}
@page no-chapter {
@top-left {
background: none;
content: none;
}
@top-center {
content: none;
}
@top-right {
content: none;
}
@bottom-right {
content: none;
}
}
@page :first {
background: url(../img/logo.png) no-repeat center;
background-size: auto;
margin: 0;
counter-reset: page -1;
}
html {
article#doc-cover h1#doc-title {
color: $bgColor;
font-size: 38pt;
margin: 5cm 2cm 0 2cm;
page: no-chapter;
width: 100%;
}
body article#doc-cover {
break-after: right;
align-content: space-between;
display: flex;
flex-wrap: wrap;
margin: 0;
height: 297mm;
address {
background: $bgColor;
flex: 1;
color: $bgTextColor;
margin: 0 -2cm;
padding: 1cm 0;
font-style: normal;
white-space: pre-wrap;
&:last-of-type {
padding-right: 3cm;
text-align: right;
}
&:first-of-type {
padding-left: 3cm;
}
p{
margin: 0;
padding: 0;
}
p#copyright {
string-set: copyright content();
}
}
}
color: #393939;
font-family: Fira Sans, helvetica, arial;
font-size: 11pt;
font-weight: 300;
line-height: 1.5;
}
@page chapter {
background: $bgColor;
margin: 0;
@top-left {
content: none;
}
@top-center {
content: none;
}
@top-right {
content: none;
}
}
.html iframe, html img, .html svg {
max-width: 100%;
margin-top: 5px;
}
html body {
h1 {
color: $bgColor;
string-set: heading content();
}
h2, h3, h4 {
color: black;
font-weight: 400;
}
h2 {
font-size: 20pt;
}
h3 {
font-weight: 300;
font-size: 15pt;
}
h4 {
font-size: 13pt;
}
article {
break-before: always;
video {
source::before {
content: attr(src);
}
&[src]::before {
content: attr(data-title) " https://mkpdfs.comwes.eu" attr(src);
}
}
}
}
h2, h3, h4, h5 {
margin-bottom: 0.1em;
}
html body article {
h1, h2, h3, h4, h5, h6 {
a {
&.external-link::after {
content: none;
}
}
}
a {
color: $bgColor;
text-decoration: none;
&.external-link::after {
content: " (" attr(href) ")";
font-style: italic;
}
}
table {
border-spacing: 0;
border-collapse: collapse;
tr {
border-bottom: 1px solid #888;
td {
padding: 4px 7px;
}
}
}
&#contents {
break-before: right;
break-after: left;
page: no-chapter;
h2 {
font-size: 20pt;
font-weight: 400;
margin-bottom: 3cm;
}
h3 {
font-weight: 500;
margin: 3em 0 1em;
&::before {
background: $bgColor;
content: '';
display: block;
height: .08cm;
margin-bottom: .25cm;
width: 2cm;
}
}
ul {
list-style: none;
padding-left: .5cm;
li {
border-top: .25pt solid #c1c1c1;
margin: .15cm 0;
padding-top: .15cm;
&::before {
color: $bgColor;
content: '';
font-size: 40pt;
line-height: 16pt;
vertical-align: bottom;
}
a {
color: inherit;
text-decoration: inherit;
}
}
}
> ul {
list-style: none;
padding-left: 0;
}
div h4 a::after, ul li a::after {
color: $bgColor;
content: target-counter(attr(href), page);
float: right;
}
div h4 {
margin: .15cm 0;
padding-top: 0;
padding-bottom: 0;
a {
color: inherit;
}
}
}
p {
text-align: justify;
}
}

93
docs/theme/pdf/stylesheets/_config.scss vendored Normal file
View file

@ -0,0 +1,93 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Variables: typography
// ----------------------------------------------------------------------------
// Modular typographic scale
$ms-base: px2rem(20px);
$ms-ratio: $major-third;
// ----------------------------------------------------------------------------
// Variables: breakpoints
// ----------------------------------------------------------------------------
// stylelint-disable unit-whitelist
// Device-specific breakpoints
$break-devices: (
mobile: (
portrait: px2em(220px) px2em(479px),
landscape: px2em(480px) px2em(719px)
),
tablet: (
portrait: px2em(720px) px2em(959px),
landscape: px2em(960px) px2em(1219px)
),
screen: (
small: px2em(1220px) px2em(1599px),
medium: px2em(1600px) px2em(1999px),
large: px2em(2000px)
)
);
// stylelint-enable unit-whitelist
// ----------------------------------------------------------------------------
// Variables: base colors
// ----------------------------------------------------------------------------
// Primary and accent colors
$md-color-primary: $clr-indigo-500 !default;
$md-color-accent: $clr-indigo-a200 !default;
// Shades of black
$md-color-black: hsla(0, 0%, 0%, 0.87) !default;
$md-color-black--light: hsla(0, 0%, 0%, 0.54) !default;
$md-color-black--lighter: hsla(0, 0%, 0%, 0.26) !default;
$md-color-black--lightest: hsla(0, 0%, 0%, 0.07) !default;
$md-color-black--transparent: hsla(0, 0%, 0%, 0) !default;
// Shades of white
$md-color-white: hsla(0, 0%, 100%, 1) !default;
$md-color-white--light: hsla(0, 0%, 100%, 0.7) !default;
$md-color-white--lighter: hsla(0, 0%, 100%, 0.3) !default;
$md-color-white--lightest: hsla(0, 0%, 100%, 0.12) !default;
$md-color-white--transparent: hsla(0, 0%, 100%, 0) !default;
// ----------------------------------------------------------------------------
// Variables: sizing and spacing
// ----------------------------------------------------------------------------
// Icons
$md-icon-size: $ms-base * 1.5;
$md-icon-padding: $ms-base * 0.5;
$md-icon-margin: $ms-base * 0.25;
// Code blocks
$md-code-background: hsla(0, 0%, 92.5%, 0.5);
$md-code-color: #37474F;
// Keystrokes
$md-keyboard-background: #FCFCFC;
$md-keyboard-color: #555555;

View file

@ -0,0 +1,48 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Dependencies
// ----------------------------------------------------------------------------
@import "../node_modules/modularscale-sass/stylesheets/modularscale";
@import "../node_modules/material-design-color/material-color";
@import "../node_modules/material-shadows/material-shadows";
@import "helpers/break";
@import "helpers/px2em";
@import "config";
@import "base/icons";
@import "extensions/admonition";
@import "extensions/codehilite";
@import "extensions/footnotes";
@import "extensions/pymdown/arithmatex";
@import "extensions/pymdown/critic";
@import "extensions/pymdown/details";
@import "extensions/pymdown/emoji";
@import "extensions/pymdown/inlinehilite";
@import "extensions/pymdown/superfences";
@import "extensions/pymdown/tasklist";

View file

@ -0,0 +1,7 @@
{
"extends": "../../../../.stylelintrc",
"rules": {
"font-weight-notation": null,
"property-no-vendor-prefix": null
}
}

View file

@ -0,0 +1,50 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// stylelint-disable font-family-no-missing-generic-family-keyword
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Icon placeholders
%md-icon {
font-family: "Material Icons";
font-style: normal;
font-variant: normal;
font-weight: normal;
line-height: 1;
text-transform: none;
white-space: nowrap;
speak: none;
word-wrap: normal;
direction: ltr;
// Icon rendered as button
&__button {
display: inline-block;
margin: $md-icon-margin;
padding: $md-icon-padding;
font-size: $md-icon-size;
cursor: pointer;
}
}

View file

@ -0,0 +1,120 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// Admonition extension
.admonition {
@include z-depth(2);
position: relative;
margin: 1.5625em 0;
padding: 0 px2rem(12px);
border-left: px2rem(4px) solid $clr-blue-a200;
border-radius: px2rem(2px);
font-size: ms(-1);
overflow: auto;
// Adjust for RTL languages
[dir="rtl"] & {
border-right: px2rem(4px) solid $clr-blue-a200;
border-left: none;
}
// Adjust spacing on last element
html & > :last-child {
margin-bottom: px2rem(12px);
}
// Adjust margin for nested admonition blocks
.admonition {
margin: 1em 0;
}
// Title
> .admonition-title {
margin: 0 px2rem(-12px);
padding: px2rem(8px) px2rem(12px) px2rem(8px) px2rem(10px);
border-bottom: px2rem(1px) solid transparentize($clr-blue-a200, 0.9);
background-color: transparentize($clr-blue-a200, 0.9);
font-weight: 700;
// Adjust for RTL languages
[dir="rtl"] & {
padding: px2rem(8px) px2rem(40px) px2rem(8px) px2rem(12px);
}
// Reset spacing, if title is the only element
&:last-child {
margin-bottom: 0;
}
}
// Build representational classes
@each $names, $appearance in (
abstract summary tldr: $clr-light-blue-a400 "\E8D2", // subject
info todo: $clr-cyan-a700 "\E88E", // info
tip hint important : $clr-teal-a700 "\E80E", // whatshot
success check done: $clr-green-a700 "\E876", // done
question help faq: $clr-light-green-a700 "\E887", // help
warning caution attention: $clr-orange-a400 "\E002", // warning
failure fail missing: $clr-red-a200 "\E14C", // clear
danger error: $clr-red-a400 "\E3E7", // flash_on
bug: $clr-pink-a400 "\E868", // bug_report
example: $clr-deep-purple-a400 "\E242", // format_list_numbered
quote cite: $clr-grey "\E244" // format_quote
) {
$tint: nth($appearance, 1);
// Define base class
&%#{nth($names, 1)},
&.#{nth($names, 1)} {
border-left-color: $tint;
// Adjust for RTL languages
[dir="rtl"] & {
border-right-color: $tint;
}
// Title
> .admonition-title {
border-bottom-color: transparentize($tint, 0.9);
background-color: transparentize($tint, 0.9);
}
}
// Define synonyms for base class
@if length($names) > 1 {
@for $n from 2 through length($names) {
&.#{nth($names, $n)} {
@extend .admonition%#{nth($names, 1)};
}
}
}
}
}
}

View file

@ -0,0 +1,373 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Variables
// ----------------------------------------------------------------------------
// Operators
$codehilite-operator: inherit;
$codehilite-operator-word: inherit;
// Generics
$codehilite-generic-emph: #000000;
$codehilite-generic-error: #AA0000;
$codehilite-generic-heading: #999999;
$codehilite-generic-output: #888888;
$codehilite-generic-prompt: #555555;
$codehilite-generic-strong: inherit;
$codehilite-generic-subheading: #AAAAAA;
$codehilite-generic-traceback: #AA0000;
// Diffs
$codehilite-diff-deleted: #FFDDDD;
$codehilite-diff-inserted: #DDFFDD;
// Keywords
$codehilite-keyword: #3B78E7;
$codehilite-keyword-constant: #A71D5D;
$codehilite-keyword-declaration: #3B78E7;
$codehilite-keyword-namespace: #3B78E7;
$codehilite-keyword-pseudo: #A71D5D;
$codehilite-keyword-reserved: #3E61A2;
$codehilite-keyword-type: #3E61A2;
// Comments
$codehilite-comment: #999999;
$codehilite-comment-multiline: #999999;
$codehilite-comment-preproc: #666666;
$codehilite-comment-single: #999999;
$codehilite-comment-shebang: #999999;
$codehilite-comment-special: #999999;
// Names
$codehilite-name-attribute: #C2185B;
$codehilite-name-builtin: #C2185B;
$codehilite-name-builtin-pseudo: #3E61A2;
$codehilite-name-class: #C2185B;
$codehilite-name-constant: #3E61A2;
$codehilite-name-decorator: #666666;
$codehilite-name-entity: #666666;
$codehilite-name-exception: #C2185B;
$codehilite-name-function: #C2185B;
$codehilite-name-label: #3B5179;
$codehilite-name-namespace: #EC407A;
$codehilite-name-tag: #3B78E7;
$codehilite-name-variable: #3E61A2;
$codehilite-name-variable-class: #3E61A2;
$codehilite-name-variable-instance: #3E61A2;
$codehilite-name-variable-global: #3E61A2;
$codehilite-name-extension: #EC407A;
// Numbers
$codehilite-literal-number: #E74C3C;
$codehilite-literal-number-float: #E74C3C;
$codehilite-literal-number-hex: #E74C3C;
$codehilite-literal-number-integer: #E74C3C;
$codehilite-literal-number-integer-long: #E74C3C;
$codehilite-literal-number-oct: #E74C3C;
// Strings
$codehilite-literal-string: #0D904F;
$codehilite-literal-string-backticks: #0D904F;
$codehilite-literal-string-char: #0D904F;
$codehilite-literal-string-doc: #999999;
$codehilite-literal-string-double: #0D904F;
$codehilite-literal-string-escape: #183691;
$codehilite-literal-string-heredoc: #183691;
$codehilite-literal-string-interpol: #183691;
$codehilite-literal-string-other: #183691;
$codehilite-literal-string-regex: #009926;
$codehilite-literal-string-single: #0D904F;
$codehilite-literal-string-symbol: #0D904F;
// Miscellaneous
$codehilite-error: #A61717;
$codehilite-whitespace: transparent;
// ----------------------------------------------------------------------------
// Rules: syntax highlighting
// ----------------------------------------------------------------------------
// Codehilite extension
.codehilite {
// Operators
.o { color: $codehilite-operator; }
.ow { color: $codehilite-operator-word; }
// Generics
.ge { color: $codehilite-generic-emph; }
.gr { color: $codehilite-generic-error; }
.gh { color: $codehilite-generic-heading; }
.go { color: $codehilite-generic-output; }
.gp { color: $codehilite-generic-prompt; }
.gs { color: $codehilite-generic-strong; }
.gu { color: $codehilite-generic-subheading; }
.gt { color: $codehilite-generic-traceback; }
// Diffs
.gd { background-color: $codehilite-diff-deleted; }
.gi { background-color: $codehilite-diff-inserted; }
// Keywords
.k { color: $codehilite-keyword; }
.kc { color: $codehilite-keyword-constant; }
.kd { color: $codehilite-keyword-declaration; }
.kn { color: $codehilite-keyword-namespace; }
.kp { color: $codehilite-keyword-pseudo; }
.kr { color: $codehilite-keyword-reserved; }
.kt { color: $codehilite-keyword-type; }
// Comments
.c { color: $codehilite-comment; }
.cm { color: $codehilite-comment-multiline; }
.cp { color: $codehilite-comment-preproc; }
.c1 { color: $codehilite-comment-single; }
.ch { color: $codehilite-comment-shebang; }
.cs { color: $codehilite-comment-special; }
// Names
.na { color: $codehilite-name-attribute; }
.nb { color: $codehilite-name-builtin; }
.bp { color: $codehilite-name-builtin-pseudo; }
.nc { color: $codehilite-name-class; }
.no { color: $codehilite-name-constant; }
.nd { color: $codehilite-name-entity; }
.ni { color: $codehilite-name-entity; }
.ne { color: $codehilite-name-exception; }
.nf { color: $codehilite-name-function; }
.nl { color: $codehilite-name-label; }
.nn { color: $codehilite-name-namespace; }
.nt { color: $codehilite-name-tag; }
.nv { color: $codehilite-name-variable; }
.vc { color: $codehilite-name-variable-class; }
.vg { color: $codehilite-name-variable-global; }
.vi { color: $codehilite-name-variable-instance; }
.nx { color: $codehilite-name-extension; }
// Numbers
.m { color: $codehilite-literal-number; }
.mf { color: $codehilite-literal-number-float; }
.mh { color: $codehilite-literal-number-hex; }
.mi { color: $codehilite-literal-number-integer; }
.il { color: $codehilite-literal-number-integer-long; }
.mo { color: $codehilite-literal-number-oct; }
// Strings
.s { color: $codehilite-literal-string; }
.sb { color: $codehilite-literal-string-backticks; }
.sc { color: $codehilite-literal-string-char; }
.sd { color: $codehilite-literal-string-doc; }
.s2 { color: $codehilite-literal-string-double; }
.se { color: $codehilite-literal-string-escape; }
.sh { color: $codehilite-literal-string-heredoc; }
.si { color: $codehilite-literal-string-interpol; }
.sx { color: $codehilite-literal-string-other; }
.sr { color: $codehilite-literal-string-regex; }
.s1 { color: $codehilite-literal-string-single; }
.ss { color: $codehilite-literal-string-symbol; }
// Miscellaneous
.err { color: $codehilite-error; }
.w { color: $codehilite-whitespace; }
// Highlighted lines
.hll {
display: block;
margin: 0 px2rem(-12px);
padding: 0 px2rem(12px);
background-color: transparentize($clr-yellow-500, 0.5);
// [mobile -]: Stretch to whole width
@include break-to-device(mobile) {
margin: 0 px2rem(-16px);
padding: 0 px2rem(16px);
}
}
}
// ----------------------------------------------------------------------------
// Rules: layout
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// If code blocks are wrapped with codehilite, the styles must be adjusted
// so the marker stretches to the whole width and the padding is respected
.codehilite {
position: relative;
margin: 1em 0;
padding: 0;
border-radius: px2rem(2px);
background-color: $md-code-background;
color: $md-code-color;
line-height: 1.4;
-webkit-overflow-scrolling: touch;
// Actual container with code, overflowing
pre,
code {
display: block;
margin: 0;
padding: px2rem(10.5px) px2rem(12px);
background-color: transparent;
overflow: auto;
vertical-align: top;
// Override native scrollbar styles
&::-webkit-scrollbar {
width: px2rem(4px);
height: px2rem(4px);
}
// Style scrollbar thumb
&::-webkit-scrollbar-thumb {
background-color: $md-color-black--lighter;
// Hovered scrollbar thumb
&:hover {
background-color: $md-color-accent;
}
}
}
}
// If not using Pygments, code will be under pre > code
pre.codehilite {
overflow: visible;
// Actual container with code, overflowing
code {
display: block;
padding: px2rem(10.5px) px2rem(12px);
overflow: auto;
}
}
// Block with line numbers
.codehilitetable {
display: block;
margin: 1em 0;
border-radius: 0.2em;
font-size: ms(0);
overflow: hidden;
// Set table elements to block layout, because otherwise the whole flexbox
// hacking won't work correctly
tbody,
td {
display: block;
padding: 0;
}
// We need to use flexbox layout, because otherwise it's not possible to
// make the code container scroll while keeping the line numbers static
tr {
display: flex;
}
// The pre tags are nested inside a table, so we need to remove the
// margin because it collapses below all the overflows
.codehilite,
.linenodiv {
margin: 0;
border-radius: 0;
}
// Add spacing to line number container
.linenodiv {
padding: px2rem(10.5px) px2rem(12px);
}
// Disable user selection, so code can be easily copied without
// accidentally also copying the line numbers
.linenos {
background-color: $md-color-black--lightest;
color: $md-color-black--lighter;
user-select: none;
// Reset spacings
pre {
margin: 0;
padding: 0;
background-color: transparent;
color: inherit;
text-align: right;
}
}
// The table cell containing the code container wrapper and code should
// stretch horizontally to the remaining space
.code {
flex: 1;
overflow: hidden;
}
}
// Full-width container
> .codehilite {
// [mobile -]: Stretch to whole width
@include break-to-device(mobile) {
margin: 1em px2rem(-16px);
border-radius: 0;
// Actual container with code, overflowing
pre,
code {
padding: px2rem(10.5px) px2rem(16px);
}
}
}
// Full-width container on top-level
> .codehilitetable {
box-shadow: none;
// [mobile -]: Stretch to whole width
@include break-to-device(mobile) {
margin: 1em px2rem(-16px);
border-radius: 0;
// Increase spacing
.codehilite > pre,
.codehilite > code,
.linenodiv {
padding: px2rem(10px) px2rem(16px);
}
}
}
// When pymdownx.superfences is enabled but codehilite is disabled,
// pymdownx.highlight will be used. When this happens, the outer
// container and tables get this class names by default.
.highlight {
@extend .codehilite;
}
// Same as above, but for code blocks with line numbers enabled
.highlighttable {
@extend .codehilitetable;
}
}

View file

@ -0,0 +1,149 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// All footnote references
[id^="fnref:"] {
display: inline-block;
// Targeted anchor
&:target {
margin-top: -1 * px2rem(48px + 12px + 16px);
padding-top: px2rem(48px + 12px + 16px);
pointer-events: none;
}
}
// All footnote back references
[id^="fn:"] {
// Add spacing to anchor for offset
&::before {
display: none;
height: 0;
content: "";
}
// Targeted anchor
&:target::before {
display: block;
margin-top: -1 * px2rem(48px + 12px + 10px);
padding-top: px2rem(48px + 12px + 10px);
pointer-events: none;
}
}
// Footnotes extension
.footnote {
color: $md-color-black--light;
font-size: ms(-1);
// Remove additional spacing on footnotes
ol {
margin-left: 0;
}
// Footnote
li {
transition: color 0.25s;
// Darken color for targeted footnote
&:target {
color: $md-color-black;
}
// Remove spacing on first element
:first-child {
margin-top: 0;
}
// Make back references visible on hover
&:hover .footnote-backref,
&:target .footnote-backref {
transform: translateX(0);
opacity: 1;
}
// Active or targeted back reference
&:hover .footnote-backref:hover,
&:target .footnote-backref {
color: $md-color-accent;
}
}
}
// Footnote reference
.footnote-ref {
display: inline-block;
pointer-events: initial;
// Render a thin line before footnote
&::before {
display: inline;
margin: 0 0.2em;
border-left: px2rem(1px) solid $md-color-black--lighter;
font-size: 1.25em;
content: "";
vertical-align: px2rem(-5px);
}
}
// Footnote back reference
.footnote-backref {
@extend %md-icon;
display: inline-block;
transform: translateX(px2rem(5px));
transition:
transform 0.25s 0.125s,
color 0.25s,
opacity 0.125s 0.125s;
color: $md-color-black--lighter;
// Hack: remove Unicode arrow for icon
font-size: 0;
opacity: 0;
vertical-align: text-bottom;
// Adjust for RTL languages
[dir="rtl"] & {
transform: translateX(px2rem(-5px));
}
// Back reference icon
&::before {
display: inline-block;
font-size: px2rem(16px);
content: "\E31B"; // keyboard_return
// Adjust for RTL languages
[dir="rtl"] & {
transform: scaleX(-1)
}
}
}
}

View file

@ -0,0 +1,54 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// stylelint-disable selector-class-pattern
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// MathJax integration - add padding to omit vertical scrollbar
.MJXc-display {
margin: 0.75em 0;
padding: 0.75em 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
// Stretch top-level containers
> p > .MJXc-display {
// [mobile -]: Stretch to whole width
@include break-to-device(mobile) {
margin: 0.75em px2rem(-16px);
padding: 0.25em px2rem(16px);
}
}
// Remove outline on tab index
.MathJax_CHTML {
outline: 0;
}
}

View file

@ -0,0 +1,93 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// Deletions, additions and comments
del.critic,
ins.critic,
.critic.comment {
margin: 0 0.25em;
padding: 0.0625em 0;
border-radius: px2rem(2px);
box-decoration-break: clone;
}
// Deletion
del.critic {
background-color: $codehilite-diff-deleted; // TODO: dependent on order of inclusion
box-shadow:
+0.25em 0 0 $codehilite-diff-deleted,
-0.25em 0 0 $codehilite-diff-deleted;
}
// Addition
ins.critic {
background-color: $codehilite-diff-inserted; // TODO: dependent on order of inclusion
box-shadow:
+0.25em 0 0 $codehilite-diff-inserted,
-0.25em 0 0 $codehilite-diff-inserted;
}
// Comment
.critic.comment {
background-color: $md-code-background; // TODO: rename, centralize somehow
color: $md-code-color;
box-shadow:
+0.25em 0 0 $md-code-background,
-0.25em 0 0 $md-code-background;
// Icon
&::before {
@extend %md-icon;
padding-right: 0.125em;
color: $md-color-black--lighter;
content: "\E0B7"; // chat
vertical-align: -0.125em;
}
}
// Block
.critic.block {
display: block;
margin: 1em 0;
padding-right: px2rem(16px);
padding-left: px2rem(16px);
box-shadow: none;
// Decrease spacing on first element
:first-child {
margin-top: 0.5em;
}
// Decrease spacing on last element
:last-child {
margin-bottom: 0.5em;
}
}
}

View file

@ -0,0 +1,109 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// Details extension
details {
@extend .admonition;
display: block;
padding-top: 0;
// Rotate title icon
&[open] > summary::after {
transform: rotate(180deg);
}
// Remove bottom spacing
&:not([open]) {
padding-bottom: 0;
// Remove bottom border if block is closed
> summary {
border-bottom: none;
}
}
// Increase spacing to the right - scoped here for higher specificity
summary {
padding-right: px2rem(40px);
// Adjust for RTL languages
[dir="rtl"] & {
padding-left: px2rem(40px);
}
}
// Manually hide and show, if browser doesn't support details
.no-details &:not([open]) {
// Hide all nested tags ...
> * {
display: none;
}
// ... but show title
summary {
display: block;
}
}
}
// Title
summary {
@extend .admonition-title;
// Hack: set to block, so Firefox doesn't render marker
display: block;
outline: none;
cursor: pointer;
// Remove default details marker
&::-webkit-details-marker {
display: none;
}
// Icon
&::after {
@extend %md-icon;
position: absolute;
top: px2rem(8px);
right: px2rem(12px);
color: $md-color-black--lighter;
font-size: px2rem(20px);
content: "\E313"; // keyboard_arrow_down
// Adjust for RTL languages
[dir="rtl"] & {
right: initial;
left: px2rem(12px);
}
}
}
}

View file

@ -0,0 +1,35 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// Correct alignment of emojis
.emojione {
width: px2rem(20px);
vertical-align: text-top;
}
}

View file

@ -0,0 +1,37 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// Qualified class selector to distinguish inline code from code blocks
code.codehilite {
$correct: 1 / 0.85;
margin: 0 0.25em * $correct;
padding: 0.0625em * $correct 0;
}
}

View file

@ -0,0 +1,100 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// Tabbed code block content
.superfences-content {
display: none;
order: 99;
width: 100%;
background-color: $md-color-white;
// Actual content
> * {
margin: 0;
border-radius: 0
}
}
// Tabbed code block container
.superfences-tabs {
display: flex;
position: relative;
flex-wrap: wrap;
margin: 1em 0;
border: px2rem(1px) solid $md-color-black--lightest;
border-radius: 0.2em;
// Hide radio buttons
> input {
display: none;
// Active tab label
&:checked + label {
font-weight: 700;
// Show code tab content
& + .superfences-content {
display: block;
}
}
}
// Tab label
> label {
width: auto;
padding: px2rem(12px);
transition: color 0.125s;
font-size: ms(-1);
cursor: pointer;
// Hovered tab label
html &:hover {
color: $md-color-accent;
}
}
}
// Full-width container on top-level
> .superfences-tabs {
// [mobile -]: Stretch to whole width
@include break-to-device(mobile) {
margin: 1em px2rem(-16px);
border: 0;
border-top: px2rem(1px) solid $md-color-black--lightest;
border-radius: 0;
// Actual container with code, overflowing
pre,
code {
padding: px2rem(10.5px) px2rem(16px);
}
}
}
}

View file

@ -0,0 +1,83 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
article {
// Remove list icon on task items
.task-list-item {
position: relative;
list-style-type: none;
// Make checkbox items align with normal list items, but position
// everything in ems for correct layout at smaller font sizes
[type="checkbox"] {
position: absolute;
top: 0.45em;
left: -2em;
// Adjust for RTL languages
[dir="rtl"] & {
right: -2em;
left: initial;
}
}
}
// Wrapper for list controls, in case custom checkboxes are enabled
.task-list-control {
// Checkbox icon in unchecked state
.task-list-indicator::before {
@extend %md-icon;
position: absolute;
top: 0.15em;
left: -1.25em;
color: $md-color-black--lighter;
font-size: 1.25em;
content: "\E835"; // check_box_outline_blank
vertical-align: -0.25em;
// Adjust for RTL languages
[dir="rtl"] & {
right: -1.25em;
left: initial;
}
}
// Checkbox icon in checked state
[type="checkbox"]:checked + .task-list-indicator::before {
content: "\E834"; // check_box
}
// Hide original checkbox behind icon
[type="checkbox"] {
opacity: 0;
z-index: -1;
}
}
}

View file

@ -0,0 +1,250 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Variables
// ----------------------------------------------------------------------------
///
/// Device-specific breakpoints
///
/// @example
/// $break-devices: (
/// mobile: (
/// portrait: 220px 479px,
/// landscape: 480px 719px
/// ),
/// tablet: (
/// portrait: 720px 959px,
/// landscape: 960px 1219px
/// ),
/// screen: (
/// small: 1220px 1599px,
/// medium: 1600px 1999px,
/// large: 2000px
/// )
/// );
///
/// @group helpers
/// @access private
/// @type Map
///
$break-devices: () !default;
// ----------------------------------------------------------------------------
// Helpers
// ----------------------------------------------------------------------------
///
/// Choose minimum and maximum device widths
///
/// @group helpers
/// @access private
/// @param {Map} $devices Map of devices
/// @return {List} Minimum and maximum width
///
@function break-select-min-max($devices) {
$min: 1000000;
$max: 0;
@each $key, $value in $devices {
@while type-of($value) == map {
$value: break-select-min-max($value);
}
@if type-of($value) == list {
@each $number in $value {
@if type-of($number) == number {
$min: min($number, $min);
@if $max != null {
$max: max($number, $max);
}
} @else {
@error "Invalid number: #{$number}";
}
}
} @elseif type-of($value) == number {
$min: min($value, $min);
$max: null;
} @else {
@error "Invalid value: #{$value}";
}
}
@return $min, $max;
}
///
/// Select minimum and maximum widths for a device breakpoint
///
/// @group helpers
/// @access private
/// @param {String} $device Device
/// @return {List} Minimum and maximum width
///
@function break-select-device($device) {
$current: $break-devices;
@for $n from 1 through length($device) {
@if type-of($current) == map {
$current: map-get($current, nth($device, $n));
} @else {
@error "Invalid device map: #{$devices}";
}
}
@if type-of($current) == list or type-of($current) == number {
$current: (default: $current);
}
@return break-select-min-max($current);
}
// ----------------------------------------------------------------------------
// Mixins
// ----------------------------------------------------------------------------
///
/// A minimum-maximum media query breakpoint
///
/// @group helpers
/// @access public
/// @param {Number|List} $breakpoint Number or number pair
///
@mixin break-at($breakpoint) {
@if type-of($breakpoint) == number {
@media only screen and (min-width: $breakpoint) {
@content;
}
} @elseif type-of($breakpoint) == list {
$min: nth($breakpoint, 1);
$max: nth($breakpoint, 2);
@if type-of($min) == number and type-of($max) == number {
@media only screen and (min-width: $min) and (max-width: $max) {
@content;
}
} @else {
@error "Invalid breakpoint: #{$breakpoint}";
}
} @else {
@error "Invalid breakpoint: #{$breakpoint}";
}
}
///
/// An orientation media query breakpoint
///
/// @group helpers
/// @access public
/// @param {String} $breakpoint Orientation
///
@mixin break-at-orientation($breakpoint) {
@if type-of($breakpoint) == string {
@media only screen and (orientation: $breakpoint) {
@content;
}
} @else {
@error "Invalid breakpoint: #{$breakpoint}";
}
}
///
/// A maximum-aspect-ratio media query breakpoint
///
/// @group helpers
/// @access public
/// @param {Number} $breakpoint Ratio
///
@mixin break-at-ratio($breakpoint) {
@if type-of($breakpoint) == number {
@media only screen and (max-aspect-ratio: $breakpoint) {
@content;
}
} @else {
@error "Invalid breakpoint: #{$breakpoint}";
}
}
///
/// A minimum-maximum media query device breakpoint
///
/// @group helpers
/// @access public
/// @param {String|List} $breakpoint Device
///
@mixin break-at-device($device) {
@if type-of($device) == string {
$device: $device,;
}
@if type-of($device) == list {
$breakpoint: break-select-device($device);
@if nth($breakpoint, 2) != null {
$min: nth($breakpoint, 1);
$max: nth($breakpoint, 2);
@media only screen and (min-width: $min) and (max-width: $max) {
@content;
}
} @else {
@error "Invalid device: #{$device}";
}
} @else {
@error "Invalid device: #{$device}";
}
}
///
/// A minimum media query device breakpoint
///
/// @group helpers
/// @access public
/// @param {String|List} $breakpoint Device
///
@mixin break-from-device($device) {
@if type-of($device) == string {
$device: $device,;
}
@if type-of($device) == list {
$breakpoint: break-select-device($device);
$min: nth($breakpoint, 1);
@media only screen and (min-width: $min) {
@content;
}
} @else {
@error "Invalid device: #{$device}";
}
}
///
/// A maximum media query device breakpoint
///
/// @group helpers
/// @access public
/// @param {String|List} $breakpoint Device
///
@mixin break-to-device($device) {
@if type-of($device) == string {
$device: $device,;
}
@if type-of($device) == list {
$breakpoint: break-select-device($device);
$max: nth($breakpoint, 2);
@media only screen and (max-width: $max) {
@content;
}
} @else {
@error "Invalid device: #{$device}";
}
}

View file

@ -0,0 +1,69 @@
////
/// Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// stylelint-disable unit-whitelist
// ----------------------------------------------------------------------------
// Helpers
// ----------------------------------------------------------------------------
///
/// Convert font size in px to em.
///
/// @group helpers
/// @access public
/// @param {Number} $size Font size in px
/// @param {Number} $base Base font size
/// @return {Number} Font size in em
///
@function px2em($size, $base: 16px) {
@if unit($size) == px {
@if unit($base) == px {
@return ($size / $base) * 1em;
} @else {
@error "Invalid base: #{$base} - unit must be 'px'";
}
} @else {
@error "Invalid size: #{$size} - unit must be 'px'";
}
}
///
/// Convert font size in px to rem.
///
/// @group helpers
/// @access public
/// @param {Number} $size Font size in px
/// @param {Number} $base Base font size
/// @return {Number} Font size in rem
///
@function px2rem($size, $base: 20px) {
@if unit($size) == px {
@if unit($base) == px {
@return ($size / $base) * 1.0rem;
} @else {
@error "Invalid base: #{$base} - unit must be 'px'";
}
} @else {
@error "Invalid size: #{$size} - unit must be 'px'";
}
}

80
mkdocs.yml Normal file
View file

@ -0,0 +1,80 @@
site_name: GeyserMC
site_author: Geyser Devs
site_url: https://github.com/GeyserMC/Geyser
site_dir: build/docs
repo_name: GeyserMC/Geyser
repo_url: https://github.com/GeyserMC/Geyser
#edit_uri: ""
copyright: 'Copyright (C) 2020 GeyserMC Developers'
extra_css:
- 'css/mkpdf.css'
# - 'css/version_select.css'
#extra_javascript:
# - 'js/version_select.js'
# More info on this theme: https://squidfunk.github.io/mkdocs-material
theme:
name: 'material'
logo: 'img/header_logo.png'
favicon: 'img/favicon.ico'
palette:
primary: 'indigo'
accent: 'indigo'
features:
- instant
# See the following for docs on these extensions: https://squidfunk.github.io/mkdocs-material/extensions
markdown_extensions:
- codehilite:
linenums: true
- admonition
- pymdownx.arithmatex
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.emoji:
emoji_generator: !!python/name:pymdownx.emoji.to_svg
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- toc:
permalink: true
# - footnotes
# - metadata
# Bundie's Tip: Disable mkpdfs whilst using `mkdocs serve` on a local machine
plugins:
- search
- exclude:
glob:
- 'theme/*'
- git-revision-date-localized:
type: timeago
- mkpdfs:
author: GeyserMC Developers
toc_title: Table of contents
output_path: pdf/documentation.pdf
design: docs/css/pdf.css
# Discord not yet supported but it will be soon
#extra:
# social:
# - type: discord
# link: https://discord.gg/blahblah
nav:
- Introduction: index.md
- Events: events.md
- Plugins: plugins.md
- Contributing: contributing.md

7
requirements.txt Normal file
View file

@ -0,0 +1,7 @@
mkdocs==1.1
mkdocs-exclude==1.0.2
mkdocs-material==5.1.3
#mkpdfs-mkdocs==1.0.1
git+https://github.com/jwaschkau/mkpdfs-mkdocs-plugin.git@fix/string-types
mkdocs-git-revision-date-localized-plugin==0.5.0