Validate code

This tool checks your editor's code to see if it has any simple syntax mistakes in it. At the moment it is extremely basic, and there are ways to trick it into thinking that the document is okay when it actually is not.

However, if you have a page with an error that you can't detect easily, this could potentially save you a lot of time because it will pick up on some simple mistakes in the code.

As this feature has so much potential to be extremely useful, please share any ideas that you have to make it work better! And if you have any pages with simple errors in them that took you a while to detect, try running it through the validator and let me know when it validates something that it shouldn't have.

Checks start and end tags

The validator will check to make sure that all start tags have a corresponding end tag. An odd number of either of them should display an error message:

[[div]] and [[/div]]

[[span]] and [[/span]]

[[<]] and [[/<]]

[[>]] and [[/>]]

[[=]] and [[/=]]

[[==]] and [[/==]]

[[code]] and [[/code]]

[[form]] and [[/form]] (also checks that there is a maximum of 1 form per page)

Some syntax items will also be checked, to make sure that there are an even number of them on the page:

Bold (**)

Italic (//), any slashes in URLs are ignored

Underline (__)

Strikethrough (--), any wikidot URLs that use this are not counted

Escape parsing (@@)

Module names

Some code has been written for validating module names, and even warning you when you are using a deprecated module, but this was never enabled in a released version of STE due to it not working properly. In the future this feature might be implemented, after the code for it has been re-written.

Known bugs

Any code that is escaped (and therefore not rendered) is still counted by the validator, and can cause an error message to appear on a perfectly valid page.

The validator is smart enough to ignore double-slashes (//) in a URL and double-hyphens (--) when linking to a file hosted at wdfiles.com, but unfortunately the current implementation does not know how to differentiate between a horizontal rule (----) and two strikethrough tags joined together (----). And something like --- will be counted as a single strikethrough tag, but it should be completely ignored instead.

An example of a false-positive is shown below. Because of the code Bold (@@**@@) being present on the page, that means there is an odd number of **, and the validator falsely treats this as an error. Click for image

And an example (Mac OS X 10.6.7) where validation was successful: Click for image

If the validator gives you a false-positive (reports a problem where none exists), please report it so that it can be fixed.

Future improvements

Check if module names are valid

Make sure that every {{ is followed by a }} (teletype text)

Check if code type is valid (e.g. Wikidot code blocks support C++ code highlighting, but it's defined as "cpp" not "c++" for the code type)

Reformat code

TODO

Rename pages

This feature allows you to batch-rename several pages on a site at once. Each page unix name should go on it's own line, in the "pages" box.

You have a few options:

Delete (Prepend): Deletes a page by prepending "deleted:" to the page name. This essentially moves the page into a different category. If you use something else (such as "trash" or "hidden") for your unwanted pages, you also have the ability to change that before you start the batch-rename operation!

Change category: This option will remove the category from the front of any pages you have included in the batch operation, and replace it with a different category name. By default this category name is "moved", but you can change it to whatever you want.

Append text: This feature is here simply for completeness, as it is the opposite to the two choices listed above. It allows you to append something to the end of several page names at once. For example, you may want to rename all pages in a category to have "-old" or "-archived" added to the end of their names. Once again, you have full control over exactly what is appended to the end.