generated from Andre601/mkdocs-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bd9c2fc
Showing
11 changed files
with
830 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Feel free to alter this file to your liking when using the template. | ||
# It allows to keep dependencies up to date using Dependabot. | ||
# | ||
# If you use Dependabot-Preview can you easly switch to Dependabot, by logging into the dashboard at | ||
# https://dependabot.com and click the "Create config file" button of your repository. | ||
# The bot should make a Pull request with the config file that you then can modify if you want. | ||
# | ||
# You can find more info about the file-format here: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
labels: | ||
- 'Type: Update (Dependency)' | ||
- 'Target: Python (pip)' | ||
- package-ecosystem: "github-actions" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
labels: | ||
- 'Type: Update (Dependency)' | ||
- 'Target: GitHub Actions' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# | ||
# This is a working example of using GitHub Actions to publish the docs | ||
# to the GitHub Pages (gh_pages) branch. | ||
# | ||
# Remember to have a requirements.txt file with the required dependencies. | ||
# This template ships with one by default. | ||
# | ||
# It is also recommendet to also copy the template with all branches, to | ||
# have the gh-pages branch pre-made. This prevents possible errors. | ||
# | ||
name: Deploy Site | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docs/**' | ||
- 'mkdocs.yml' | ||
- 'theme/**' | ||
branches: | ||
- master | ||
# | ||
# If your repository would have releases should you uncomment the below lines | ||
# in order to ignore pushes caused by newly created releases. | ||
# | ||
#tags-ignore: | ||
#- '**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
python -m pip install -r requirements.txt | ||
- name: Deploy Files | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "actions@github.com" | ||
mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Andre601 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
[use]: https://github.com/Andre601/mkdocs-template/generate | ||
|
||
[MkDocs]: https://www.mkdocs.org/ | ||
|
||
[squidfunk]: https://github.com/squidfunk | ||
[MkDocs Material Theme]: https://github.com/squidfunk/mkdocs-material | ||
|
||
[facelessuser]: https://github.com/facelessuser | ||
[PyMdown Extensions]: https://github.com/facelessuser/pymdown-extensions/ | ||
|
||
[Netlify]: https://netlify.com | ||
|
||
[mkdocs.yml]: https://github.com/Andre601/mkdocs-template/blob/master/mkdocs.yml | ||
[docs folder]: https://github.com/Andre601/mkdocs-template/blob/master/docs | ||
[workflow]: https://github.com/Andre601/mkdocs-template/blob/master/.github/workflows/deploy.yml | ||
|
||
[LICENSE]: https://github.com/Andre601/mkdocs-template/blob/master/LICENSE | ||
|
||
[gh-pages]: https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site | ||
|
||
# MkDocs Material Template | ||
This is a template repository for anyone that wants to use the MkDocs Material Theme. | ||
|
||
## Getting Started | ||
To get started, first clone this template by clicking on the Green button labeled [`Use this template`][use]. | ||
On the new screen, give your repository a name and make sure to check `Include all branches`. This will make sure that the `gh-pages` branch is included, or otherwhise publishing the docs to GitHub Pages could cause errors (See [Troubleshooting](#troubleshooting)). | ||
|
||
> **Note** | ||
> GitHub changed how you define from where it takes the pages to build. You are now able to define both a branch and a specific folder from where GitHub would take the files to then deploy them on GitHub Pages. | ||
> You can read more about this [here][gh-pages]. | ||
### Creating pages | ||
To create new pages, just add new markdown files to the [docs folder] of the repository and edit them. | ||
MkDocs will then turn those into static HTML pages once you [build](#build-pages) or [deploy](#deploy-to-github) the pages. | ||
|
||
The template also has some pre-made settings for your convenience to help you with creating documentation much easier. | ||
In the [mkdocs.yml] will you find many settings that you can alter. Please check the comments and the links they have for more info. | ||
|
||
It also contains some extensions that might be useful including: | ||
|
||
- Admonition | ||
- CodeHilite | ||
- ToC | ||
- [PyMdown Extensions] | ||
|
||
You're free to add, edit or remove any extension at your own discretion, but keep in mind that some expansions might cause compatibility issues with others or require to be downloaded first. | ||
For that, alter the `requirements.txt` if you also deploy pages using GitHub Actions or [Netlify](#netlify) | ||
|
||
## Build Pages | ||
To build pages (locally) can you use the `mkdocs build` command in your prefered command prompt. | ||
Note that for the successful execution of this command you have to... | ||
|
||
- ...be in the folder that contains the `mkdocs.yml` | ||
- ...have Python 3.7 installed | ||
- ...have MkDocs and all required dependencies such as Material for MkDocs installed. | ||
Note that Material for MkDocs automatically downloads MkDocs and also certain extensions such as the [PyMdown Extensions]. | ||
|
||
MkDocs would now build the HTML in the defined configuration folder for you to use. | ||
|
||
## Deploy to GitHub | ||
If you want to publish the pages on GitHub Pages can you use the [premade workflow][workflow] for this. | ||
This workflow will setup Python, download Material for MkDocs and all its dependencies and deploy the pages to the `gh-pages` branch to then be viewable under `<username>.github.io/<repository>` (unless you defined a specific CNAME through a CNAME file in the [docs folder]). | ||
|
||
Note that in order for this to work will you need to have a `gh-pages` branch already made. | ||
|
||
## Netlify | ||
Netlify is an amazing service to build and deploy pages. This template comes with a `runtime.txt` which is used by Netlify to determine the Python version used (They use an old version of Python... Don't ask why). | ||
|
||
For more information, please check out their website. | ||
|
||
## Dependabot | ||
The repository contains a `dependabot.yml` file inside the `.github` folder which allows automatic updates through GitHub's Dependabot. | ||
It is configured to target both Python dependencies (inside the `requirements.txt`) and GitHub Actions dependencies, to make sure bot are updated accordingly. | ||
|
||
Note that it is configured by default to add the `Type: Update (Dependency)` label and also the `Target: Python (pip)` label for Python and `Target: GitHub Actions` label for GitHub Actions Dependencies. | ||
Those labels don't exist by default so you have to either create them, or alter the ones in the dependabot.yml (You can also just remove the `labels` sections). | ||
|
||
## Troubleshooting | ||
> **The deploy action gives me an error when deploying. What is the issue?** | ||
There can be many issues but the most common ones are that you either don't have a `gh-pages` branch set or that the `requirements.txt` file is missing or its content is invalid. | ||
|
||
> **Can I alter the overall style of the pages?** | ||
Yes. Material for MkDocs supports Theme extensions, meaning you can override specific parts of a theme by providing the particular file in a folder and defining this folder as the `custom_dir` one in the [mkdocs.yml]. | ||
This template ships with a `theme` folder that can be used for that and you can just uncomment the aforementioned line in the YAML file. | ||
|
||
|
||
## Credits | ||
A big thank you goes to the following people/groups: | ||
|
||
- [MkDocs] for providing the software, to generate documentation. | ||
- [squidfunk] for the [MkDocs Material Theme]. | ||
- [facelessuser] for the [PyMdown Extensions]. | ||
|
||
## License | ||
This template is served under the MIT license. | ||
Read the [LICENSE] file for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.tabbed-set { | ||
display: flex; | ||
position: relative; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.tabbed-set .highlight { | ||
background: #ddd; | ||
} | ||
|
||
.tabbed-set .tabbed-content { | ||
display: none; | ||
order: 99; | ||
width: 100%; | ||
} | ||
|
||
.tabbed-set label { | ||
width: auto; | ||
margin: 0 0.5em; | ||
padding: 0.25em; | ||
font-size: 120%; | ||
cursor: pointer; | ||
color: #ffffff !important; | ||
} | ||
|
||
.tabbed-set input { | ||
position: absolute; | ||
opacity: 0; | ||
} | ||
|
||
.tabbed-set input:nth-child(n+1) { | ||
color: #333333; | ||
} | ||
|
||
.tabbed-set input:nth-child(n+1):checked + label { | ||
color: cyan !important; | ||
} | ||
|
||
.tabbed-set input:nth-child(n+1):checked + label + .tabbed-content { | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "extensions/tabbed.css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
[use]: https://github.com/Andre601/mkdocs-template/generate | ||
|
||
[MkDocs]: https://www.mkdocs.org/ | ||
|
||
[squidfunk]: https://github.com/squidfunk | ||
[MkDocs Material Theme]: https://github.com/squidfunk/mkdocs-material | ||
|
||
[facelessuser]: https://github.com/facelessuser | ||
[PyMdown Extensions]: https://github.com/facelessuser/pymdown-extensions/ | ||
|
||
[Netlify]: https://netlify.com | ||
|
||
[mkdocs.yml]: https://github.com/Andre601/mkdocs-template/blob/master/mkdocs.yml | ||
[docs folder]: https://github.com/Andre601/mkdocs-template/blob/master/docs | ||
[workflow]: https://github.com/Andre601/mkdocs-template/blob/master/.github/workflows/deploy.yml | ||
|
||
[LICENSE]: https://github.com/Andre601/mkdocs-template/blob/master/LICENSE | ||
|
||
# MkDocs Material Template | ||
This is a template repository for anyone that wants to use the MkDocs Material Theme. | ||
|
||
## Getting Started | ||
To get started, first clone this template by clicking on the Green button labeled [`Use this template`][use]. | ||
On the new screen, give your repository a name and make sure to check `Include all branches`. This will make sure that the `gh-pages` branch is included, or otherwhise publishing the docs to GitHub Pages could cause errors (See [Troubleshooting](#troubleshooting)). | ||
|
||
### Creating pages | ||
To create new pages, just add new markdown files to the [docs folder] of the repository and edit them. | ||
MkDocs will then turn those into static HTML pages once you [build](#build-pages) or [deploy](#deploy-to-github) the pages. | ||
|
||
The template also has some pre-made settings for you to help you with creating documentation much easier. | ||
In the [mkdocs.yml] will you find many settings that you can alter. Please check the comments and the links they have for more info. | ||
|
||
It also contains some extensions that might be useful including: | ||
|
||
- Admonition | ||
- CodeHilite | ||
- ToC | ||
- [PyMdown Extensions] | ||
|
||
You're free to add, edit or remove any extension at your own discretion, but keep in mind that some expansions might caus compatibility issues with others. | ||
|
||
## Build Pages | ||
To build pages (locally) can you use the `mkdocs build` command in your prefered command prompt. | ||
Note that for the successful execution of this command you have to... | ||
|
||
- ...be in the folder that contains the `mkdocs.yml` | ||
- ...have Python 3.7 installed | ||
- ...have MkDocs and all required dependencies such as Material for MkDocs installed. | ||
Note that Material for MkDocs automatically downloads MkDocs and also certain extensions such as the [PyMdown Extensions]. | ||
|
||
MkDocs would now build the HTML in the defined configuration folder for you to use. | ||
|
||
## Deploy to GitHub | ||
If you want to publish the pages on GitHub Pages can you use the [premade workflow][workflow] for this. | ||
This workflow will setup Python, download Material for MkDocs and all its dependencies and deploy the pages to the `gh-pages` branch to then be viewable under `<username>.github.io/<repository>` (unless you defined a specific CNAME through a CNAME file in the [docs folder]). | ||
|
||
Note that in order for this to work will you need to have a `gh-pages` branch already made. | ||
|
||
## Netlify | ||
Netlify is an amazing service to build and deploy pages. This template comes with a `runtime.txt` which is used by Netlify to determine the Python version used (They use an old version of Python... Don't ask why). | ||
|
||
For more information, please check out their website. | ||
|
||
## Troubleshooting | ||
> **The deploy action gives me an error when deploying. What is the issue?** | ||
There can be many issues but the most common ones are that you either don't have a `gh-pages` branch set or that the `requirements.txt` file is missing or its content is invalid. | ||
|
||
> **Can I alter the overall style of the pages?** | ||
Yes. Material for MkDocs supports Theme extensions, meaning you can override specific parts of a theme by providing the particula file in a folder and defining this folder as the `custom_dir` one in the [mkdocs.yml]. | ||
This template ships with a `theme` folder that can be used for that and you can just uncomment the aforementioned line in the YAML file. | ||
|
||
## Dependabot | ||
The repository contains a `dependabot.yml` file inside the `.github` folder which allows automatic updates through GitHub's Dependabot. | ||
It is configured to target both Python dependencies (inside the `requirements.txt`) and GitHub Actions dependencies, to make sure bot are updated accordingly. | ||
|
||
Note that it is configured by default to add the `Type: Update (Dependency)` label and also the `Target: Python (pip)` label for Python and `Target: GitHub Actions` label for GitHub Actions Dependencies. | ||
Those labels don't exist by default so you have to either create them, or alter the ones in the dependabot.yml (You can also just remove the `labels` sections). | ||
|
||
## Credits | ||
A big thank you goes to the following people/groups: | ||
|
||
- [MkDocs] for providing the software, to generate documentation. | ||
- [squidfunk] for the [MkDocs Material Theme]. | ||
- [facelessuser] for the [PyMdown Extensions]. | ||
|
||
## License | ||
This template is served under the MIT license. | ||
Read the [LICENSE] file for more info. |
Oops, something went wrong.