Library of Formatting Examples talk:Main: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page describes how to build an LOFE example page using the templates.
This page explains how to build an LOFE example page using the templates.


==The Example Wrapper==
==The Navigation Bar==


Each example is wrapped in a div tag with one of three classes. Most examples should be wrapped in:
Each example page starts with the navigation bar. (To be documented)


    <div class=lofe-examples>
==The Start Template==
    </div>


This creates a flexible layout. For examples where you want to force a side by side layout regardless of screen width, instead use:
The start template takes a number of required arguments, and uses them to display the example image and set up for the formatted text display. Call it like so:


    <div class=lofe-examples-side-by-side>
<nowiki>{{LOFE:Example start |argument=value...}}</nowiki>
    </div>


There is a third type with a floating image and no formatted text that hasn't yet been implemented.
The arguments are:


==Building the example==
;image-filename:the wiki filename of the page image. Do not include "File:". Required.
;iw:the width of the image file; see discussion below. Required.
;tw:the width of the formatted text example; see discussion below. Required.
;size:add "size=small" to use a smaller text size in the correctly formatted text; useful where you want to encourage side by side display. Optional; default is "normal" (100%).


There are three templates used to build the example: one at the start of the example, one in the middle, and one at the end. The section below explains how each template works and what goes in between them.
The image and text width must be set to a multiple of 5 (20, 25, 30, etc.) In setting the widths:


===The Start Template===
* Set the text width so that the lines of text do not wrap when displayed in a standard monospace font. (Min 20, Max 70)
* Set the image width so that the text in the image appears about the same size as the example text, or a little bit larger. This will normally mean a slightly lower number. (Min 15, Max ?)


The start template is the most complex and takes a number of arguments. Call it with:
==The Marked-Up Text Example==


    <nowiki>{{LOFE:Example start |argument=value...}}</nowiki>
After the start template comes the correctly formatted text example. Start the correctly formatted text, then make the following changes:


The start template takes the following arguments:
* Add once space to the front of each line, including blank lines, in the source editor to create a single block of monospace text. You cannot use pre tags or any other method to achieve this; it will cause the required templates not to work.
* Where the number and spacing of blank lines is important, use the template <nowiki>{{LOFE:Blank}}</nowiki>.
* Replace any HTML-style tags that appear in the text with the <nowiki> {{LOFE:Tag}}</nowiki> template. Remember to replace both opening and closing tags:


;image-filename:the wiki filename of the page image. Do not include "File:".
<nowiki>{{LOFE:Tag|sc}}Tools and Appliances{{LOFE:Tag|/sc}}</nowiki>
;image-max:a class ID representing the maximum image size, in ems.
;text-max:a class ID representing the maximum size in ems for the formatted text block
;text-min:a class ID representing the minimum size in ems for the formatted text block


The permitted values for the -min and -max values are:
looks like this:


    /* minimums with m */
{{LOFE:Tag|sc}}Tools and Appliances{{LOFE:Tag|/sc}}
   
    div.lofe-m20 {min-width:20em;}
    div.lofe-m30 {min-width:30em;}
    div.lofe-m35 {min-width:35em;}
    div.lofe-m40 {min-width:40em;}
    div.lofe-m45 {min-width:45em;}
    div.lofe-m50 {min-width:50em;}
    div.lofe-m60 {min-width:60em;}
   
    /* maximums with x */
   
    div.lofe-x20 {max-width:20em;}
    div.lofe-x30 {max-width:30em;}
    div.lofe-x40 {max-width:40em;}
    div.lofe-x50 {max-width:50em;}


By default, the text block will have a minimum width of 35em, and both elements will have a maximum width of 50em.
* Where there is a short comment directly related to a specific line of text, use the <nowiki>{{LOFE:Comment}}</nowiki> template to add a comment.


===Correctly Formatted Text===
<nowiki>{{LOFE:Comment|This line is Mixed-small-caps; mark it}}</nowiki>


After the start template comes the correctly formatted text example. Start with just the correctly formatted text, then make the following changes:
looks like this:


* Add four spaces to the front of each line, including blank lines, in the source editor to create a single block of monospace text. Note: you cannot use pre tags or any other method to achieve this; it will cause the tags not to work.
{{LOFE:Comment|This line is Mixed-small-caps; mark it}}
* Where the number and spacing of blank lines is important, use the template <nowiki>{{LOFE:Blank}}</nowiki>.
* Replace any HTML-style tags that appear in the text with the <nowiki> {{LOFE:Tag}}</nowiki> template. Remember to replace both opening and closing tags:


    {{LOFE:Tag|sc}}Tools and Appliances{{LOFE:Tag|/sc}}
* In the original LOFE, all discussion was placed in the example as comments. Here, comments should only be used where they relate to a specific line; general discussion of the topic should instead go in the discussion section, described below.
 
* Where there is a short comment directly related to a specific line of text, use the <nowiki>{{LOFE:Comment}}</nowiki> template to add a comment.
 
    {{LOFE:Comment|This line is Mixed-small-caps; mark it}}
 
