Fetch all published docs with pagination.
(self)
| 118 | return None |
| 119 | |
| 120 | def get_all_docs(self) -> List[dict]: |
| 121 | """Fetch all published docs with pagination.""" |
| 122 | all_docs = [] |
| 123 | page = 1 |
| 124 | params: dict = { |
| 125 | "per_page": 100, |
| 126 | "status": "publish", |
| 127 | "_fields": "id,title,slug,link,content,parent,modified", |
| 128 | } |
| 129 | while True: |
| 130 | params["page"] = page |
| 131 | docs = self.api_get("docs", params) |
| 132 | if not docs or not isinstance(docs, list): |
| 133 | break |
| 134 | all_docs.extend(docs) |
| 135 | print(f" Fetched page {page}: {len(docs)} docs (total: {len(all_docs)})") |
| 136 | if len(docs) < 100: |
| 137 | break |
| 138 | page += 1 |
| 139 | time.sleep(self.delay) |
| 140 | return all_docs |
| 141 | |
| 142 | def detect_output_path(self, link: str) -> Tuple[str, str]: |
| 143 | """ |
no test coverage detected