Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(test) added pdf exporter plugin #256

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ If connection is successful (binance-smart-chain-mainnet):
The pancakeswap connector now uses wallet [pubKey] on binance-smart-chain-mainnet
```

![](./pancakeswap-connect.png)

Run `gateway connector-tokens` to add tokens to the `gateway balance` command:

![](./pancakeswap-connector-tokens.png)

## 2️⃣ AMM Connector
*Integration to this DEX's swap pricing and execution endpoints*

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/scripts/cheatsheet.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pdf: true
---

See below for reference docs that help you create Scripts that inherit from the [`ScriptStrategy`](https://github.com/hummingbot/hummingbot/blob/master/hummingbot/strategy/script_strategy_base.py) base class.

This Script Strategies Cheatsheet is also available in [PDF form](./cheatsheet.pdf).
Expand Down
27 changes: 20 additions & 7 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ theme:
icon:
repo: fontawesome/brands/github
palette:
# - media: "(prefers-color-scheme: dark)"
- scheme: slate
accent: amber
toggle:
icon: material/brightness-2
name: "Switch to light mode"
# - media: "(prefers-color-scheme: light)"
- scheme: default
accent: deep purple
toggle:
icon: material/brightness-5
name: "Switch to dark mode"
# - media: "(prefers-color-scheme: dark)"
- scheme: slate
accent: amber
toggle:
icon: material/brightness-2
name: "Switch to light mode"
font:
text: Noto Sans
code: Roboto Mono
Expand Down Expand Up @@ -70,9 +70,22 @@ plugins:
archive_toc: true
categories_toc: true
post_url_format: "{slug}"

- tags:
tags_file: academy/all.md
- exporter
- exporter-pdf:
explicit: true
- exporter-extras:
buttons:
- title: Download as PDF
icon: material-file-download-outline
enabled: !!python/name:mkdocs_exporter.plugins.pdf.button.enabled
attributes:
href: !!python/name:mkdocs_exporter.plugins.pdf.button.href
download: !!python/name:mkdocs_exporter.plugins.pdf.button.download



# - git-revision-date
# - mkdocs-video

Expand Down
73 changes: 73 additions & 0 deletions resources/stylesheets/pdf.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
:root {
--width: 21cm;
--margin: 1.20cm;
--height: 29.7cm;
--offset: calc(var(--margin) * 2);
}

@page {
size: A4;
margin: 1.20cm;
}

hr:has(+ div.md-source-file), .md-source-file {
display: none !important;
}

summary::after {
display: none;
}

.front-cover {
margin: var(--margin);
height: calc(var(--height) - var(--offset));
page-break-after: always;
border: 1px solid #fff;
position: relative;

img {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
image-rendering: optimizeQuality;
}

> section {
color: #fff;
padding: 0.635cm;
max-width: 10.25cm;
word-wrap: break-word;
margin-top: calc(var(--height) / 2 - var(--offset) - 2cm);
font-size: 13pt;

> .title {
font-size: 26pt;
font-weight: 500;
line-height: 1.1;
color: #fff;
}
}
}

h1, h2, h3 {
string-set: chapter content();
}

body {
print-color-adjust: exact;
text-rendering: geometricPrecision;
}

.md-main .md-main__inner {
margin: 0;
}

.md-content .md-content__inner {
margin: 0;
padding: 0;

&::before {
height: 0;
}
}
43 changes: 43 additions & 0 deletions resources/templates/covers/back.html.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<style data-teleport="head">
.back-cover {
page: last;
height: 100%;
}

.back-cover img {
top: 0;
left: 0;
position: absolute;
}

.back-cover section {
.title {
color: #fff;
position: absolute;
top: 50%;
left: 0;
vertical-align: middle;
font-size: 24pt;
text-align: center;
width: 100%;
}
}

@page last {
margin: 0;
background: var(--md-primary-fg-color);

@top-center {
content: none;
}

@bottom-center {
content: none;
}
}
</style>
<div class="back-cover">
<section>
<div class="title">{{ config.site_name }}</div>
</section>
</div>
97 changes: 97 additions & 0 deletions resources/templates/covers/front.html.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<style data-teleport="head">
.front-cover {
margin: var(--margin);
height: calc(var(--height) - var(--offset));
page-break-after: always;
border: 1px solid #fff;
position: relative;

img {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
image-rendering: optimizeQuality;
}

.logo {
position: absolute;
top: calc(2cm);
fill: white;
left: 50%;
transform: translateX(-50%);

> div {
width: 3cm;
text-align: center;
height: 3cm;
}
}

section {
color: #fff;
padding: 0.635cm;
max-width: 10.25cm;
word-wrap: break-word;
margin-top: calc(var(--height) / 2 - var(--offset) - 2cm);
font-size: 13pt;

> .title {
font-size: 32pt;
font-weight: 500;
line-height: 1.1;
margin-top: 1em;
color: #fff;
string-set: title content(text);
}

> .version {
line-height: 1;
font-size: 10pt;
font-family: monospace;
}
}
}

@page {
@top-center {
font-size: 9pt;
color: #7f7f7f;
content: '{{ config.site_name }}' ' — ' string(title);
}

@bottom-center {
font-size: 9pt;
color: #7f7f7f;
content: 'Page ' counter(page) ' of ' counter(pages);
}
}

@page :first {
margin: 0;
background: var(--md-primary-fg-color);

@top-center {
content: none;
}

@bottom-center {
content: none;
}
}
</style>
<div class="front-cover">
<img src="/assets/images/background.png">
<div class="logo">
<div>
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="m23 19-3-3v2h-4v2h4v2l3-3m-10 0c0-.3 0-.7.1-1H6v-2h7.8c.5-.8 1.1-1.5 1.9-2H6v-2h12v1.1c.3-.1.7-.1 1-.1s.7 0 1 .1V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h7.8c-.5-.9-.8-1.9-.8-3m0-15.5L18.5 9H13V3.5Z"></path>
</svg>
</div>
</div>
<section>
<div class="brand">{{ config.site_name }}</div>
<div class="version">{{ version }}</div>
<div class="title">{{ page.title }}</div>
</section>
</div>