aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2023-10-07 17:48:53 +0800
committer简律纯 <i@jyunko.cn>2023-10-07 17:48:53 +0800
commit694062d71ed41d0aa9cc9842ae9085afd37dfbe2 (patch)
tree74bd58ff5b65af97ab2a7143341f2ac6ac4fe445
parent98e083b124abb860f09568bb9688672af2d5de29 (diff)
downloadinfini-694062d71ed41d0aa9cc9842ae9085afd37dfbe2.tar.gz
infini-694062d71ed41d0aa9cc9842ae9085afd37dfbe2.zip
feat(css): change style
-rw-r--r--docs/images/logo.pngbin0 -> 235361 bytes
-rw-r--r--docs/stylesheets/extra.css6
-rw-r--r--material/overrides/assets/stylesheets/custom.00c04c01.min.css12
-rw-r--r--mkdocs.yml3
-rw-r--r--pdm.lock82
-rw-r--r--pyproject.toml1
-rw-r--r--tests/reportlab/1.1.py32
-rw-r--r--tests/reportlab/card.pdfbin0 -> 50964 bytes
-rw-r--r--tests/reportlab/card.pngbin0 -> 1945 bytes
9 files changed, 121 insertions, 15 deletions
diff --git a/docs/images/logo.png b/docs/images/logo.png
new file mode 100644
index 00000000..8b5a14c8
--- /dev/null
+++ b/docs/images/logo.png
Binary files differ
diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css
index bf34cb9a..efe4f0c4 100644
--- a/docs/stylesheets/extra.css
+++ b/docs/stylesheets/extra.css
@@ -14,7 +14,11 @@
}
.md-header {
- background-color: #30323a;
+ background-color: #1d2238;
+}
+
+.md-tabs {
+ background-color: #1d2238;
}
.md-typeset .twitter {
diff --git a/material/overrides/assets/stylesheets/custom.00c04c01.min.css b/material/overrides/assets/stylesheets/custom.00c04c01.min.css
index 44a2f2d0..3d441c39 100644
--- a/material/overrides/assets/stylesheets/custom.00c04c01.min.css
+++ b/material/overrides/assets/stylesheets/custom.00c04c01.min.css
@@ -13,18 +13,6 @@
}
}
-.md-header {
- background-color: #30323a;
- box-shadow: 0 0 0.2rem #0000, 0 0.2rem 0.4rem #0000;
- color: var(--md-primary-bg-color);
- display: block;
- left: 0;
- position: sticky;
- right: 0;
- top: 0;
- z-index: 4;
-}
-
.md-typeset .twitter {
color: #00acee
diff --git a/mkdocs.yml b/mkdocs.yml
index a0df7f27..82ceefc2 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -9,8 +9,9 @@ site_description: >-
theme:
name: material
language: zh
+ favicon: images/logo.png
icon:
- logo: material/library-outline
+ logo: material/book-sync
repo: fontawesome/brands/git-alt
custom_dir: material/overrides
features:
diff --git a/pdm.lock b/pdm.lock
index 1719a6bf..3fb41438 100644
--- a/pdm.lock
+++ b/pdm.lock
@@ -6,7 +6,7 @@ groups = ["default"]
cross_platform = true
static_urls = false
lock_version = "4.3"
-content_hash = "sha256:aac2ab75c17394665d42bf7713cd686f76c0c4a6f3a72b53e5f1cad7d78e113b"
+content_hash = "sha256:5d7c1be81b0f4501c46e7c5f40f7b9b62ceedf2f3fa0b28003d5981dc3e1d0d9"
[[package]]
name = "anyio"
@@ -337,6 +337,21 @@ files = [
]
[[package]]
+name = "freetype-py"
+version = "2.3.0"
+requires_python = ">=3.7"
+summary = "Freetype python bindings"
+files = [
+ {file = "freetype-py-2.3.0.zip", hash = "sha256:f9b64ce3272a5c358dcee824800a32d70997fb872a0965a557adca20fce7a5d0"},
+ {file = "freetype_py-2.3.0-py3-none-macosx_10_9_universal2.whl", hash = "sha256:ca7155de937af6f26bfd9f9089a6e9b01fa8f9d3040a3ddc0aeb3a53cf88f428"},
+ {file = "freetype_py-2.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ccdb1616794a8ad48beaa9e29d3494e6643d24d8e925cc39263de21c062ea5a7"},
+ {file = "freetype_py-2.3.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c8f17c3ac35dc7cc9571ac37a00a6daa428a1a6d0fe6926a77d16066865ed5ef"},
+ {file = "freetype_py-2.3.0-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:89cee8f4e7cf0a37b73a43a08c88703d84e3b9f9243fc665d8dc0b72a5d206a8"},
+ {file = "freetype_py-2.3.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:b95ccd52ff7e9bef34505f8af724cee114a3c3cc9cf13e0fd406fa0cc92b988a"},
+ {file = "freetype_py-2.3.0-py3-none-win_amd64.whl", hash = "sha256:3a552265b06c2cb3fa54f86ed6fcbf045d8dc8176f9475bedddf9a1b31f5402f"},
+]
+
+[[package]]
name = "ghp-import"
version = "2.1.0"
summary = "Copy your docs directly to the gh-pages branch."
@@ -986,6 +1001,29 @@ files = [
]
[[package]]
+name = "pycairo"
+version = "1.25.0"
+requires_python = ">=3.8"
+summary = "Python interface for cairo"
+files = [
+ {file = "pycairo-1.25.0-cp310-cp310-win32.whl", hash = "sha256:a8b08f198a45b5e505c1475ed9c3b1a39993b9ebff0e18dd9f194927de6411b7"},
+ {file = "pycairo-1.25.0-cp310-cp310-win_amd64.whl", hash = "sha256:f5d29720075d0d3cc1eef8abb3a3069951b466f04583976adfd770e71bc5be3a"},
+ {file = "pycairo-1.25.0-cp310-cp310-win_arm64.whl", hash = "sha256:7f1390e5e81719bfcf30ad667c09188caa1d3bd190f9af40efcd13e25b7cf25b"},
+ {file = "pycairo-1.25.0-cp311-cp311-win32.whl", hash = "sha256:2e4da8be0a696c2e8a1709f5a2bd849e802147769439ea4268f926695f4b5a55"},
+ {file = "pycairo-1.25.0-cp311-cp311-win_amd64.whl", hash = "sha256:c40ce034a07266460bc3318a179aa43b2824d36754906831a90c99fb4f246370"},
+ {file = "pycairo-1.25.0-cp311-cp311-win_arm64.whl", hash = "sha256:6654201d10c5f13975caec648796b1e0e2b0f8af1e4302a086dc3183bb8346ee"},
+ {file = "pycairo-1.25.0-cp312-cp312-win32.whl", hash = "sha256:caa76409cae523f7c5254ee75935d8d520efa96eaf22c64f26c8e24ca74f8281"},
+ {file = "pycairo-1.25.0-cp312-cp312-win_amd64.whl", hash = "sha256:ec0e05fe7a0d2fc1ef0d6babc19b8b2d731af3ab1638fcdcaad2d42204a487f2"},
+ {file = "pycairo-1.25.0-cp312-cp312-win_arm64.whl", hash = "sha256:8690cc2cba6bd223cc9703a9a7b392fe1bec78003662c6dbc9869d81ee343bdf"},
+ {file = "pycairo-1.25.0-cp38-cp38-win32.whl", hash = "sha256:439c62c3c744aabb70ab6b97f04e0d58e587cc35c2e9f52d1bb2f47f852ea2de"},
+ {file = "pycairo-1.25.0-cp38-cp38-win_amd64.whl", hash = "sha256:9f0ee34c6ca1e7ef970d51fb68e5a6a02a374d2e679ceddf891dfc53408b11c7"},
+ {file = "pycairo-1.25.0-cp39-cp39-win32.whl", hash = "sha256:659b0b701767bbfe16ad3cb291717039555bf4d0b857f64acc7e40e1b39660bc"},
+ {file = "pycairo-1.25.0-cp39-cp39-win_amd64.whl", hash = "sha256:1eb0fe7738e770057017f185a76aaad9aa280da1bdf0571fb85b7e116eeb3001"},
+ {file = "pycairo-1.25.0-cp39-cp39-win_arm64.whl", hash = "sha256:c986f7ee44dee9c6b119604f8f33480d9f5410e550a8bbda5d333742a867a53c"},
+ {file = "pycairo-1.25.0.tar.gz", hash = "sha256:37842b9bfa6339c45a5025f752e1d78d5840b1a0f82303bdd5610846ad8b5c4f"},
+]
+
+[[package]]
name = "pycparser"
version = "2.21"
requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
@@ -1183,6 +1221,35 @@ files = [
]
[[package]]
+name = "reportlab"
+version = "4.0.5"
+requires_python = ">=3.7,<4"
+summary = "The Reportlab Toolkit"
+dependencies = [
+ "pillow>=9.0.0",
+]
+files = [
+ {file = "reportlab-4.0.5-py3-none-any.whl", hash = "sha256:1344dbe779b9049a1888105503837d0e5b62163bf5c6b33bd1fbe84bad484f50"},
+ {file = "reportlab-4.0.5.tar.gz", hash = "sha256:9c68f277736f585c5c9938755b826dd57c877fcaeb203e21cefea12b3b1db4f5"},
+]
+
+[[package]]
+name = "reportlab"
+version = "4.0.5"
+extras = ["pycairo"]
+requires_python = ">=3.7,<4"
+summary = "The Reportlab Toolkit"
+dependencies = [
+ "freetype-py<2.4,>=2.3.0",
+ "reportlab==4.0.5",
+ "rlPyCairo<1,>=0.2.0",
+]
+files = [
+ {file = "reportlab-4.0.5-py3-none-any.whl", hash = "sha256:1344dbe779b9049a1888105503837d0e5b62163bf5c6b33bd1fbe84bad484f50"},
+ {file = "reportlab-4.0.5.tar.gz", hash = "sha256:9c68f277736f585c5c9938755b826dd57c877fcaeb203e21cefea12b3b1db4f5"},
+]
+
+[[package]]
name = "requests"
version = "2.31.0"
requires_python = ">=3.7"
@@ -1214,6 +1281,19 @@ files = [
]
[[package]]
+name = "rlpycairo"
+version = "0.3.0"
+requires_python = ">=3.7"
+summary = "Plugin backend renderer for reportlab.graphics.renderPM"
+dependencies = [
+ "freetype-py>=2.3",
+ "pycairo>=1.20.0",
+]
+files = [
+ {file = "rlPyCairo-0.3.0-py3-none-any.whl", hash = "sha256:f6ec712a76914f78c1491351e1d79eeb1a40d072accf5d36075e399963c17b17"},
+]
+
+[[package]]
name = "setuptools"
version = "68.2.2"
requires_python = ">=3.8"
diff --git a/pyproject.toml b/pyproject.toml
index 37009f40..e214593d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -21,6 +21,7 @@ dependencies = [
"mike>=1.1.2",
"mkdocstrings>=0.23.0",
"distribute>=0.7.3",
+ "reportlab[pycairo]>=4.0.5",
]
requires-python = ">=3.8"
readme = "README.md"
diff --git a/tests/reportlab/1.1.py b/tests/reportlab/1.1.py
new file mode 100644
index 00000000..0cd4ee8d
--- /dev/null
+++ b/tests/reportlab/1.1.py
@@ -0,0 +1,32 @@
+from reportlab.lib import colors
+from reportlab.graphics.shapes import (Drawing, Rect, String, Line, Group)
+from reportlab.pdfbase.pdfmetrics import registerFont
+from reportlab.pdfbase.ttfonts import TTFont
+
+# font
+registerFont(TTFont("Times", "C:\Windows\Fonts\Times.ttf"))
+
+drawing = Drawing(400, 200)
+# beige rectangle
+r1 = Rect(0, 0, 400, 200, 0, 0)
+r1.fillColor = colors.beige
+drawing.add(r1)
+
+# logo
+wave = Group(
+ Line(10, -5, 10, 10),
+ Line(20, -15, 20, 20),
+ Line(30, -5, 30, 10),
+ Line(40, -15, 40, 20),
+ Line(50, -5, 50, 10),
+ Line(60, -15, 60, 20),
+ Line(70, -5, 70, 10),
+ Line(80, -15, 80, 20),
+ Line(90, -5, 90, 10),
+ String(25, -25, "Wave Audio", fontName='Times')
+)
+wave.translate(10, 170)
+drawing.add(wave)
+
+# save
+drawing.save(formats=['pdf', 'png'], outDir=".", fnRoot="card") \ No newline at end of file
diff --git a/tests/reportlab/card.pdf b/tests/reportlab/card.pdf
new file mode 100644
index 00000000..4cb0b58a
--- /dev/null
+++ b/tests/reportlab/card.pdf
Binary files differ
diff --git a/tests/reportlab/card.png b/tests/reportlab/card.png
new file mode 100644
index 00000000..5c1cd4a5
--- /dev/null
+++ b/tests/reportlab/card.png
Binary files differ