Skip to content

Commit

Permalink
Add mkdocs.yml to run mkdocs locally (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Jun 2, 2023
1 parent bb80292 commit 12304fe
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 0 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ repos:
rev: v4.3.0
hooks:
- id: check-yaml
args: ['--unsafe']
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
Expand Down
39 changes: 39 additions & 0 deletions docs/extra/terminal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.terminal {
background: #300a24;
border-radius: 4px;
padding: 5px 10px;
}

pre.terminal-content {
display: inline-block;
line-height: 1.3 !important;
white-space: pre-wrap;
word-wrap: break-word;
background: #300a24 !important;
color: #d0d0d0 !important;
}

.ansi2 {
font-weight: lighter;
}
.ansi3 {
font-style: italic;
}
.ansi32 {
color: #00aa00;
}
.ansi34 {
color: #5656fe;
}
.ansi35 {
color: #E850A8;
}
.ansi38-1 {
color: #cf0000;
}
.ansi38-5 {
color: #E850A8;
}
.ansi38-68 {
color: #2a54a8;
}
77 changes: 77 additions & 0 deletions docs/extra/tweaks.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.sponsors {
display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: center;
margin: 1rem 0;
}

.sponsors > div {
text-align: center;
width: 33%;
padding-bottom: 20px;
}

.sponsors span {
display: block;
}

@media screen and (max-width: 599px) {
.sponsors span {
display: none;
}
}

.sponsors img {
width: 65%;
border-radius: 5px;
}

/*blog post*/
aside.blog {
display: flex;
align-items: center;
}

aside.blog img {
width: 50px;
height: 50px;
border-radius: 25px;
margin-right: 20px;
}

/* Define the company grid layout */

#grid-container {
width: 100%;
text-align: center;
}

#company-grid {
display: inline-block;
margin: 0 auto;
gap: 10px;
align-content: center;
justify-content: center;
grid-auto-flow: column;
}

[data-md-color-scheme="slate"] #company-grid {
background-color: #ffffff;
border-radius: .5rem;
}

.tile {
display: flex;
text-align: center;
width: 120px;
height: 120px;
display: inline-block;
margin: 10px;
padding: 5px;
border-radius: .5rem;
}

.tile img {
width: 100px;
}
Binary file added docs/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/theme/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "base.html" %}
<!-- start announce block -->
{% block announce %}
{% include 'announce.html' ignore missing %}
{% endblock %}
<!-- end announce block -->
{% block content %}
{{ super() }}
<script src="/flarelytics/client.js"></script>
{% endblock %}
74 changes: 74 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
site_name: pydantic
site_description: Data validation using Python type hints
strict: true
site_url: https://docs.pydantic.dev/

theme:
name: 'material'
custom_dir: 'docs/theme'
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: pink
accent: pink
toggle:
icon: material/lightbulb-outline
name: "Switch to dark mode"
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: pink
accent: pink
toggle:
icon: material/lightbulb
name: "Switch to light mode"
features:
- content.tabs.link
- announce.dismiss
- navigation.tabs
logo: 'logo-white.svg'
favicon: 'favicon.png'

repo_name: pydantic/pydantic
repo_url: https://github.com/pydantic/pydantic
edit_uri: edit/main/docs/

extra_css:
- 'extra/terminal.css'
- 'extra/tweaks.css'

nav:
- index.md

markdown_extensions:
- tables
- toc:
permalink: true
title: Page contents
- admonition
- pymdownx.highlight
- pymdownx.extra
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.tabbed:
alternate_style: true

extra:
version:
provider: mike

plugins:
- mike:
alias_type: symlink
canonical_version: latest
- search
- exclude:
glob:
- plugins/*
- __pycache__/*
- mkdocs-simple-hooks:
hooks:
on_pre_build: 'docs.plugins.main:on_pre_build'
on_files: 'docs.plugins.main:on_files'
on_page_markdown: 'docs.plugins.main:on_page_markdown'
- external-markdown:

0 comments on commit 12304fe

Please sign in to comment.