Add AI documentation skills
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,176 @@
|
||||
---
|
||||
title: Getting started with Insiders
|
||||
---
|
||||
|
||||
# Getting started with Insiders
|
||||
|
||||
Material for MkDocs Insiders is a compatible drop-in replacement for Material
|
||||
for MkDocs, and can be installed similarly using [`pip`][pip],
|
||||
[`docker`][docker] or [`git`][git].
|
||||
|
||||
[pip]: #with-pip
|
||||
[docker]: #with-docker
|
||||
[git]: #with-git
|
||||
|
||||
## Requirements
|
||||
|
||||
After you've been added to the list of collaborators and accepted the
|
||||
repository invitation, the next step is to create a [personal access token] for
|
||||
your GitHub account in order to access the Insiders repository programmatically
|
||||
(from the command line or GitHub Actions workflows):
|
||||
|
||||
1. Go to https://github.com/settings/tokens
|
||||
2. Click on [Generate a new token]
|
||||
3. Enter a name and select the [`repo`][scopes] scope
|
||||
4. Generate the token and store it in a safe place
|
||||
|
||||
[personal access token]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
|
||||
[Generate a new token]: https://github.com/settings/tokens/new
|
||||
[scopes]: https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes
|
||||
|
||||
Some of the instructions below require that the `GH_TOKEN` environment
|
||||
variable is set to the value of the personal access token you
|
||||
generated in the previous step. Note that the personal access token
|
||||
must be kept secret at all times, as it allows the owner to access
|
||||
your private repositories.
|
||||
|
||||
## Installation
|
||||
|
||||
### with pip
|
||||
|
||||
Material for MkDocs Insiders can be installed with `pip`. You will
|
||||
normally want to install the latest release but can also install a
|
||||
specific older release or even the latest development version.
|
||||
Make sure you have the `GH_TOKEN` variable set as instructed above.
|
||||
|
||||
=== "Specific release"
|
||||
|
||||
Pick the corresponding tag from the [list of tags] for the Insiders
|
||||
repository. In the `pip` command below, replace the tag at the
|
||||
end of the URL with the one you want.
|
||||
|
||||
``` sh
|
||||
pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git@9.4.2-insiders-4.42.0
|
||||
```
|
||||
|
||||
=== "Latest"
|
||||
|
||||
``` sh
|
||||
pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
|
||||
```
|
||||
|
||||
[list of tags]: https://github.com/squidfunk/mkdocs-material-insiders/tags
|
||||
|
||||
### with docker
|
||||
|
||||
In case you want to use Material for MkDocs Insiders from within Docker, some
|
||||
additional steps are necessary. While we cannot provide a hosted Docker image
|
||||
for Insiders[^2], [GitHub Container Registry] allows for simple and
|
||||
comfortable self-hosting:
|
||||
|
||||
1. [Fork the Insiders repository]
|
||||
2. Enable [GitHub Actions] on your fork[^3]
|
||||
3. Create a new personal access token[^4]
|
||||
1. Go to https://github.com/settings/tokens
|
||||
2. Click on [Generate a new token]
|
||||
3. Enter a name and select the [`write:packages`][scopes] scope
|
||||
4. Generate the token and store it in a safe place
|
||||
4. Add a [GitHub Actions secret] on your fork
|
||||
1. Set the name to `GHCR_TOKEN`
|
||||
2. Set the value to the personal access token created in the previous step
|
||||
5. [Create a new release] to build and publish the Docker image
|
||||
6. Install [Pull App] on your fork to stay in-sync with upstream
|
||||
|
||||
The [`build`][build] workflow is automatically run when a new tag
|
||||
(release) is created. When a new Insiders version is released on the upstream
|
||||
repository, the [Pull App] will create a pull request with the changes and
|
||||
pull in the new tag, which is picked up by the [`build`][build] workflow
|
||||
that builds and publishes the Docker image automatically to your private
|
||||
registry.
|
||||
|
||||
Now, you should be able to pull the Docker image from your private registry:
|
||||
|
||||
```
|
||||
docker login -u ${GH_USERNAME} -p ${GHCR_TOKEN} ghcr.io
|
||||
docker pull ghcr.io/${GH_USERNAME}/mkdocs-material-insiders
|
||||
```
|
||||
|
||||
Should you wish to add additional plugins to the insiders container image, follow the steps
|
||||
outlined in the [Getting Started guide](../getting-started.md#with-docker).
|
||||
|
||||
[^2]:
|
||||
Earlier, Insiders provided a dedicated Docker image which was available to
|
||||
all sponsors. On March 21, 2021, the image was deprecated for the reasons
|
||||
outlined and discussed in #2442. It was removed on June 1, 2021.
|
||||
|
||||
[^3]:
|
||||
When forking a repository, GitHub will disable all workflows. While this
|
||||
is a reasonable default setting, you need to enable GitHub Actions to be
|
||||
able to automatically build and publish a Docker image on
|
||||
[GitHub Container Registry].
|
||||
|
||||
[^4]:
|
||||
While you could just add the `write:packages` scope to the personal access
|
||||
token created to access the Insiders repository, it's safer to create a
|
||||
dedicated token which you'll only use for publishing the Docker image.
|
||||
|
||||
### with git
|
||||
|
||||
Of course, you can use Material for MkDocs Insiders directly from `git`:
|
||||
|
||||
```
|
||||
git clone git@github.com:squidfunk/mkdocs-material-insiders.git mkdocs-material
|
||||
```
|
||||
|
||||
The theme will reside in the folder `mkdocs-material/material`. When cloning
|
||||
from `git`, the theme must be installed, so MkDocs can find the built-in
|
||||
plugins:
|
||||
|
||||
```
|
||||
pip install -e mkdocs-material
|
||||
```
|
||||
|
||||
[GitHub Container Registry]: https://docs.github.com/en/packages/guides/about-github-container-registry
|
||||
[Fork the Insiders repository]: https://github.com/squidfunk/mkdocs-material-insiders/fork
|
||||
[GitHub Actions]: https://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository
|
||||
[packages scope]: https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes
|
||||
[GitHub Actions secret]: https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository
|
||||
[Create a new release]: https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository#creating-a-release
|
||||
[Pull App]: https://github.com/apps/pull
|
||||
[build]: https://github.com/squidfunk/mkdocs-material-insiders/blob/master/.github/workflows/build.yml
|
||||
|
||||
## Built-in plugins
|
||||
|
||||
When you're using built-in plugins that are solely available via Insiders,
|
||||
outside contributors won't be able to build your documentation project on their
|
||||
local machine. This is the reason why we developed the [built-in group plugin]
|
||||
that allows to conditionally load plugins:
|
||||
|
||||
``` yaml
|
||||
plugins:
|
||||
- search
|
||||
- social
|
||||
|
||||
# CI=true mkdocs build
|
||||
- group:
|
||||
enabled: !ENV CI
|
||||
plugins:
|
||||
- git-revision-date-localized
|
||||
- git-committers
|
||||
|
||||
# INSIDERS=true mkdocs build
|
||||
- group:
|
||||
enabled: !ENV INSIDERS
|
||||
plugins:
|
||||
- optimize
|
||||
- privacy
|
||||
```
|
||||
|
||||
Of course, you can also enable both groups with:
|
||||
|
||||
``` shell
|
||||
CI=true INSIDERS=true mkdocs build
|
||||
```
|
||||
|
||||
[built-in group plugin]: ../plugins/group.md
|
||||
[configuration inheritance]: https://www.mkdocs.org/user-guide/configuration/#configuration-inheritance
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
template: redirect.html
|
||||
location: getting-started/
|
||||
---
|
||||
@@ -0,0 +1,79 @@
|
||||
# How to upgrade
|
||||
|
||||
When upgrading Insiders, you should always check the version of Material for
|
||||
MkDocs which makes up the first part of the version qualifier, e.g., Insiders
|
||||
`4.x.x` is currently based on `9.x.x`:
|
||||
|
||||
```
|
||||
9.x.x-insiders-4.x.x
|
||||
```
|
||||
|
||||
If the major version increased, it's a good idea to consult the [upgrade
|
||||
guide] and go through the steps to ensure your configuration is up to date and
|
||||
all necessary changes have been made.
|
||||
|
||||
[upgrade guide]: ../upgrade.md
|
||||
[list of tags]: https://github.com/squidfunk/mkdocs-material-insiders/tags
|
||||
|
||||
Depending on how you installed and what you want to upgrade to you
|
||||
need to run different commands:
|
||||
|
||||
=== "pip upgrade to release"
|
||||
|
||||
If you installed Insiders via `pip` and you want to upgrade to a
|
||||
specific release, pick the tag from the [list of tags] and replace
|
||||
the tag at the end of the URL of the command given below:
|
||||
|
||||
```
|
||||
pip install --upgrade git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git@9.4.2-insiders-4.42.0
|
||||
```
|
||||
|
||||
=== "pip upgrade to latest development"
|
||||
|
||||
If you installed Insiders via `pip` and want to upgrade to the
|
||||
latest development version, run:
|
||||
|
||||
```
|
||||
pip install --upgrade --force-reinstall git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
|
||||
```
|
||||
|
||||
The `--force-reinstall` option serves to make sure `pip` does, in fact,
|
||||
install the latest development version, instead of deciding that nothing
|
||||
is to be done based on the version numbers.
|
||||
```
|
||||
|
||||
=== "git upgrade"
|
||||
|
||||
If you installed Insiders via `git`, you will first need to check
|
||||
out the version you want to install into your workspace. After
|
||||
this is done, you can run `pip` to install that version.
|
||||
|
||||
First, make sure that your local clone is up-to-date with the
|
||||
upstream repository by running `git pull`.
|
||||
|
||||
You can look up the tags using `git tag --sort -refname` or you
|
||||
can consult the [list of tags]. Then, checkout the tag you want to
|
||||
use by replacing the one given in the command below (twice)and running
|
||||
it from your workspace[^detached]:
|
||||
|
||||
[^detached]:
|
||||
The `--detach` argument serves to tell `git` that you are ok to
|
||||
have your workspace in the [detached head] state, which is
|
||||
perfectly fine to have here.
|
||||
|
||||
[detached head]: https://www.git-tower.com/learn/git/faq/detached-head-when-checkout-commit/
|
||||
|
||||
```
|
||||
cd mkdocs-material
|
||||
git checkout --detach tags/9.4.2-insiders-4.42.0
|
||||
```
|
||||
|
||||
Now, change back to the parent directory in which your Git
|
||||
repository lives and run `pip`:
|
||||
|
||||
```
|
||||
cd ..
|
||||
pip install -e mkdocs-material
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user