Difference between revisions of "Template:1010PrAD"

From CompSciWiki
Jump to: navigation, search
m
m (Small change to the size of the right tab image)
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
{|style="width: 100%; font-weight: normal" cellpadding="5" cellspacing="0"
 
{|style="width: 100%; font-weight: normal" cellpadding="5" cellspacing="0"
 
|-  
 
|-  
!width: 70%; style="min-width: 65%; 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"|
+
!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" style="background:#C4D0DD; font-weight: normal; border: 1px solid grey;max-width: 30% !important;" valign="top"|
+
!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 |{{{SolutionCode}}}}} | SolutionCode goes here. Please DO NOT put your code in <pre> tags!}}
+
{{ #if: {{{SolutionCode|}}} | {{#tag:spoiler |{{#tag:pre |{{{SolutionCode}}}}}}} | SolutionCode goes here. Please DO NOT put your code in <pre> tags!}}
 
|}
 
|}
  
Line 27: Line 27:
 
<noinclude>
 
<noinclude>
 
''This template is used for the Program-A-Day page. Instructions and example usage are below.''
 
''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]].
  
 
----
 
----
Line 40: Line 42:
  
 
|SideSection=
 
|SideSection=
[[Image:OperatingSystemExample.jpg|center]]
+
[[Image:OperatingSystemExample.jpg|center|200px]]
 
<BR>
 
<BR>
 
An image or By Students section
 
An image or By Students section
Line 59: Line 61:
 
* Syntax highlighting will have to wait for the Wikimedia system to be updated to a more recent version.  
 
* 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 &lt;pre&gt; tags. Please be sure to restrict the number of characters per line in your SolutionCode parameter and inside any &lt;pre&gt; tags.  
 
* Note that there is NO WORDWRAP in use inside &lt;pre&gt; tags. Please be sure to restrict the number of characters per line in your SolutionCode parameter and inside any &lt;pre&gt; 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>
 
</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

Problem

The problem

 

...by students

OperatingSystemExample.jpg


An image or By Students section

Solution

The solution...

Code

Solution Code

Back to the Program-A-Day homepage