コード例 #1
0
    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}"
コード例 #2
0
ファイル: markdown.py プロジェクト: vemel/mypy_boto3_builder
 def anchor(self) -> str:
     """
     Anchor link for title.
     """
     return get_anchor_link(self.title)
コード例 #3
0
 def test_get_anchor_link(self) -> None:
     assert get_anchor_link("test") == "test"
     assert get_anchor_link("n.ew_t est") == "new_t-est"