Supermariofan67

Joined February 4, 2017
m
Line 37: Line 37:


===Sort galleries alphabetically===
===Sort galleries alphabetically===
To sort a gallery alphabetically, put the code contents in a text file and run the command <code>sort -t '|' -k2</code> on it. This sorts alphabetically by the contents of the second text field, with text fields, in this case, separated by "|". By default, this will ignore special characters, such as <code><nowiki>[[</nowiki></code>, which is generally desired. If you want to sort all characters literally, run <code>export LC_ALL=C</code> first.
To sort a gallery alphabetically, put the code contents in a text file and run the command <code>awk -F'|' '{ print $NF "|" $0 }' filename | sort -t '|' -k1 | cut -d '|' -f2-4</code> on it. This sorts alphabetically by the contents of the last text field, with text fields, in this case, separated by "|", therefore grabbing the display names of links. By default, this will ignore special characters, such as <code><nowiki>[[</nowiki></code>, which is generally desired. If you want to sort all characters literally, run <code>export LC_ALL=C</code> first.


===Tricks with imagemagick===
===Tricks with imagemagick===
5,364

edits