Difference between revisions of "Template:1010PrAD"
From CompSciWiki
m (Small change to the size of the right tab image) |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[Program_a_day|Back to the Program-A-Day homepage]] | + | <includeonly>[[Program_a_day|Back to the Program-A-Day homepage]] |
{|style="width: 100%; font-weight: normal" cellpadding="5" cellspacing="0" | {|style="width: 100%; font-weight: normal" cellpadding="5" cellspacing="0" | ||
|- | |- | ||
− | !style="font-weight: normal; padding: 15px; background: #E1E7EE; border-left: 1px solid grey; border-top: 1px solid grey; border-bottom: 1px solid grey" align="left | + | !width: 70%; style="font-weight: normal; padding: 15px; background: #E1E7EE; border-left: 1px solid grey; border-top: 1px solid grey; border-bottom: 1px solid grey" align="left" valign="top"| |
=Problem= | =Problem= | ||
{{{Problem|Problem goes here.}}} | {{{Problem|Problem goes here.}}} | ||
__NOTOC__ __NOEDITSECTION__ | __NOTOC__ __NOEDITSECTION__ | ||
!align="left" width="5%" style="background:#E1E7EE; border-top: 1px solid grey; border-bottom: 1px solid grey"| | !align="left" width="5%" style="background:#E1E7EE; border-top: 1px solid grey; border-bottom: 1px solid grey"| | ||
− | !align="left" width=" | + | !align="left" width="25%" style="background:#C4D0DD; font-weight: normal; border: 1px solid grey;" valign="top"| |
− | ={{{SideSectionTitle|SideSectionTitle | + | ={{{SideSectionTitle|SideSectionTitle}}}= |
{{{SideSection|SideSection goes here.}}} | {{{SideSection|SideSection goes here.}}} | ||
|- | |- | ||
Line 17: | Line 17: | ||
!colspan="3" valign="top" align="left" style="font-weight: normal"| | !colspan="3" valign="top" align="left" style="font-weight: normal"| | ||
=Code= | =Code= | ||
− | {{ #if: {{{SolutionCode|}}} | {{#tag:pre | | + | {{ #if: {{{SolutionCode|}}} | {{#tag:spoiler |{{#tag:pre |{{{SolutionCode}}}}}}} | SolutionCode goes here. Please DO NOT put your code in <pre> tags!}} |
|} | |} | ||
Line 24: | Line 24: | ||
[[Program_a_day|Back to the Program-A-Day homepage]] | [[Program_a_day|Back to the Program-A-Day homepage]] | ||
+ | </includeonly> | ||
+ | <noinclude> | ||
+ | ''This template is used for the Program-A-Day page. Instructions and example usage are below.'' | ||
+ | |||
+ | Original design by [[User:WikiSysop]]. Modified and updated by [[User:BrianT]] and [[User:KarelK]]. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | == Example Code Usage == | ||
+ | <pre> | ||
+ | {{1010PrAD | ||
+ | |ProblemName=The name of the program | ||
+ | |||
+ | |Problem=The problem | ||
+ | |||
+ | |SideSectionTitle=...by students | ||
+ | |||
+ | |SideSection= | ||
+ | [[Image:OperatingSystemExample.jpg|center|200px]] | ||
+ | <BR> | ||
+ | An image or By Students section | ||
+ | |||
+ | |Solution=The solution... | ||
+ | |||
+ | |SolutionCode=public class MySolution | ||
+ | { | ||
+ | public static void main ( String [] args ) | ||
+ | { | ||
+ | System.out.println("Hello, world!"); | ||
+ | } | ||
+ | } | ||
+ | }} | ||
+ | </pre> | ||
+ | == Current Issues == | ||
+ | * In the ''SolutionCode'' parameter, all ''OR'' pipe characters ( {{!}} character ) should be replaced with the pipe wiki template: <code><nowiki>{{!}}</nowiki></code> | ||
+ | * Syntax highlighting will have to wait for the Wikimedia system to be updated to a more recent version. | ||
+ | * Note that there is NO WORDWRAP in use inside <pre> tags. Please be sure to restrict the number of characters per line in your SolutionCode parameter and inside any <pre> tags. | ||
+ | |||
+ | == Sample Output == | ||
+ | Please note that the layout gets a bit skewed while displaying the template in itself; if you don't have horribly oversized images, everything will look fine when used in production. | ||
+ | |||
+ | '''Everything below this line is the sample output''' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | {{1010PrAD | ||
+ | |ProblemName=The name of the program | ||
+ | |||
+ | |Problem=The problem | ||
+ | |||
+ | |SideSectionTitle=...by students | ||
+ | |||
+ | |SideSection= | ||
+ | [[Image:OperatingSystemExample.jpg|center|200px]] | ||
+ | <BR> | ||
+ | An image or By Students section | ||
+ | |||
+ | |Solution=The solution... | ||
+ | |||
+ | |SolutionCode=public class MySolution | ||
+ | { | ||
+ | public static void main ( String [] args ) | ||
+ | { | ||
+ | System.out.println("Hello, world!"); | ||
+ | } | ||
+ | } | ||
+ | }} | ||
+ | </noinclude> |
Latest revision as of 10:55, 25 November 2010
This template is used for the Program-A-Day page. Instructions and example usage are below.
Original design by User:WikiSysop. Modified and updated by User:BrianT and User:KarelK.
Example Code Usage
{{1010PrAD |ProblemName=The name of the program |Problem=The problem |SideSectionTitle=...by students |SideSection= [[Image:OperatingSystemExample.jpg|center|200px]] <BR> An image or By Students section |Solution=The solution... |SolutionCode=public class MySolution { public static void main ( String [] args ) { System.out.println("Hello, world!"); } } }}
Current Issues
- In the SolutionCode parameter, all OR pipe characters ( | character ) should be replaced with the pipe wiki template:
{{!}}
- Syntax highlighting will have to wait for the Wikimedia system to be updated to a more recent version.
- Note that there is NO WORDWRAP in use inside <pre> tags. Please be sure to restrict the number of characters per line in your SolutionCode parameter and inside any <pre> tags.
Sample Output
Please note that the layout gets a bit skewed while displaying the template in itself; if you don't have horribly oversized images, everything will look fine when used in production.
Everything below this line is the sample output
Back to the Program-A-Day homepage
ProblemThe problem |
...by students
| |
---|---|---|
SolutionThe solution... | ||
Code |