Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redo of documentation with mkdocs #1150

Merged
merged 30 commits into from
Jan 20, 2019
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1362957
Squashed commits for conversion of docs to mkdocs
rnorth Jan 19, 2019
4ec6b88
Add page on contributing to the docs
rnorth Jan 19, 2019
ef29f05
Remove old docs (mistaken commit)
rnorth Jan 19, 2019
2199b7b
Rearrange headings
rnorth Jan 19, 2019
37dfc83
Fix case
rnorth Jan 19, 2019
9dd0ba9
Remove broken link
rnorth Jan 19, 2019
7f1869c
Remove broken link
rnorth Jan 19, 2019
857ffc9
Replace broken bolt driver link with a page describing what the Bolt …
rnorth Jan 19, 2019
43d8e40
Update Zipkin link
rnorth Jan 19, 2019
478008f
Display Gradle dependency refs by default
rnorth Jan 20, 2019
da20fb3
Fix slack link
rnorth Jan 20, 2019
23dbd5a
Use a more recent Redis version for example, and change wording
rnorth Jan 20, 2019
a309e01
Simplify wording
rnorth Jan 20, 2019
1e48b71
Add note re avoiding hardcoding localhost
rnorth Jan 20, 2019
d4bd27b
Remove mention of lxc limitation.
rnorth Jan 20, 2019
12ae4e0
Fix spacing around ryuk config entries
rnorth Jan 20, 2019
3568539
Use testCompile
rnorth Jan 20, 2019
db83e7e
Remove spare blank line (codacy)
rnorth Jan 20, 2019
85a3cbf
Fix Before/After references
rnorth Jan 20, 2019
93a4f45
Add JUnit 5 JAR coords
rnorth Jan 20, 2019
daf165e
Add Spock JAR coords
rnorth Jan 20, 2019
41bc6e3
Combine suggestions for logging config
rnorth Jan 20, 2019
5dc97a6
Extract singleton container docs and basic info into a new section on…
rnorth Jan 20, 2019
5349641
Raise profile of local compose mode section
rnorth Jan 20, 2019
aa739d0
Fix list rendering
rnorth Jan 20, 2019
27bfa38
Tidy CI section
rnorth Jan 20, 2019
b879a04
Extract contributing tips into a new section
rnorth Jan 20, 2019
aa42224
Add pipenv files
bsideup Jan 20, 2019
2a6f9f6
Remove gitbook manifest
rnorth Jan 20, 2019
00f3638
Remove implementation from quickstart example
rnorth Jan 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use python 3.6.0
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@ out/
**/.settings
**/bin/
**/out/

# Generated docs
site/
.direnv/
src/mkdocs-codeinclude-plugin
src/pip-delete-this-directory.txt

.DS_Store
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Richard North
Copyright (c) 2015-2019 Richard North

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ 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.
SOFTWARE.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ subprojects {
compileJava.options.encoding = 'UTF-8'

lombok {
version = '1.18.2'
version = '1.18.2'
}

task delombok(type: io.franzbecker.gradle.lombok.task.DelombokTask) {
Expand Down
14 changes: 0 additions & 14 deletions docs/ROADMAP.md

This file was deleted.

67 changes: 0 additions & 67 deletions docs/SUMMARY.md

This file was deleted.

21 changes: 21 additions & 0 deletions docs/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Each redirect rule must be listed on a separate line, with the original path followed by the new path or URL.

/usage/docker_compose.html /modules/docker_compose/
/usage/generic_containers.html /features/creating_container/
/usage/windows_support.html /supported_docker_environment/windows/
/usage/dockerfile.html /features/creating_images/
/usage/inside_docker.html /supported_docker_environment/continuous_integration/dind_patterns/
/usage/webdriver_containers.html /modules/webdriver_containers/
/usage/properties.html /features/configuration/
/usage/kafka_containers.html /modules/kafka/
/usage/elasticsearch_container.html /modules/elasticsearch/
/usage/database_containers.html /modules/databases/
/usage/neo4j_container.html /modules/databases/neo4j/
/compatibility.html /supported_docker_environment/

# No great 1:1 mapping exists for the following, so redirect to somewhere where at least a sensible sidebar will be shown

/usage/options.html /features/creating_container/
/ci/ci.html /supported_docker_environment/
/usage.html /

105 changes: 105 additions & 0 deletions docs/contributing_docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Contributing to documentation

The testcontainers-java documentation is a static site built with [MkDocs](https://www.mkdocs.org/).
We use the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme, which offers a number of useful extensions to MkDocs.

In addition we use a [custom plugin](https://github.com/rnorth/mkdocs-codeinclude-plugin) for inclusion of code snippets.

We publish our documentation using Netlify.

## Previewing rendered content

### Previewing docs locally

* Ensure that you have Python 3.6.0 or higher.
* Set up a virtualenv and run `pip install -r requirements.txt` in the `testcontainers-java` root directory.
* Once Python dependencies have been installed, run `mkdocs serve` to start a local auto-updating MkDocs server.

### PR Preview deployments

Note that documentation for pull requests will automatically be published by Netlify as 'deploy previews'.
These deployment previews can be accessed via the `deploy/netlify` check that appears for each pull request.

## Codeincludes

The Gradle project under `docs/examples` is intended to hold compilable, runnable example code that can be included as
snippets into the documentation at build-time.

As a result, we can have more confidence that code samples shown in the documentation is valid.

We use a custom plugin for MkDocs to include snippets into our docs.

A codeinclude block will resemble a regular markdown link surrounded by a pair of XML comments, e.g.:

<!--
To prevent this from being rendered as a codeinclude when rendering this page, we use HTML tags.
See this in its rendered form to understand its actual appearance, or look at other pages in the
docs.
-->

<pre><code>&lt;!--codeinclude--&gt;
[Human readable title for snippet](./relative_path_to_example_code.java) targeting_expression
&lt;!--/codeinclude--&gt;
</code></pre>

Where `targeting_expression` could be:

* `block:someString` or
* `inside_block:someString`

If these are provided, the macro will seek out any line containing the token `someString` and grab the next curly brace
delimited block that it finds. `block` will grab the starting line and closing brace, whereas `inside_block` will omit
these.

e.g., given:
```java

public class FooService {

public void doFoo() {
foo.doSomething();
}

...

```

If we use `block:doFoo` as our targeting expression, we will have the following content included into our page:

```java
public void doFoo() {
foo.doSomething();
}
```

Whereas using `inside_block:doFoo` we would just have the inner content of the method included:

```java
foo.doSomething();
```

Note that:

* Any code included will be have its indentation reduced
* Every line in the source file will be searched for an instance of the token (e.g. `doFoo`). If more than one line
includes that token, then potentially more than one block could be targeted for inclusion. It is advisable to use a
specific, unique token to avoid unexpected behaviour.

When we wish to include a section of code that does not naturally appear within braces, we can simply insert our token,
with matching braces, in a comment.
While a little ugly, this has the benefit of working in any context and is easy to understand.
For example:

```java
public class FooService {

public void boringMethod() {
doSomethingBoring();

// doFoo {
doTheThingThatWeActuallyWantToShow();
// }
}


```
Loading