Wikia

Vim Tips Wiki

Changes: Vim Tips Wiki:Category guidelines

Edit

Back to page

(clarify/correct detail)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 1: Line 1:
 
{{NavPolicy}}
 
{{NavPolicy}}
 
==In short==
 
==In short==
* '''Add a category''' to a tip with a <tt>|category1=''SomeCategory''</tt> line just before the final <tt>}}</tt> line of the tip template.
+
* '''Add a category''' to a tip with a <code>|category1=''SomeCategory''</code> line just before the final <code>}}</code> line of the tip template.
 
* '''Each tip is in one or more categories.'''
 
* '''Each tip is in one or more categories.'''
 
* '''Each category is in exactly one parent category.'''
 
* '''Each category is in exactly one parent category.'''
Line 27: Line 27:
 
'''Example'''
 
'''Example'''
   
# You may edit a tip on folding and find the wikitext: <tt>|category1=Usage</tt>
+
# You may edit a tip on folding and find the wikitext: <code>|category1=Usage</code>
# The tip template uses that line to put the tip in the Usage category (which will be shown at the bottom of the tip page). In that case, you should change the category by replacing "Usage" with "Folding", so it reads: <tt>|category1=Folding</tt>
+
# The tip template uses that line to put the tip in the Usage category (which will be shown at the bottom of the tip page). In that case, you should change the category by replacing "Usage" with "Folding", so it reads: <code>|category1=Folding</code>
 
# If the tip is not in the Usage category, you would simply add the above line to the bottom of the tip template.
 
# If the tip is not in the Usage category, you would simply add the above line to the bottom of the tip template.
   
 
A tip can be in more than one category. For example, a tip on folding Python programs should be in [[:Category:Folding]] and [[:Category:Python]]. However, multiple categories should not be predecessors of each other. So don't put a tip in category Folding ''and'' category Usage.
 
A tip can be in more than one category. For example, a tip on folding Python programs should be in [[:Category:Folding]] and [[:Category:Python]]. However, multiple categories should not be predecessors of each other. So don't put a tip in category Folding ''and'' category Usage.
   
Here is an example showing categories in a [[Template:TipImported|<tt>TipImported</tt>]] template (the same procedure works with the [[Template:TipNew|<tt>TipNew</tt>]] and the [[Template:TipProposed|<tt>TipProposed</tt>]] templates):
+
Here is an example showing categories in a [[Template:TipImported|<code>TipImported</code>]] template (the same procedure works with the [[Template:TipNew|<code>TipNew</code>]] and the [[Template:TipProposed|<code>TipProposed</code>]] templates):
   
 
<pre>
 
<pre>
Line 51: Line 51:
 
</pre>
 
</pre>
   
You can insert up to six categories using parameters <tt>category1</tt>, <tt>category2</tt>, <tt>category3</tt>, ... <tt>category6</tt>. In this example, <tt>category3</tt> has a blank value, so it will have no effect.
+
You can insert up to six categories using parameters <code>category1</code>, <code>category2</code>, <code>category3</code>, ... <code>category6</code>. In this example, <code>category3</code> has a blank value, so it will have no effect.
   
Note that "<tt>VimTip</tt>" does not appear in the wikitext – it is inserted automatically by [[Template:TipImported]] (on each tip imported from vim.org), or [[Template:TipNew]] (on each [[Project:New tips|accepted]] new tip created on this wiki). Proposed new tips (not yet accepted) use [[Template:TipProposed]] which inserts [[:Category:VimTipProposed]].
+
Note that "<code>VimTip</code>" does not appear in the wikitext – it is inserted automatically by [[Template:TipImported]] (on each tip imported from vim.org), or [[Template:TipNew]] (on each [[Project:New tips|accepted]] new tip created on this wiki). Proposed new tips (not yet accepted) use [[Template:TipProposed]] which inserts [[:Category:VimTipProposed]].
   
 
After editing a tip, click '''Preview''' to preview the result. The last line of the page will list the categories, allowing you to confirm that your edit will be successful when you save it.
 
After editing a tip, click '''Preview''' to preview the result. The last line of the page will list the categories, allowing you to confirm that your edit will be successful when you save it.
   
Put the categories just before the "<tt>}}</tt>" as shown above (the "<tt>}}</tt>" should be on a line by itself).
+
Put the categories just before the "<code>}}</code>" as shown above (the "<code>}}</code>" should be on a line by itself).
   
