Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit 1ea733e

Browse files
split config
add more on contributing page simplify .env file
1 parent 2397de9 commit 1ea733e

9 files changed

+127
-55
lines changed

Diff for: .env

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
DOCTOOLS_IMAGE_VERSION=latest
22
PROJECT=doctools
33
LANGUAGE=en
4-
LATEST_VERSION=latest
5-
STABLE_VERSION=stable
64
SOURCE_DIR=site
5+
6+
#VERSION_SWITCH=true
7+
78
AWS_S3_BUCKET=docshosting
89
AWS_REGION=us-east-2
9-
GTM_ID=GTM-PBFNGBR
10-
SITE_NAME=Doctools
11-
SITE_DESCRIPTION="Doctools documentation template"
12-
REPOS_NAME=Consensys/doctools.template-site
13-
REPOS_URL=https://github.com/Consensys/doctools.template-site
14-
SOCIAL_DISCORD=https://discord.gg/5U9Jwp7
15-
SOCIAL_EMAIL=mailto:[email protected]
16-
SOCIAL_WEB=https://consensys.net/docs/
17-
#VERSION_SWITCH=true

Diff for: docs/howto/advanced/contributing.md

+17-9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ To get the best from the system, consider having the following settings[^1]:
2020
- 6GB RAM
2121
- 1GB swap
2222

23+
!!! warning
24+
If you are using a macOS machine, do not activate the experimental Docker Desktop "Use the new Virtualization framework". It will slow down builds by at least 3 times. A normal build time is around 5 seconds for this website for instance.
25+
2326
[^1]:
2427
These settings were tested on a MacBook Pro (15-inch, 2018) - 2,6 GHz 6-Core Intel Core i7 - 16 GB 2400 MHz DDR4.
2528

