Skip to content

Commit f28683c

Browse files
authored
Revert "Revert "Utilise Pipenv for reproducible builds""
1 parent 7fd8dd6 commit f28683c

File tree

4 files changed

+171
-10
lines changed

4 files changed

+171
-10
lines changed

Pipfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[[source]]
2+
url = "https://pypi.python.org/simple"
3+
verify_ssl = true
4+
name = "Tabletop Simulator API"
5+
6+
[packages]
7+
mkdocs-material = "~= 3.0.4"
8+
mkdocs = "~=1.0.4"
9+
pygments = "~=2.2.0"
10+
pymdown-extensions = "~=5.0"
11+
12+
[requires]
13+
python_version = "3.6"

Pipfile.lock

+118
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+36-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,47 @@
11
# Tabletop Simulator API
22

3-
This is the source of the api documentation in Tabletop Simulator. It uses a modified version of [Material-Design](https://github.com/squidfunk/mkdocs-material) for MKDocs.
3+
This is the source of the api documentation in Tabletop Simulator. It uses a modified version of [Material-Design](https://github.com/squidfunk/mkdocs-material) for MkDocs.
44

55
## How it Works
66

77
The `.md` files in the `/docs` folder are written in Markdown, which is an easy-to-use markup language to add formatting to text. Additionally, some custom CSS is used, as well as a handful of custom images. When making changes, it is possible to live-preview them as you go if you have set up the local files for mkdocs + material design.
88

99
Alternatively, you can make modifications to individual pages then submit them for review. The developers will always be the ones to build and publish the site anyway, all you will do is modify the contents of this Git.
1010

11-
### Installing
11+
## Contributing
1212

13-
If you choose to install MKDocs so you can live-preview your changes, you may do so [by following these instructions](https://squidfunk.github.io/mkdocs-material/getting-started/).
13+
The API website is built using [MkDocs](https://www.mkdocs.org/) and several related extensions.
1414

15-
Otherwise, you will not need to install anything to edit the text files.
15+
Pull requests are welcome, however in order to preview your changes, you must follow the instructions below:
16+
17+
### Prerequisites
18+
19+
You will need to ensure Python `3.6` is installed on your system.
20+
21+
If your system doesn't have it installed, you can either [download directly](https://www.python.org/downloads/release/python-366/) or install from a Python version manager such as [pyenv](https://github.com/pyenv/pyenv).
22+
23+
We utilise Pipenv and a `Pipfile` to ensure builds are consistent. If you don't already have Pipenv installed, please follow the official [pipenv install instructions](https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv) for you platform.
24+
25+
### Installing Dependencies
26+
27+
Once've you installed the prerequisites, you must initialize your environment. From command line, this is done with:
28+
29+
```
30+
pipenv install
31+
```
32+
33+
You can then "activate" this environment with:
34+
35+
```
36+
pipenv shell
37+
```
38+
39+
### Previewing
40+
41+
Once your Pipenv environment is activated, you can simply execute:
42+
43+
```
44+
mkdocs serve
45+
```
46+
47+
Then open your browser and navigate to `http://localhost:8000` in order to view your changes.

theme/partials/nav-item.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@
2626
{% set class = "md-nav__item md-nav__item--active" %}
2727
{% endif %}
2828

29-
3029
<!-- Main navigation item with nested items -->
3130
{% if nav_item.children %}
32-
<hr style=" border: 0; height: 0; border-top: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.3);">
3331
<li class="{{ class }} md-nav__item--nested">
3432

3533
<!-- Active checkbox expands items contained within nested section -->
@@ -70,7 +68,7 @@
7068

7169
<!-- Active checkbox expands items contained within nested section -->
7270
<input class="md-toggle md-nav__toggle" data-md-toggle="toc"
73-
type="checkbox" id="toc" />
71+
type="checkbox" id="__toc" />
7472

7573
<!-- Hack: see partials/toc.html for more information -->
7674
{% if toc_ | first is defined and "\x3ch1 id=" in page.content %}
@@ -79,11 +77,11 @@
7977

8078
<!-- Render table of contents, if not empty -->
8179
{% if toc_ | first is defined %}
82-
<label class="md-nav__link md-nav__link--active" for="toc">
80+
<label class="md-nav__link md-nav__link--active" for="__toc">
8381
{{ nav_item.title }}
8482
</label>
8583
{% endif %}
86-
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}"
84+
<a href="{{ nav_item.url | url }}" title="{{ nav_item.title }}"
8785
class="md-nav__link md-nav__link--active">
8886
{{ nav_item.title }}
8987
</a>
@@ -97,7 +95,7 @@
9795
<!-- Main navigation item -->
9896
{% else %}
9997
<li class="{{ class }}">
100-
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}"
98+
<a href="{{ nav_item.url | url }}" title="{{ nav_item.title }}"
10199
class="md-nav__link">
102100
{{ nav_item.title }}
103101
</a>

0 commit comments

Comments
 (0)