Skip to content

Commit 12304fe

Browse files
authored
Add mkdocs.yml to run mkdocs locally (#67)
1 parent bb80292 commit 12304fe

File tree

7 files changed

+204
-0
lines changed

7 files changed

+204
-0
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ repos:
33
rev: v4.3.0
44
hooks:
55
- id: check-yaml
6+
args: ['--unsafe']
67
- id: check-toml
78
- id: end-of-file-fixer
89
- id: trailing-whitespace

docs/extra/terminal.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.terminal {
2+
background: #300a24;
3+
border-radius: 4px;
4+
padding: 5px 10px;
5+
}
6+
7+
pre.terminal-content {
8+
display: inline-block;
9+
line-height: 1.3 !important;
10+
white-space: pre-wrap;
11+
word-wrap: break-word;
12+
background: #300a24 !important;
13+
color: #d0d0d0 !important;
14+
}
15+
16+
.ansi2 {
17+
font-weight: lighter;
18+
}
19+
.ansi3 {
20+
font-style: italic;
21+
}
22+
.ansi32 {
23+
color: #00aa00;
24+
}
25+
.ansi34 {
26+
color: #5656fe;
27+
}
28+
.ansi35 {
29+
color: #E850A8;
30+
}
31+
.ansi38-1 {
32+
color: #cf0000;
33+
}
34+
.ansi38-5 {
35+
color: #E850A8;
36+
}
37+
.ansi38-68 {
38+
color: #2a54a8;
39+
}

docs/extra/tweaks.css

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.sponsors {
2+
display: flex;
3+
justify-content: center;
4+
flex-wrap: wrap;
5+
align-items: center;
6+
margin: 1rem 0;
7+
}
8+
9+
.sponsors > div {
10+
text-align: center;
11+
width: 33%;
12+
padding-bottom: 20px;
13+
}
14+
15+
.sponsors span {
16+
display: block;
17+
}
18+
19+
@media screen and (max-width: 599px) {
20+
.sponsors span {
21+
display: none;
22+
}
23+
}
24+
25+
.sponsors img {
26+
width: 65%;
27+
border-radius: 5px;
28+
}
29+
30+
/*blog post*/
31+
aside.blog {
32+
display: flex;
33+
align-items: center;
34+
}
35+
36+
aside.blog img {
37+
width: 50px;
38+
height: 50px;
39+
border-radius: 25px;
40+
margin-right: 20px;
41+
}
42+
43+
/* Define the company grid layout */
44+
45+
#grid-container {
46+
width: 100%;
47+
text-align: center;
48+
}
49+
50+
#company-grid {
51+
display: inline-block;
52+
margin: 0 auto;
53+
gap: 10px;
54+
align-content: center;
55+
justify-content: center;
56+
grid-auto-flow: column;
57+
}
58+
59+
[data-md-color-scheme="slate"] #company-grid {
60+
background-color: #ffffff;
61+
border-radius: .5rem;
62+
}
63+
64+
.tile {
65+
display: flex;
66+
text-align: center;
67+
width: 120px;
68+
height: 120px;
69+
display: inline-block;
70+
margin: 10px;
71+
padding: 5px;
72+
border-radius: .5rem;
73+
}
74+
75+
.tile img {
76+
width: 100px;
77+
}

docs/favicon.png

891 Bytes
Loading

docs/logo-white.svg

Lines changed: 3 additions & 0 deletions
Loading

docs/theme/main.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% extends "base.html" %}
2+
<!-- start announce block -->
3+
{% block announce %}
4+
{% include 'announce.html' ignore missing %}
5+
{% endblock %}
6+
<!-- end announce block -->
7+
{% block content %}
8+
{{ super() }}
9+
<script src="/flarelytics/client.js"></script>
10+
{% endblock %}

mkdocs.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
site_name: pydantic
2+
site_description: Data validation using Python type hints
3+
strict: true
4+
site_url: https://docs.pydantic.dev/
5+
6+
theme:
7+
name: 'material'
8+
custom_dir: 'docs/theme'
9+
palette:
10+
- media: "(prefers-color-scheme: light)"
11+
scheme: default
12+
primary: pink
13+
accent: pink
14+
toggle:
15+
icon: material/lightbulb-outline
16+
name: "Switch to dark mode"
17+
- media: "(prefers-color-scheme: dark)"
18+
scheme: slate
19+
primary: pink
20+
accent: pink
21+
toggle:
22+
icon: material/lightbulb
23+
name: "Switch to light mode"
24+
features:
25+
- content.tabs.link
26+
- announce.dismiss
27+
- navigation.tabs
28+
logo: 'logo-white.svg'
29+
favicon: 'favicon.png'
30+
31+
repo_name: pydantic/pydantic
32+
repo_url: https://github.com/pydantic/pydantic
33+
edit_uri: edit/main/docs/
34+
35+
extra_css:
36+
- 'extra/terminal.css'
37+
- 'extra/tweaks.css'
38+
39+
nav:
40+
- index.md
41+
42+
markdown_extensions:
43+
- tables
44+
- toc:
45+
permalink: true
46+
title: Page contents
47+
- admonition
48+
- pymdownx.highlight
49+
- pymdownx.extra
50+
- pymdownx.emoji:
51+
emoji_index: !!python/name:materialx.emoji.twemoji
52+
emoji_generator: !!python/name:materialx.emoji.to_svg
53+
- pymdownx.tabbed:
54+
alternate_style: true
55+
56+
extra:
57+
version:
58+
provider: mike
59+
60+
plugins:
61+
- mike:
62+
alias_type: symlink
63+
canonical_version: latest
64+
- search
65+
- exclude:
66+
glob:
67+
- plugins/*
68+
- __pycache__/*
69+
- mkdocs-simple-hooks:
70+
hooks:
71+
on_pre_build: 'docs.plugins.main:on_pre_build'
72+
on_files: 'docs.plugins.main:on_files'
73+
on_page_markdown: 'docs.plugins.main:on_page_markdown'
74+
- external-markdown:

0 commit comments

Comments
 (0)