Skip to content

Commit

Permalink
Add mike as dependency (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsil authored Mar 12, 2024
1 parent 113b839 commit aad6208
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ clean_pycache: ## Removes the __pycaches__

.PHONY: serve-docs
serve-docs: ## Runs the local docs
mkdocs serve
mike serve

.PHONY: build-docs
build-docs: ## Runs the local docs
Expand Down
8 changes: 8 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "base.html" %}

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
site_name: Esmerald
site_description: 🚀 Highly scalable, performant, easy to learn, easy to code and for every application. 🚀
site_url: https://esmerald.dev
site_url: https://esmerald.dev/esmerald/

theme:
name: "material"
Expand Down Expand Up @@ -231,6 +231,8 @@ markdown_extensions:
- md_in_html

extra:
version:
provider: mike
analytics:
provider: google
property: G-CNBVBB90NT
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ dev = [

doc = [
"griffe-typingdoc>=0.2.2",
"mike>=2.0.0",
"mkautodoc>=0.2.0,<0.3.0",
"mkdocs>=1.1.2,<2.0.0",
"mkdocs-material>=9.4.4,<10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/docs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ fi

set -x

${PREFIX}mkdocs serve
${PREFIX}mike serve
16 changes: 16 additions & 0 deletions scripts/versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh -e

VERSION_FILE="esmerald/__init__.py"
VERSION=`grep __version__ ${VERSION_FILE} | grep -o '[0-9][^"]*'`

echo $VERSION

echo "Installing dependencies"
pip install -U pip && pip install mkdocs mkautodoc mkdocs-material griffe-typingdoc mdx-include pyyaml mkdocs-markdownextradata-plugin mkdocstrings[python] httpx starlette lilya mike a2wsgi mkdocs-meta-descriptions-plugin

echo "Running version generator for version $VERSION"
mike deploy --push --update-aliases $VERSION latest


echo "Setting default latest to version $VERSION"
mike set-default --push latest

0 comments on commit aad6208

Please sign in to comment.