* In the original LOFE, all discussion was placed in the example as comments. Here, comments should only be used where they relate to a specific line; general discussion of the topic should instead go in the discussion section, below.


===The Middle Template===
===The Middle Template===
Line 73: Line 51:
After the formatted text, call the middle template with:
After the formatted text, call the middle template with:


    <nowiki>{{LOFE:Example middle}}</nowiki>
<nowiki>{{LOFE:Example middle}}</nowiki>


This template does not need any arguments or customisation. It will close the formatted text block and set up for the discussion section.
This template does not need any arguments or customisation. It will close the formatted text block and set up for the discussion section.
Line 79: Line 57:
===Discussion===
===Discussion===


At this point, there should be a brief discussion of the example. This starts with level 1 subhead summarizing the primary issue:
At this point, there should be a brief discussion of the example. This starts with a three-equals-sign heading summarizing the primary issue:


    <nowiki>===Italicized paragraphs===</nowiki>
<nowiki>=== Complete sentences ===</nowiki>
 
with lower-level subheadings as appropriate.


Some examples are used to demonstrate more than one type of formatting--for example, [[https://wiki.hapka.com/wiki/index.php?title=Library_of_Formatting_Examples:Small_Caps/16A|this example]] discusses both small caps and front matter. In that case:
Some examples are used to demonstrate more than one type of formatting--for example, [[https://wiki.hapka.com/wiki/index.php?title=Library_of_Formatting_Examples:Small_Caps/16A|this example]] discusses both small caps and front matter. In that case:


* List the issue related to the current section first (so under Front Matter the front matter section will come first);
* List the issue related to the current section first (so in the Front Matter example the front matter section will come first, but in the Small Caps example the section on small caps will come first);
* Use a new level 1 subheading for the separate topic; and
* Use a new three-equals-sign subheading for the separate topic; and
* Include links to the section and the specific discussion related to any other topic.
* Include links to the section and the specific discussion related to any other topic.


===The End Template===
===The End Template===


Like the middle template, the  
Like the middle template, the end template takes no arguments.
 
    <nowiki>{{LOFE:Example end}}</nowiki>


Don't forget to place the closing tag for your div at the end of the document, after the end template.
<nowiki>{{LOFE:Example end}}</nowiki>


===Example===
===Example===

Latest revision as of 12:17, 7 November 2025

This page explains how to build an LOFE example page using the templates.

The Navigation Bar

Each example page starts with the navigation bar. (To be documented)

The Start Template

The start template takes a number of required arguments, and uses them to display the example image and set up for the formatted text display. Call it like so:

{{LOFE:Example start |argument=value...}}

The arguments are:

image-filename
the wiki filename of the page image. Do not include "File:". Required.
iw
the width of the image file; see discussion below. Required.
tw
the width of the formatted text example; see discussion below. Required.
size
add "size=small" to use a smaller text size in the correctly formatted text; useful where you want to encourage side by side display. Optional; default is "normal" (100%).

The image and text width must be set to a multiple of 5 (20, 25, 30, etc.) In setting the widths:

  • Set the text width so that the lines of text do not wrap when displayed in a standard monospace font. (Min 20, Max 70)
  • Set the image width so that the text in the image appears about the same size as the example text, or a little bit larger. This will normally mean a slightly lower number. (Min 15, Max ?)

The Marked-Up Text Example

After the start template comes the correctly formatted text example. Start the correctly formatted text, then make the following changes:

  • Add once space to the front of each line, including blank lines, in the source editor to create a single block of monospace text. You cannot use pre tags or any other method to achieve this; it will cause the required templates not to work.
  • Where the number and spacing of blank lines is important, use the template {{LOFE:Blank}}.
  • Replace any HTML-style tags that appear in the text with the {{LOFE:Tag}} template. Remember to replace both opening and closing tags:
{{LOFE:Tag|sc}}Tools and Appliances{{LOFE:Tag|/sc}}

looks like this:

<sc>Tools and Appliances</sc>
  • Where there is a short comment directly related to a specific line of text, use the {{LOFE:Comment}} template to add a comment.
{{LOFE:Comment|This line is Mixed-small-caps; mark it}}

looks like this:

[** This line is Mixed-small-caps; mark it]
  • In the original LOFE, all discussion was placed in the example as comments. Here, comments should only be used where they relate to a specific line; general discussion of the topic should instead go in the discussion section, described below.

The Middle Template

After the formatted text, call the middle template with:

{{LOFE:Example middle}}

This template does not need any arguments or customisation. It will close the formatted text block and set up for the discussion section.

Discussion

At this point, there should be a brief discussion of the example. This starts with a three-equals-sign heading summarizing the primary issue:

=== Complete sentences ===

Some examples are used to demonstrate more than one type of formatting--for example, [example] discusses both small caps and front matter. In that case:

  • List the issue related to the current section first (so in the Front Matter example the front matter section will come first, but in the Small Caps example the section on small caps will come first);
  • Use a new three-equals-sign subheading for the separate topic; and
  • Include links to the section and the specific discussion related to any other topic.

The End Template

Like the middle template, the end template takes no arguments.

{{LOFE:Example end}}

Example