Difference between revisions of "Template:1010PrAD"

From CompSciWiki
Jump to: navigation, search
m (Small change to the size of the right tab image)
 
(14 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="65%" 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"|&nbsp;
 
!align="left" width="5%" style="background:#E1E7EE; border-top: 1px solid grey; border-bottom: 1px solid grey"|&nbsp;
!align="left" width="30%" style="background:#C4D0DD; font-weight: normal; border: 1px solid grey;" valign="top"|
+
!align="left" width="25%" style="background:#C4D0DD; font-weight: normal; border: 1px solid grey;" valign="top"|
={{{SideSectionTitle|SideSectionTitle goes here.}}}=
+
={{{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 put your code in &lt;pre&gt; tags!}}
+
{{ #if: {{{SolutionCode|}}} | {{#tag:spoiler |{{#tag:pre |{{{SolutionCode}}}}}}} | SolutionCode goes here. Please DO NOT put your code in &lt;pre&gt; tags!}}
{{{SolutionCode|SolutionCode goes here. Please put your code in &lt;pre&gt; tags!}}}
+
 
|}
 
|}
  
Line 25: 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 &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>

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