Derive repo output path and regulation from WordPress link URL. Returns (output_path, regulation).
(self, link: str)
| 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.""" |
no test coverage detected