The traditional method of assigning a page to the Folding category would be to include the following line at the bottom: <tt><nowiki>[[Category:Folding]]</nowiki></tt>
+
The traditional method of assigning a page to the Folding category would be to include the following line at the bottom: <code><nowiki>[[Category:Folding]]</nowiki></code>
   
 
That method also works, but we are avoiding it to reduce confusion when users edit the Comments section. Periodically, [[User:JohnBot|a bot is run]] to move categories from the body of the tip into the tip template (however, the bot does not move a category unless it is on a line by itself, with no other wikitext, and the bot does not move [[:Category:Temporary]]).
 
That method also works, but we are avoiding it to reduce confusion when users edit the Comments section. Periodically, [[User:JohnBot|a bot is run]] to move categories from the body of the tip into the tip template (however, the bot does not move a category unless it is on a line by itself, with no other wikitext, and the bot does not move [[:Category:Temporary]]).

Latest revision as of 08:31, July 15, 2012

Vim Tip Guidelines
Quick reference
General guidelines
Titles and renaming a tip
Comments
Categories
Discussion page
Merging similar tips
Deleting a tip
Templates
Formatting code blocks
Entities and other magic
Script comments

In shortEdit

  • Add a category to a tip with a |category1=SomeCategory line just before the final }} line of the tip template.
  • Each tip is in one or more categories.
  • Each category is in exactly one parent category.
  • Create new categories carefully.

Examples and explanationsEdit

For example, there may be categories:

VimTip
Usage
Folding

The purpose of the folding category is to allow readers to easily find all tips that relate to using folding in Vim.

If a tip concerns folding, it should be in the Folding category (which has the Usage category as its parent). It should not also be in the Usage category, because that would be redundant. An exception is the VimTip category, which is meant to collect all tips.

See all categories for a list of all the categories, including some that deal with the rest of the wiki. Categories for Vim tips start at Category:VimTip.

Here is an ajax based category tree (requires javascript) using Template:vimcats

VimTip(7 C, 1,148 P)
[×] Building Vim(10 P)
Integration(5 C, 46 P)
LanguageSpecific(16 C, 17 P)
[×] Lists of scripts(6 P)
[×] Options(23 P)
Plugin(1 C, 17 P)
Usage(20 C, 69 P)


To track the review process, there is a statistics page for each category: Just append /stats to the URL, or follow the link below the headline. See Category:Folding and Category:Folding/stats.

Think twice before you add a new category. A category should contain a reasonable number of tips. It makes little sense to add a category just for one tip.

Example

  1. You may edit a tip on folding and find the wikitext: |category1=Usage
  2. The tip template uses that line to put the tip in the Usage category (which will be shown at the bottom of the tip page). In that case, you should change the category by replacing "Usage" with "Folding", so it reads: |category1=Folding
  3. If the tip is not in the Usage category, you would simply add the above line to the bottom of the tip template.

A tip can be in more than one category. For example, a tip on folding Python programs should be in Category:Folding and Category:Python. However, multiple categories should not be predecessors of each other. So don't put a tip in category Folding and category Usage.

Here is an example showing categories in a TipImported template (the same procedure works with the TipNew and the TipProposed templates):

{{TipImported
|id=741
|previous=740
|next=742
|created=June 7, 2004
|complexity=intermediate
|author=Anon
|version=6.0
|rating=21/11
|category1=Folding
|category2=Python
|category3=
}}

You can insert up to six categories using parameters category1, category2, category3, ... category6. In this example, category3 has a blank value, so it will have no effect.

Note that "VimTip" does not appear in the wikitext – it is inserted automatically by Template:TipImported (on each tip imported from vim.org), or Template:TipNew (on each accepted new tip created on this wiki). Proposed new tips (not yet accepted) use Template:TipProposed which inserts Category:VimTipProposed.

After editing a tip, click Preview to preview the result. The last line of the page will list the categories, allowing you to confirm that your edit will be successful when you save it.

Put the categories just before the "}}" as shown above (the "}}" should be on a line by itself).

The traditional method of assigning a page to the Folding category would be to include the following line at the bottom: [[Category:Folding]]

That method also works, but we are avoiding it to reduce confusion when users edit the Comments section. Periodically, a bot is run to move categories from the body of the tip into the tip template (however, the bot does not move a category unless it is on a line by itself, with no other wikitext, and the bot does not move Category:Temporary).

Around Wikia's network

Random Wiki