Template:ThatIPBot/ArchiveConfig/doc

Overview
User:ThatIPBot/ArchiveConfig is a template used for User:ThatIPBot to archive pages.

How to set up for a discussion page
This bot only processes pages that are explicitly marked by transcluding a marker template, and archives sections inactive for a specified duration. The template may have parameters described belowAdministrators' noticeboard/Edit warring. (Most of them are optional.)

For a section to be archived, it must be a level 2 section, marked with. It is possible to opt-out some sections: see the explanation below.

This template tells that this page should be archived by ThatIPBot.

If you are unsure what code to use, a suggestion: go to and have a look at its copy paste section.

Setting up archiving
Put the following template at the top of the page that you want automatically archived:



Well, maybe not exactly that (read about required options below), but that's how it's done. By the way, the template has no content and is sysop-protected, so don't worry about visual appearance. :D

The bot expects to see only one parameter per line. The closing }} must be on its own line. There must be no leading spaces before the pipes. If you drop out the newlines used in the above example, e.g. by wrapping the template invocation onto a single line, the bot may not do what you expect.

Also, the template must be located:
 * 1) before the first ==second level header== on the page
 * 2) on the actual page and not transcluded from a subpage, such as a page header, etc.

Quick examples
To get the hang of it – configuration may not be intuitive, but it's flexible and gives potentially vast possibilities.


 * Please change "User talk:Example" to the exact name of your own page!
 * If it's still not working, read about the "minthreadsleft" and "minthreadstoarchive" parameters below.

Example 1: Static archive


(Please remember, this is an example and this exact code won't work on your page)

This setup archives threads from User talk:Example to User talk:Example/Archive after they are 7 days old (counting from newest timestamp). The archive will freeze when it becomes 2000KB large. Probably not a very useful config (unless for sending threads to a periodically cleaned trash bin or to decide yourself when to go to the next archive page), but it's easiest, so I'm mentioning it first.

Example 2: Incremental archives


(Please remember, this is an example and this exact code won't work on your page. Use the copy paste section below!) 

This tells the bot to archive threads over thirty days old (leaving the four most recent) from User talk:Example to User talk:Example/Archive 1]] (more about variables below) until it fills up to 150 kilobytes, whereupon the bot will move to 2 (updating the counter when saving page). Remember to specify the maximum size of an archive, or it will behave pretty much like in the first example. In addition, each archive page is given a Aan banner, which makes it easy to move between the different archive pages.

Example 3: Date-based archives


(Please remember, this is an example and this exact code won't work on your page. Use the copy paste section below!) (copy and paste for easy use) 

In this configuration, threads older than 5 days will land in archives depending on their date (that is newest timestamp). You can read about other variables below.

Variables
Those python-savvy people will immediately recognize these variables are filled at runtime with the % operator and should know how to adjust the format. A few points of interest to others:
 * make sure you don't mess up the last letter after the brackets (it's "d" for WP:integers and "s" for strings)
 * integer variables may be left-padded with zeros:
 * %(counter)03d evaluates to 013 if the counter 's value equals 13,
 * %(month)02d becomes 05 for May etc.

After you have set up archiving
This bot runs a few times a day (Really, it's just whenever I find it convenient, but you don't know that) Typically, such a template will be added to the top-level talk page to make archives easier to find. Simply add the template name in  where you want it to appear. Popular templates used for this purpose include:
 * Monthly archive list. If you use, use this with.
 * Talk header (this template has other functions, but can include a list of archives and a search box)
 * Talk header (this template has other functions, but can include a list of archives and a search box)

A related but distinct function is templates that appear in the archived talk pages themselves. For instance:
 * Automatic archive navigator

Missing signatures
One potential problem is that ThatIPBot does not archive sections that have no signatures. However editors sometimes forget to sign a comment so it may ignore old sections while archiving more recent ones.

One option is to manually archive sections that are unintentionally unsigned. The other option, which allows ThatIPBot to archive an unsigned section is to add a signature of the editor to the last comment in the section.

Help
If you need help, please leave a message at User:ThatIPEditor. They are usually very nice, and will help you to set up the archiving.

Variables for page name patterns
In the  parameter in the template, following variables can be used.