mkdocs-rangefind 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocs-rangefind
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: MkDocs plugin that builds a Rangefind static search index and injects the search widget after every build.
5
5
  Project-URL: Homepage, https://github.com/xjodoin/rangefind
6
6
  Project-URL: Repository, https://github.com/xjodoin/rangefind
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "mkdocs-rangefind"
7
- version = "0.1.0"
7
+ version = "0.2.0"
8
8
  description = "MkDocs plugin that builds a Rangefind static search index and injects the search widget after every build."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -57,6 +57,11 @@ class RangefindPlugin(BasePlugin):
57
57
  # Command used to run the Rangefind CLI. "npx" resolves the local
58
58
  # `rangefind` install; can be pointed at a specific binary in CI.
59
59
  ("node_command", config_options.Type(str, default="npx")),
60
+ # Path to an ES module whose default export is an async
61
+ # function(docs) run on the crawled documents before indexing
62
+ # (embeddings, metadata, ...); may also export `config` overrides.
63
+ # Relative paths resolve from the project directory.
64
+ ("enrich", config_options.Type(str, default="")),
60
65
  # Where to place the <rangefind-search> element:
61
66
  # "body_end" (default) - injected right before </body> on every page.
62
67
  # "manual" - not injected; you hand-place it in a theme
@@ -103,6 +108,9 @@ class RangefindPlugin(BasePlugin):
103
108
  "--base-url",
104
109
  base_url,
105
110
  ]
111
+ if self.config["enrich"]:
112
+ enrich_abs = os.path.join(project_dir, self.config["enrich"])
113
+ command.extend(["--enrich", enrich_abs])
106
114
  log.info("Building Rangefind index: %s", " ".join(command))
107
115
  try:
108
116
  result = subprocess.run(