| 54 | |
| 55 | |
| 56 | def _github_button(topic_type): |
| 57 | |
| 58 | full_name = GITHUB_REPOSITORY.get(topic_type, "") |
| 59 | if not full_name: |
| 60 | return "" |
| 61 | |
| 62 | short_name = full_name.split("/", 1)[1] # pylint: disable=unused-variable |
| 63 | |
| 64 | button = ( |
| 65 | "<!-- Place this tag where you want the button to render. -->" |
| 66 | '<a aria-label="Star %(full_name)s on GitHub"' |
| 67 | ' data-count-aria-label="# stargazers on GitHub"' |
| 68 | ' data-count-api="/repos/%(full_name)s#stargazers_count"' |
| 69 | ' data-count-href="/%(full_name)s/stargazers"' |
| 70 | ' data-icon="octicon-star"' |
| 71 | ' href="https://github.com/%(full_name)s"' |
| 72 | ' class="github-button">%(short_name)s</a>' |
| 73 | ) % locals() |
| 74 | return button |
| 75 | |
| 76 | |
| 77 | def _render_html( |