@@ -88,12 +91,15 @@ Create a new file in your `doctools.template-site` directory with the following
8891
version: '3.2'
8992
services:
9093
mkdocs:
91-
container_name: mkdocs-serve-dev-${PROJECT:-project}-${LANGUAGE:-en}
94+
container_name: mkdocs-serve-dev-${PROJECT:-project}
9295
ports:
9396
- "0.0.0.0:8000:8000"
94-
image: ghcr.io/consensys/doctools-builder:${DOCTOOLS_IMAGE_VERSION:-latest}
97+
image: ghcr.io/consensys/doctools-builder:${DOCTOOLS_IMAGE_VERSION:-dev}
98+
build:
99+
context: ../doctools.action-builder/
95100
working_dir: /workspace/
96101
env_file: .env.dev
102+
command: ["serve", "--watch-theme" ,"--dev-addr", "0.0.0.0:8000"]
97103
volumes:
98104
- type: bind
99105
source: .
@@ -115,34 +121,36 @@ Copy your `.env` file to a `.env.dev` file
115121
To preview the doc site locally, go to your doc site code source directory and run:
116122
117123
```bash
118-
docker compose -f docker-compose.dev.yml up-d
124+
docker compose -f docker-compose.dev.yml --env-file ./.env.dev up
119125
```
120126
121127
Then open [`http://0.0.0.0:8000`](http://0.0.0.0:8000){: target="_blank} in your browser and navigate the preview.
122128
123129
### Stropping the preview
124130
125-
To stop and remove containers, run
131+
To stop the service, type ++ctrl+c++ and then remove containers by running
132+
126133
```bash
127-
docker compose -f docker-compose.dev.yml down
134+
docker compose down mkdocs
128135
```
129136
130137
### Reloading on changes
131138
132-
If you keep the Docker compose service running in background,
139+
If you keep the Docker compose service running,
133140
the website preview will reload and display changes automatically for:
134141
135142
- content (all `.md` files, modification, deletions or new pages if added to navigation)
136-
- configuration (changes on entries in `mkdocs.yml`)
143+
- configuration (changes on entries in `mkdocs.yml` and all `mkdocs.*.yml`)
144+
- theme templates (in the ``../doctools.action-builder/common/custom_theme` directory)
137145
138146
!!!important
139-
If you make changes on the `.env.dev` or any HTML template file or assets outside of your repos `docs` folder,
147+
If you make changes on the `.env.dev` or assets outside of your repos `docs` folder,
140148
the system is not yet able to reload automatically and you will have to restart the docker-compose service.
141149
142150
Run:
143151
144152
```bash
145-
docker compose -f docker-compose.dev.yml restart
153+
docker compose restart mkdocs
146154
```
147155
148156
[Doctools action builder]: https://github.com/ConsenSys/doctools.action-builder

Diff for: docs/howto/advanced/extra-configuration.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Extra configuration
3+
description: How to configure Doctools site extra values with YAML and .env files.
4+
---
5+
6+
# Extra configuration

Diff for: mkdocs.exclude.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
# This configuration must inherit the base configuration file available in the Doctools docker image.
1414
# See source at https://github.com/ConsenSys/doctools.action-builder/blob/main/common/custom_theme/base.yml
15-
# Do not modify this INHERIT line.
16-
INHERIT: /common/custom_theme/base.yml
15+
INHERIT: /common/custom_theme/base.yml # DO NOT MODIFY THIS LINE
1716

1817
plugins:
1918
exclude:

Diff for: mkdocs.extra.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,25 @@
1212

1313
# This configuration must inherit the base configuration file available in the Doctools docker image.
1414
# See source at https://github.com/ConsenSys/doctools.action-builder/blob/main/common/custom_theme/base.yml
15-
# Do not modify this INHERIT line.
16-
INHERIT: mkdocs.exclude.yml
15+
INHERIT: mkdocs.exclude.yml # DO NOT MODIFY THIS LINE
1716

17+
# Extra data configures some specific aspect of the theme.
18+
# You can find a full description of the values in the Doctool doc site:
19+
# https://consensys.net/docs/doctools/en/latest/howto/advanced/extra-configuration
1820
extra:
19-
support: /support/
20-
inverted_logo: 'assets/logo_inverted.svg'
21+
support: /support/ # The path to the default support page, for instance displayed in 404 pages
22+
inverted_logo: 'assets/logo_inverted.svg' # Path for a colour inverted logo, for instance displayed in 404 pages
2123
# Announce can contain HTML but limit it to small images or links. NO BIG DIRTY HACKS PLEASE.
2224
# If announce is removed or commented, the banner will be hidden
2325
announce: 'Improved version of the Consensys doc system, read about the new features!'
24-
# If languages are removed, commented or only contain one language, the language switch will be hidden
25-
# languages:
26-
# en: English (en)
27-
# zh: 中文 (zh)
26+
logo_is_text: false # indicates if logo is using text or is only a shape and if we have to add the project name as text.
27+
analytics: # information for Analytics. Default is Google Tag manager.
28+
gtmid: GTM-PBFNGBR
29+
social: # list of social media links and icons to display ion the pages footer.
30+
# See https://squidfunk.github.io/mkdocs-material/setup/setting-up-the-footer/?h=social#configuration
31+
- icon: fontawesome/brands/discord
32+
link: https://discord.gg/5U9Jwp7
33+
- icon: fontawesome/solid/envelope
34+
link: mailto:[email protected]
35+
- icon: material/web
36+
link: https://consensys.net/quorum/developers

Diff for: mkdocs.navigation.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# Copyright 2021 ConsenSys Software Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
# the License. You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
# specific language governing permissions and limitations under the License.
12+
13+
# This configuration must inherit the base configuration file available in the Doctools docker image.
14+
# See source at https://github.com/ConsenSys/doctools.action-builder/blob/main/common/custom_theme/base.yml
15+
INHERIT: mkdocs.extra.yml # DO NOT MODIFY THIS LINE
16+
17+
nav:
18+
- Overview: index.md
19+
- New features: changelog.md
20+
- Getting started: getting_started.md
21+
- How To:
22+
- howto/index.md
23+
- Create a new doc site: howto/setup_new_doc_repos.md
24+
- Configure MkDocs: howto/configure_mkdocs.md
25+
- Preview the doc site:
26+
- howto/preview_the_doc_site/index.md
27+
- Doc preview demo: howto/preview_the_doc_site/demo.md
28+
- Publish the doc site: howto/publish_the_doc_site.md
29+
- Advanced use:
30+
- Contribute to Doctools: howto/advanced/contributing.md
31+
- Extra configuration: howto/advanced/extra-configuration.md
32+
- Examples:
33+
- examples/index.md
34+
- CLI reference: examples/write_cli_reference.md
35+
- API reference: examples/write_rest_api_reference.md
36+
- Support page: examples/support.md
37+
- Reference:
38+
- MarkDown syntax: reference/markdown.md

Diff for: mkdocs.redirects.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212

1313
# This configuration must inherit the base configuration file available in the Doctools docker image.
1414
# See source at https://github.com/ConsenSys/doctools.action-builder/blob/main/common/custom_theme/base.yml
15-
# Do not modify this INHERIT line.
16-
INHERIT: mkdocs.extra.yml
15+
INHERIT: mkdocs.navigation.yml # DO NOT MODIFY THIS LINE
1716

17+
# Configure redirects.
18+
# All page removed or with changed path (moved in another directory) has to be redirected here.
1819
plugins:
1920
redirects:
2021
redirect_maps:

Diff for: mkdocs.theme.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# Copyright 2021 ConsenSys Software Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
# the License. You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
# specific language governing permissions and limitations under the License.
12+
13+
# This configuration must inherit the base configuration file available in the Doctools docker image.
14+
# See source at https://github.com/ConsenSys/doctools.action-builder/blob/main/common/custom_theme/base.yml
15+
INHERIT: mkdocs.redirects.yml # DO NOT MODIFY THIS LINE
16+
17+
theme:
18+
palette:
19+
- media: "(prefers-color-scheme: light)"
20+
scheme: consensys
21+
toggle:
22+
icon: material/toggle-switch-off-outline
23+
name: Switch to dark mode
24+
- media: "(prefers-color-scheme: dark)"
25+
scheme: consensys-dark
26+
toggle:
27+
icon: material/toggle-switch
28+
name: Switch to light mode
29+
logo: 'assets/logo.svg'
30+
favicon: 'assets/favicon.svg'

Diff for: mkdocs.yml

+12-23
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,16 @@
1212

1313
# This configuration must inherit the base configuration file available in the Doctools docker image.
1414
# See source at https://github.com/ConsenSys/doctools.action-builder/blob/main/common/custom_theme/base.yml
15-
# Do not modify this INHERIT line.
16-
INHERIT: mkdocs.redirects.yml
15+
INHERIT: mkdocs.theme.yml # DO NOT MODIFY THIS LINE
1716

18-
nav:
19-
- Overview: index.md
20-
- New features: changelog.md
21-
- Getting started: getting_started.md
22-
- How To:
23-
- howto/index.md
24-
- Create a new doc site: howto/setup_new_doc_repos.md
25-
- Configure MkDocs: howto/configure_mkdocs.md
26-
- Preview the doc site:
27-
- howto/preview_the_doc_site/index.md
28-
- Doc preview demo: howto/preview_the_doc_site/demo.md
29-
- Publish the doc site: howto/publish_the_doc_site.md
30-
- Advanced use:
31-
- Contribute to Doctools: howto/advanced/contributing.md
32-
- Examples:
33-
- examples/index.md
34-
- CLI reference: examples/write_cli_reference.md
35-
- API reference: examples/write_rest_api_reference.md
36-
- Support page: examples/support.md
37-
- Reference:
38-
- MarkDown syntax: reference/markdown.md
17+
# Project information
18+
site_name: Doctools
19+
site_description: Doctools documentation template
20+
21+
# Software Repository
22+
repo_name: Consensys/doctools.template-site
23+
repo_url: https://github.com/Consensys/doctools.template-site
24+
25+
# Project information
26+
site_author: ConsenSys
27+
copyright: This documentation is hosted by <a href="https://consensys.net/">ConsenSys</a> and licensed under Apache 2.0 license

0 commit comments

Comments
 (0)