def get_md_doc_link( file: Literal["client", "service_resource", "waiters", "paginators", "type_defs", "literals", ], *parts: str, ) -> str: """ Get link to MD docs with anchor. Arguments: file -- HTML file name parts -- Anchor parts """ link = f"./{file}.md" if not parts: return link anchor = "".join([get_anchor_link(part) for part in parts]) return f"{link}#{anchor}"
def anchor(self) -> str: """ Anchor link for title. """ return get_anchor_link(self.title)
def test_get_anchor_link(self) -> None: assert get_anchor_link("test") == "test" assert get_anchor_link("n.ew_t est") == "new_t-est"