MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / detect_output_path

Method detect_output_path

scripts/migrate_wordpress.py:142–157  ·  view source on GitHub ↗

Derive repo output path and regulation from WordPress link URL. Returns (output_path, regulation).

(self, link: str)

Source from the content-addressed store, hash-verified

140 return all_docs
141
142 def detect_output_path(self, link: str) -> Tuple[str, str]:
143 """
144 Derive repo output path and regulation from WordPress link URL.
145 Returns (output_path, regulation).
146 """
147 link_decoded = unquote(link).lower()
148 match = re.search(r"/documentation/(.+?)/?$", link_decoded)
149 if not match:
150 return "_shared", "shared"
151 path_part = match.group(1)
152
153 for url_segment, repo_path, regulation in URL_PATH_MAP:
154 if path_part.startswith(url_segment):
155 return repo_path, regulation
156
157 return "_shared", "shared"
158
159 def html_to_markdown(self, html: str) -> str:
160 """Convert HTML content to clean Markdown."""

Callers 3

save_documentMethod · 0.95
list_structureMethod · 0.95
migrateMethod · 0.95

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected