rmaicle

Programming is an endless loop; it's either you break or exit.

Licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA).
You are free to copy, reproduce, distribute, display, and make adaptations but you must provide proper attribution. Visit https://creativecommons.org/ or send an email to info@creativecommons.org for more information about the License.

Test Post for Exhibiting Element “Styling” With Source Code

Date: 2014-11-01 11:04:40 +0000

This is an excerpt. This post is for previewing element styling. Lorem ipsum dolor sit amet, consectetur.

● Starting with heading texts h1h6.

H2 heading text source code

H3 heading text source code

H4 heading text source code

H5 heading text source code
H6 heading text source code

● Paragraphs

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget tellus vitae lectus sollicitudin feugiat. Nullam tempus elit in tellus malesuada, dignissim iaculis orci consequat. Vestibulum ut risus sem.

Ut vel mauris euismod, elementum erat vel, vulputate libero. Quisque feugiat nisl ut massa varius sagittis. Nunc pretium vel ante sed tempor. Nulla facilisis odio id eros luctus laoreet. Sed eleifend purus at diam pretium, eget euismod ex pulvinar.

Aliquam convallis quis massa nec vulputate. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum aliquam leo lorem, gravida dignissim tortor venenatis eget. Phasellus ultrices sed velit ut scelerisque.

● Lists

● Definition List

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget tellus vitae lectus sollicitudin feugiat. Nullam tempus elit in tellus malesuada, dignissim iaculis orci consequat.

Definition List One
First definition text. A source code block for the definition text.
int main() {
  writeln("Hello world!");
  return 0;
}
Second definition text with list items.
  • One
  • Two
  • Three
Definition List Two
First definition text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget tellus vitae lectus sollicitudin feugiat. Nullam tempus elit in tellus malesuada, dignissim iaculis orci consequat.

Second definition text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget tellus vitae lectus sollicitudin feugiat. Nullam tempus elit in tellus malesuada, dignissim iaculis orci consequat.

● Source Code Block

Plain source code block.

1234567890123456789012345678901234567890123456789012345678901234567890123456789012345
         1         2         3         4         5         6         7         8
def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.

Source code block with line numbers.

1
2
3
4
5
6
7
8
9
10
11
12
13
bool a = true;
bool b = false;
bool c = 1;
bool d = 0;
writeln(a);
writeln(b);
writeln(c);
writeln(d);
bool a = true;
bool b = false;
bool c = 1;
bool d = 0;
writeln(a);

● Syntax Display

Syntax display is presented in a block in monochrome color with three (3) inner blocks; the heading block, syntax block and the definition block.

Heading Block
Usually a label or a some description. It can have paragraphs and tables.
Syntax Block
The syntax format block displays the actual use of a command or function which is displayed in monospace font.
  • Can have multiple syntax specifications
  • Required items are enclosed in angle brackets (<>).
  • Optional items are enclosed in square brackets ([]).
  • The pipe symbol (|) means or, meaning one of the items listed.
  • Ellipses (...) means one or more of the parameter.
Definition Block
The definition block contains, well, the definition and/or description of the command, function or arguments in the syntax format block. It can have paragraphs and tables.
  • Required arguments is formatted as normal monospaced text.
  • Optional arguments is formatted as italic monospaced text.

Here is the syntax for the write and writef functions from the D standard library. This does not include the complete information on the functions but only shows what is used in this guide.

Function syntax.

write[ln] ([argument [, ...]);
writef[ln]([formatstring,] [argument [, ...]);
formatstring
Is used with writef and writefln functions. It may contain text, a format string or a combination of both. The format string has the following syntax:
%[flags][width][precision]formatcharacter

A formatstring begins with a percent % character.

flags
The flags are formatting features that can be turned on or off. Here are the most common flags:
Flags Description
- Left align
+ Prefix numbers with a plus sign if positive and minus sign if negative
0 Prefix numbers with zeroes
’ ‘ Prefix with spaces
width
The width is an optional numeric value that specifies the number of characters with which the argument is to be displayed. If the width is specified then the output is padded with zeroes or spaces.
precision
The precision is an optional numeric value for displaying floating-point types. It controls the number of digits to be displayed after the decimal point.
formatcharacter
The formatcharacter is a letter that tells what kind of argument is concerned. Here are the most common format characters:
Character Descriptionn
s Default format specifier. Converts the argument to string.
d Argument is an integral type and formatted as an integer.
f Argument is a floating point type and formatted in decimal notation.
argument [, ...]
One or more arguments. An argument may be a literal, variable or expression. If the formatted function is used, the number of arguments passed must correspond to the number of arguments specified in te format string.
  •  markdown
  •  github pages