mirror of
https://github.com/google/pybadges.git
synced 2025-12-16 09:10:07 +01:00
Finalized center_ features
This commit is contained in:
@@ -194,7 +194,6 @@ def badge(
|
||||
'whole_link may not bet set with left_link, right_link, or center_link'
|
||||
)
|
||||
|
||||
# NOTE: Can only have a center_* element if also a right_* element
|
||||
if center_image and not (right_image or right_text):
|
||||
raise ValueError('cannot have a center_image without a right element')
|
||||
|
||||
|
||||
@@ -53,19 +53,27 @@
|
||||
{% if center_image %}
|
||||
<image x="{{ left_width }}" y="3" width="{{ center_width }}" height="14" xlink:href="{{ center_image }}"/>
|
||||
{% endif %}
|
||||
{% if right_image %}
|
||||
<image x="{{ left_width + center_width }}" y="3" width="{{ right_width }}" height="14" xlink:href="{{ right_image }}"/>
|
||||
{% endif %}
|
||||
{% if right_text %}
|
||||
<text x="{{ (left_width+center_width/2+right_width/2-1)*10 }}" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="{{ (right_width-center_width-10)*10 }}" lengthAdjust="spacing">{{ right_text }}</text>
|
||||
<text x="{{ (left_width+center_width/2+right_width/2-1)*10 }}" y="140" transform="scale(0.1)" textLength="{{ (right_width-center_width-10)*10 }}" lengthAdjust="spacing">{{ right_text }}</text>
|
||||
{% endif %}
|
||||
|
||||
{% if left_link or whole_link %}
|
||||
<a xlink:href="{{ left_link or wholelink }}">
|
||||
<a xlink:href="{{ left_link or whole_link }}">
|
||||
<rect width="{{ left_width }}" height="20" fill="rgba(0,0,0,0)"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if center_image and (center_width or whole_link) %}
|
||||
<a xlink:href="{{ center_link or whole_link }}">
|
||||
<rect x="{{ left_width }}" width="{{ center_width }}" height="20" fill="rgba(0,0,0,0)"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if right_link or whole_link %}
|
||||
<a xlink:href="{{ right_link or whole_link }}">
|
||||
<rect x="{{ left_width }}" width="{{ right_width }}" height="20" fill="rgba(0,0,0,0)"/>
|
||||
<rect x="{{ left_width + center_width }}" width="{{ right_width }}" height="20" fill="rgba(0,0,0,0)"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
</g>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="109.1" height="20"><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="round"><rect width="109.1" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#round)"><rect width="45.4" height="20" fill="#555"/><rect x="45.4" width="63.7" height="20" fill="#007ec6"/><rect width="109.1" height="20" fill="url(#smooth)"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><text x="237.0" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="354.0" lengthAdjust="spacing">github</text><text x="237.0" y="140" transform="scale(0.1)" textLength="354.0" lengthAdjust="spacing">github</text><text x="762.5" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="537.0" lengthAdjust="spacing">pybadges</text><text x="762.5" y="140" transform="scale(0.1)" textLength="537.0" lengthAdjust="spacing">pybadges</text><a xlink:href=""><rect width="45.4" height="20" fill="rgba(0,0,0,0)"/></a><a xlink:href="TODO"><rect x="45.4" width="63.7" height="20" fill="rgba(0,0,0,0)"/></a></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="109.1" height="20"><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="round"><rect width="109.1" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#round)"><rect width="45.4" height="20" fill="#555"/><rect x="45.4" width="63.7" height="20" fill="#007ec6"/><rect width="109.1" height="20" fill="url(#smooth)"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><text x="237.0" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="354.0" lengthAdjust="spacing">github</text><text x="237.0" y="140" transform="scale(0.1)" textLength="354.0" lengthAdjust="spacing">github</text><text x="762.5" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="537.0" lengthAdjust="spacing">pybadges</text><text x="762.5" y="140" transform="scale(0.1)" textLength="537.0" lengthAdjust="spacing">pybadges</text><a xlink:href="TODO"><rect width="45.4" height="20" fill="rgba(0,0,0,0)"/></a><a xlink:href="TODO"><rect x="45.4" width="63.7" height="20" fill="rgba(0,0,0,0)"/></a></g></svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="191.0" height="20"><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="round"><rect width="191.0" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#round)"><rect width="65.5" height="20" fill="#555"/><rect x="65.5" width="125.5" height="20" fill="#007ec6"/><rect width="191.0" height="20" fill="url(#smooth)"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/python.svg"/><text x="422.5" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="385.0" lengthAdjust="spacing">python</text><text x="422.5" y="140" transform="scale(0.1)" textLength="385.0" lengthAdjust="spacing">python</text><text x="1272.5" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="1155.0" lengthAdjust="spacing">3.2, 3.3, 3.4, 3.5, 3.6</text><text x="1272.5" y="140" transform="scale(0.1)" textLength="1155.0" lengthAdjust="spacing">3.2, 3.3, 3.4, 3.5, 3.6</text><a xlink:href=""><rect width="65.5" height="20" fill="rgba(0,0,0,0)"/></a><a xlink:href="https://www.python.org/"><rect x="65.5" width="125.5" height="20" fill="rgba(0,0,0,0)"/></a></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="191.0" height="20"><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="round"><rect width="191.0" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#round)"><rect width="65.5" height="20" fill="#555"/><rect x="65.5" width="125.5" height="20" fill="#007ec6"/><rect width="191.0" height="20" fill="url(#smooth)"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/python.svg"/><text x="422.5" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="385.0" lengthAdjust="spacing">python</text><text x="422.5" y="140" transform="scale(0.1)" textLength="385.0" lengthAdjust="spacing">python</text><text x="1272.5" y="150" fill="#010101" fill-opacity=".3" transform="scale(0.1)" textLength="1155.0" lengthAdjust="spacing">3.2, 3.3, 3.4, 3.5, 3.6</text><text x="1272.5" y="140" transform="scale(0.1)" textLength="1155.0" lengthAdjust="spacing">3.2, 3.3, 3.4, 3.5, 3.6</text><a xlink:href="https://www.python.org/"><rect width="65.5" height="20" fill="rgba(0,0,0,0)"/></a><a xlink:href="https://www.python.org/"><rect x="65.5" width="125.5" height="20" fill="rgba(0,0,0,0)"/></a></g></svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user