Difference between revisions of "User:Yfmcpxpj/Sandbox"
(→2x comic template test: Add reference docs.) |
(→2x comic template test: Put the demo that INCLUDES the button first.) |
||
Line 9: | Line 9: | ||
Experimental template, adding a "2x" button to automatically link to the double-resolution comic images on xkcd.com. | Experimental template, adding a "2x" button to automatically link to the double-resolution comic images on xkcd.com. | ||
− | === Comics | + | === Comics as of [[1084]] === |
− | [[1084]] was the first comic to include a 2x image, so comics | + | Comic [[1084]] was the first comic to include a 2x image, so for all comics as of 1084, insert a "2x" button to link directly to the higher resolution image on xkcd.com. |
Code: | Code: | ||
Line 17: | Line 17: | ||
<pre> | <pre> | ||
{{User:Yfmcpxpj/Template:comic 2x test | {{User:Yfmcpxpj/Template:comic 2x test | ||
− | | number = | + | | number = 1084 |
− | | date = July | + | | date = July 20, 2012 |
− | | title = | + | | title = Server Problem |
− | | image = | + | | image = server_problem.png |
− | | titletext = | + | | titletext = Protip: Annoy Ray Kurzweil by always referring to it as the 'Cybersingularity'. |
}} | }} | ||
</pre> | </pre> | ||
Line 28: | Line 28: | ||
{{User:Yfmcpxpj/Template:comic 2x test | {{User:Yfmcpxpj/Template:comic 2x test | ||
− | | number = | + | | number = 1084 |
− | | date = July | + | | date = July 20, 2012 |
− | | title = | + | | title = Server Problem |
− | | image = | + | | image = server_problem.png |
− | | titletext = | + | | titletext = Protip: Annoy Ray Kurzweil by always referring to it as the 'Cybersingularity'. |
}} | }} | ||
− | === Comics | + | === Comics up to and including [[1083]] (no 2x image) === |
− | For comics | + | For comics ''before'' [[1084]], no double-resolution image exists, so they should ''not'' have a "2x" button. |
Code: | Code: | ||
Line 43: | Line 43: | ||
<pre> | <pre> | ||
{{User:Yfmcpxpj/Template:comic 2x test | {{User:Yfmcpxpj/Template:comic 2x test | ||
− | | number = | + | | number = 1083 |
− | | date = July | + | | date = July 18, 2012 |
− | | title = | + | | title = Writing Styles |
− | | image = | + | | image = writing_styles.png |
− | | titletext = | + | | titletext = I liked the idea, suggested by h00k on bash.org, of a Twitter bot that messages prominent politicians to tell them when they've unnecessarily used sms-speak abbreviations despite having plenty of characters left. |
}} | }} | ||
</pre> | </pre> | ||
Line 54: | Line 54: | ||
{{User:Yfmcpxpj/Template:comic 2x test | {{User:Yfmcpxpj/Template:comic 2x test | ||
− | | number = | + | | number = 1083 |
− | | date = July | + | | date = July 18, 2012 |
− | | title = | + | | title = Writing Styles |
− | | image = | + | | image = writing_styles.png |
− | | titletext = | + | | titletext = I liked the idea, suggested by h00k on bash.org, of a Twitter bot that messages prominent politicians to tell them when they've unnecessarily used sms-speak abbreviations despite having plenty of characters left. |
}} | }} | ||
=== Omitting 2x button === | === Omitting 2x button === | ||
− | If the 2x button is broken or needs to be omitted for whatever reason, that can be done with the new <code>omit2x</code> parameter. | + | If the "2x" button target is broken, or if the button just needs to be omitted for whatever reason, that can be done with the new <code>omit2x</code> parameter. |
Code: | Code: | ||
Line 91: | Line 91: | ||
=== Overriding 2x target === | === Overriding 2x target === | ||
− | + | Alternatively, if the "2x" button needs to link to a different filename (for example, if the filename on xkcd.com doesn't match the filename on explainxkcd.com), the alternate filename can be specified in the <code>override2x</code> parameter. | |
Code: | Code: |
Revision as of 23:14, 11 October 2020
Contents
Yfmcpxpj's Sandbox
Sandbox for testing things.
2x comic template test
Test template: User:Yfmcpxpj/Template:comic 2x test
Experimental template, adding a "2x" button to automatically link to the double-resolution comic images on xkcd.com.
Comics as of 1084
Comic 1084 was the first comic to include a 2x image, so for all comics as of 1084, insert a "2x" button to link directly to the higher resolution image on xkcd.com.
Code:
{{User:Yfmcpxpj/Template:comic 2x test | number = 1084 | date = July 20, 2012 | title = Server Problem | image = server_problem.png | titletext = Protip: Annoy Ray Kurzweil by always referring to it as the 'Cybersingularity'. }}
Result:
Server Problem |
Title text: Protip: Annoy Ray Kurzweil by always referring to it as the 'Cybersingularity'. |
Comics up to and including 1083 (no 2x image)
For comics before 1084, no double-resolution image exists, so they should not have a "2x" button.
Code:
{{User:Yfmcpxpj/Template:comic 2x test | number = 1083 | date = July 18, 2012 | title = Writing Styles | image = writing_styles.png | titletext = I liked the idea, suggested by h00k on bash.org, of a Twitter bot that messages prominent politicians to tell them when they've unnecessarily used sms-speak abbreviations despite having plenty of characters left. }}
Result:
Omitting 2x button
If the "2x" button target is broken, or if the button just needs to be omitted for whatever reason, that can be done with the new omit2x
parameter.
Code:
{{User:Yfmcpxpj/Template:comic 2x test | number = 1085 | date = July 23, 2012 | title = ContextBot | image = contextbot.png | titletext = If you read all vaguebooking/vaguetweeting with the assumption that they're saying everything they can without revealing classified military information, the internet gets way more exciting. | omit2x = true }}
Result:
Overriding 2x target
Alternatively, if the "2x" button needs to link to a different filename (for example, if the filename on xkcd.com doesn't match the filename on explainxkcd.com), the alternate filename can be specified in the override2x
parameter.
Code:
{{User:Yfmcpxpj/Template:comic 2x test | number = 1085 | date = July 23, 2012 | title = ContextBot | image = contextbot.png | titletext = If you read all vaguebooking/vaguetweeting with the assumption that they're saying everything they can without revealing classified military information, the internet gets way more exciting. | override2x= server_problem_2x.png }}
Result:
This could also be used to add a "2x" button to older comics, if appropriate.
Code:
{{User:Yfmcpxpj/Template:comic 2x test | number = 1 | date = September 30, 2005 | title = Barrel - Part 1 | image = barrel_cropped_(1).jpg | titletext = Don't we all. | override2x= server_problem_2x.png }}
Result:
Barrel - Part 1 |
Title text: Don't we all. |
Note, however, that omit2x
takes precedence over override2x
.
Code:
{{User:Yfmcpxpj/Template:comic 2x test | number = 1085 | date = July 23, 2012 | title = ContextBot | image = contextbot.png | titletext = If you read all vaguebooking/vaguetweeting with the assumption that they're saying everything they can without revealing classified military information, the internet gets way more exciting. | override2x= server_problem_2x.png | omit2x = true }}
Result: