From bf35ba7aa8a7661b772dc9d5e52f9576903f7816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 20 May 2024 15:05:41 +0200 Subject: [PATCH 1/2] docs: improve contributing docs for code snippets --- docs/contributing_docs.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/contributing_docs.md b/docs/contributing_docs.md index bf896ea410..3df03a7387 100644 --- a/docs/contributing_docs.md +++ b/docs/contributing_docs.md @@ -3,10 +3,25 @@ The _Testcontainers for Go_ 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. +## Adding code snippets + +To include code snippets in the documentation, we use the [codeinclude plugin](https://github.com/rnorth/mkdocs-codeinclude-plugin), which uses the following syntax: + +<!--codeinclude-->
+[Human readable title for snippet](./relative_path_to_example_code.go) block:someString
+[Human readable title for snippet](./relative_path_to_example_code.go) inside_block:someString
+<!--/codeinclude-->
+ +Where each title snippet in the same `codeinclude` block would represent a new tab +in the snippet, and each `targeting_expression` would be: + +- `block:someString` or +- `inside_block:someString` + +Please refer to the [codeinclude plugin documentation](https://github.com/rnorth/mkdocs-codeinclude-plugin) for more information. + ## Previewing rendered content ### Using Python locally From 1507498cd8a941357f2866d8a8b7322659aa7353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 20 May 2024 16:13:40 +0200 Subject: [PATCH 2/2] chore: use placeholder --- docs/contributing_docs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contributing_docs.md b/docs/contributing_docs.md index 3df03a7387..bfa2ba6a69 100644 --- a/docs/contributing_docs.md +++ b/docs/contributing_docs.md @@ -10,8 +10,8 @@ We publish our documentation using Netlify. To include code snippets in the documentation, we use the [codeinclude plugin](https://github.com/rnorth/mkdocs-codeinclude-plugin), which uses the following syntax: <!--codeinclude-->
-[Human readable title for snippet](./relative_path_to_example_code.go) block:someString
-[Human readable title for snippet](./relative_path_to_example_code.go) inside_block:someString
+[Human readable title for snippet](./relative_path_to_example_code.go) targeting_expression
+[Human readable title for snippet](./relative_path_to_example_code.go) targeting_expression
<!--/codeinclude-->
Where each title snippet in the same `codeinclude` block would represent a new tab