diff --git a/examples/ok-mkdocs-custom-extract/drone.yml b/examples/ok-mkdocs-custom-extract/drone.yml
new file mode 100644
index 00000000..6219dbd5
--- /dev/null
+++ b/examples/ok-mkdocs-custom-extract/drone.yml
@@ -0,0 +1,32 @@
+---
+### develop
+# ## Developing
+#
+# You can clone the repository with
+# ```
+# git clone https://this_is_a_dummy_url
+# ```
+###
+kind: pipeline
+name: bootstrap
+steps:
+ - name: fetch tags
+ image: alpine/git
+ commands:
+ - git fetch --tags
+
+ - name: build_install_test
+ image: python
+ commands:
+ - python --version
+ - pwd
+ - pip install flake8
+### develop
+# You can build the distribution with
+# ```
+ - pip install build
+ - python -m build .
+# ```
+# That will produce a `.whl` file in the `dist` subdirectory.
+###
+ - flake8 --max-line-length=80 --extend-exclude=build
diff --git a/examples/ok-mkdocs-custom-extract/drone_develop.grepout b/examples/ok-mkdocs-custom-extract/drone_develop.grepout
new file mode 100644
index 00000000..6867cfc0
--- /dev/null
+++ b/examples/ok-mkdocs-custom-extract/drone_develop.grepout
@@ -0,0 +1,10 @@
+
Developing
+
+You can clone the repository with
+git clone https://this_is_a_dummy_url
+
+You can build the distribution with
+ pip install build
+ python -m build .
+
+That will produce a .whl
file in the dist
subdirectory.
diff --git a/examples/ok-mkdocs-custom-extract/mkdocs-test.yml b/examples/ok-mkdocs-custom-extract/mkdocs-test.yml
index 56790d12..6eedd531 100644
--- a/examples/ok-mkdocs-custom-extract/mkdocs-test.yml
+++ b/examples/ok-mkdocs-custom-extract/mkdocs-test.yml
@@ -4,6 +4,12 @@
# everything from the beginning of the file to the first line of code
# (a line indented by at least four spaces), together with any later Markdown
# block preceded by a comment containing `# DOCPAGE`.
+#
+# Similarly, you may want to have to have a custom extraction even for a
+# standard file pattern, or for one particular file; the `drone.yml` pattern
+# could for example extract development documentation from a Drone yml file.
+# Note this latter pattern takes advantage of the fact that you can have just
+# a single top-level block of parameters in an `extract:` section.
site_name: ok-mkdocs-custom-extract
plugins:
- simple:
@@ -12,3 +18,9 @@ plugins:
extract:
- {stop: '^\s{4,}\S'} # No start, so active from beginning
- {start: '# DOCPAGE', stop: '^\s{4,}\S'}
+ - pattern: 'drone.yml'
+ destination: 'drone_develop.md'
+ extract:
+ start: '### develop'
+ stop: '^\s*###'
+ replace: ['^# (.*\s*)$', '^\s*-(.*\s*)$']
diff --git a/tests/integration_test.bats b/tests/integration_test.bats
index 2e5684f5..acf620b9 100755
--- a/tests/integration_test.bats
+++ b/tests/integration_test.bats
@@ -176,6 +176,8 @@ teardown() {
assertValidSite
assertFileExists site/fibo/index.html
assertParGrep fibo
+ assertFileExists site/drone_develop/index.html
+ assertParGrep drone_develop
}
@test "ignore site directory" {
@@ -237,7 +239,7 @@ teardown() {
assertParGrep module
}
-@test "build a site with iniline settings" {
+@test "build a site with inline settings" {
cd ${fixturesDir}/ok-mkdocs-inline-settings
assertGen
assertValidSite