Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 2c455e2

Browse files
committed
Merge branch 'master' into docs/add-more-examples
2 parents 789ac17 + 6247988 commit 2c455e2

File tree

24 files changed

+293
-373
lines changed

24 files changed

+293
-373
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 Martin Donath <[email protected]>
1+
# Copyright (c) 2016-2023 Martin Donath <[email protected]>
22

33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the "Software"), to

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 Martin Donath <[email protected]>
1+
# Copyright (c) 2016-2023 Martin Donath <[email protected]>
22

33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the "Software"), to
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright (c) 2016-2023 Martin Donath <[email protected]>
2+
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to
5+
# deal in the Software without restriction, including without limitation the
6+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
# sell copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
# IN THE SOFTWARE.
20+
21+
name: documentation
22+
on:
23+
push:
24+
branches:
25+
- master
26+
27+
env:
28+
PYTHON_VERSION: 3.x
29+
30+
permissions:
31+
contents: write
32+
33+
jobs:
34+
documentation:
35+
name: Build documentation
36+
runs-on: ubuntu-latest
37+
steps:
38+
39+
- name: Checkout repository
40+
uses: actions/checkout@v3
41+
with:
42+
fetch-depth: 0
43+
44+
- name: Set up Python runtime
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: ${{ env.PYTHON_VERSION }}
48+
49+
- name: Set the date environmental variable
50+
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
51+
52+
- name: Set up build cache
53+
uses: actions/cache@v3
54+
id: cache
55+
with:
56+
key: mkdocs-material-${{ env.cache_id }}
57+
path: .cache
58+
restore-keys: |
59+
mkdocs-material-
60+
61+
- name: Install dependencies
62+
run: sudo apt-get install pngquant
63+
64+
- name: Install Python dependencies
65+
run: pip install -r requirements.txt
66+
67+
- name: Install Insiders
68+
if: github.event.repository.fork == false
69+
env:
70+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
71+
run: |
72+
pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
73+
74+
- name: Deploy documentation
75+
env:
76+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
77+
PYTHONPATH: .
78+
# GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
79+
run: |
80+
mkdocs gh-deploy --force
81+
mkdocs --version

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2016-2022 Martin Donath <[email protected]>
1+
# Copyright (c) 2016-2023 Martin Donath <[email protected]>
22

33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the "Software"), to
@@ -25,6 +25,13 @@
2525
# Dependencies
2626
/venv
2727

28+
# Build files
29+
build
30+
site
31+
32+
# Generated files
33+
*.zip
34+
2835
# Caches and logs
2936
*.log
3037
.cache

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Martin Donath <[email protected]>
1+
Copyright (c) 2016-2023 Martin Donath <[email protected]>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
- [Tags]
44
- [Tags with icons]
55

6-
[Tags]: packages/tags/
7-
[Tags with icons]: packages/tags-with-icons/
6+
[Tags]: example/tags/
7+
[Tags with icons]: examples/tags-with-icons/

docs/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Example
1+
# Examples
22

33
This project lists all options that are supported by Material for MkDocs and
44
can be used as a basis for new projects or reproductions. Note that some options
@@ -8,6 +8,3 @@ to be sure.
88
[sponsors]: https://squidfunk.github.io/mkdocs-material/insiders/
99
[available features]: https://squidfunk.github.io/mkdocs-material/insiders/#whats-in-for-me
1010

11-
``` yaml
12-
--8<-- "mkdocs.yml"
13-
```

examples/__init__.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) 2016-2023 Martin Donath <[email protected]>
2+
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to
5+
# deal in the Software without restriction, including without limitation the
6+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
# sell copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
# IN THE SOFTWARE.
20+
21+
import os
22+
import posixpath
23+
24+
from mergedeep import merge
25+
from mkdocs.config.defaults import MkDocsConfig
26+
27+
# -----------------------------------------------------------------------------
28+
# Functions
29+
# -----------------------------------------------------------------------------
30+
31+
# Transform project configuration
32+
def transform(project: MkDocsConfig, config: MkDocsConfig):
33+
root = os.path.dirname(project.config_file_path)
34+
name = os.path.basename(root)
35+
36+
# Inherit settings for repository
37+
project.repo_name = config.repo_name
38+
project.repo_url = config.repo_url
39+
40+
# Inherit settings for site URL and edit URI
41+
project.site_url = posixpath.join(config.site_url, name, "")
42+
project.edit_uri = f"edit/master/examples/{name}/docs/"
43+
44+
# Inherit settings for copyright
45+
project.copyright = config.copyright
46+
47+
# Inherit settings for theme
48+
merge(project.theme["icon"], config.theme["icon"])
49+
project.theme["features"].extend(config.theme["features"])
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
title: Overview
3-
---
4-
51
# Using tags with icons
62

73
This example includes the following pages:
@@ -10,12 +6,12 @@ This example includes the following pages:
106
- [Page 2] – Page with tags [JavaScript] and [CSS]
117
- [Tags] – Tags index
128

13-
[Page 1]: pages/page-1.md
14-
[Page 2]: pages/page-2.md
15-
[Tags]: pages/tags.md
16-
[HTML]: pages/tags.md#html
17-
[JavaScript]: pages/tags.md#javascript
18-
[CSS]: pages/tags.md#css
9+
[Page 1]: demo/page-1.md
10+
[Page 2]: demo/page-2.md
11+
[Tags]: demo/tags.md
12+
[HTML]: demo/tags.md#html
13+
[JavaScript]: demo/tags.md#javascript
14+
[CSS]: demo/tags.md#css
1915

2016
Download example as archive:
2117

@@ -28,4 +24,4 @@ pip install -r requirements.txt
2824
mkdocs serve
2925
```
3026

31-
[Download]: https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/mkdocs-material/examples/tree/master/examples/tags
27+
[Download]: ../../download/tags-with-icons.zip
File renamed without changes.

0 commit comments

Comments
 (0)