Hi,
is there something like a <sort>-Tag in Mediawiki? I have a list of links in my Wiki, and I'd like so have them sorted without doing much, eg like
<sort> * [[link4]] * [[link2]] * [[link3]] * [[link1]] </sort>
becoming
* [[link1]] * [[link2]] * [[link3]] * [[link4]]
Cheers,
- Moritz
On Wed, 16 Feb 2005 10:18:45 +0100, Moritz Karbach mailinglist@karba.ch wrote:
Hi,
is there something like a <sort>-Tag in Mediawiki? I have a list of links in my Wiki, and I'd like so have them sorted without doing much, eg like
No. Try copying them into a text-editor and getting that to do it, and/or using something like the *nix 'sort' command - I notice in vim, I can select a block of text and type ":!sort" (or rather ":'<,'>!sort", but it fills in the rest for me). I remember writing a series of very specific Perl scripts to sort whole pages, and give them nice headings and consistent formatting. In the past I've used MSWord's ability to sort a table to do similar tasks.
and/or using something like the *nix 'sort' command
For you Windows users, there's a pipeable sort.exe that comes with windows. Put your text in a file, say text1.txt from notepad or anything, then in a command window type --- sort < text1.txt > text2.txt ---
No, those angle brackets aren't tags, they are redirects :) . It'll create a new text file text2.txt that'll be sorted line-by-line alphanumerically.
Since sort is pipeable, the system() command should be able to deal with it just fine in PHP on Windows. But I've never actually done that.
--NDB
On Wed, 16 Feb 2005 14:03:15 -0500, N. M. Buzdor mediawiki@buzdor.com wrote:
Since sort is pipeable, the system() command should be able to deal with it just fine in PHP on Windows. But I've never actually done that.
As demonstrated in my previous message, that's really not necessary anyway. Any programming language worth its salt has at least one, and usually many, sorting functions built right in.
is there something like a <sort>-Tag in Mediawiki?
Sounds like a job for an extension. Sounds like a couple hours of work max if you know your way around PHP and Unix.
Look at wiki/extensions/Template.php. Wire in Unix sort(1) using PHP system('sort ...') and Bob's Your Uncle. Spend the rest of the time fretting about security issues.
If you're using Windows instead of some flavor of Unix, you have my deepest sympathy. Re-partition and install Linux and life will be simpler.
:::: Nothing will replace what we are burning up quickly now. Every possible replacement has problems which have received little publicity. -- Dr. Kenneth Watt :::: Jan Steinman http://www.Bytesmiths.com/Van
On Wed, 16 Feb 2005 09:23:03 -0800, Jan Steinman Jan@bytesmiths.com wrote:
is there something like a <sort>-Tag in Mediawiki?
Sounds like a job for an extension. Sounds like a couple hours of work max if you know your way around PHP and Unix.
Still seems like something best done externally and then dumped back in the wiki by humans to me - especially since that way it would be permanent, rather than being recalculated every time the page was viewed. And if the source is unsorted, you've got the increased risk of people adding duplicates because they'll dump everything at the end rather than finding the right place to add it; then the list will sort itself, and the duplicates will end up next to each other - but when someone goes to edit the list, they'll have to hunt through to find where they are in the source...
To make the sorting really easy, if you think it's going to happen a lot, you could put a form up on your website that lets people sort stuff. For a quick hack in pure PHP, copy http://195.137.84.82/~ron/sort.php.txt - you'll want to tidy it up, especially in terms of prettifying the HTML, but in general that's all you need.
Note that the function I used there, "natcasesort", is not only case insensitive, but is designed to act "like a human would", so for instance:
* [[link4]] * [[link10]] *[[Link2]] * [[LINK3]] * [[link 1]]
becomes:
* [[link 1]] *[[Link2]] * [[LINK3]] * [[link4]] * [[link10]]
On 16 Feb 2005, at 10:46, Rowan Collins wrote:
On Wed, 16 Feb 2005 09:23:03 -0800, Jan Steinman Jan@bytesmiths.com wrote:
is there something like a <sort>-Tag in Mediawiki?
Sounds like a job for an extension. Sounds like a couple hours of work max if you know your way around PHP and Unix.
Still seems like something best done externally and then dumped back in the wiki by humans to me...
You're right, of course.
It would be neat if you could easily sort in-place, rather than copy-paste.
On the Mac, you can do this in ANY editable window with a Service. (Services -> Format -> Sort Lines Ascending)
(Well, ALMOST any window, Microsoft crap being the notable exception).
That's the BEST way to do it, IMHO. Why send all the stuff to be sorted across the Internet, just to end up in the same window? But the rest of the world has yet to catch up with Apple.
-------- Sorted version of above appears below, just for fun: -------
(Well, ALMOST any window, Microsoft crap being the notable exception).
It would be neat if you could easily sort in-place, rather than copy-paste.
On the Mac, you can do this in ANY editable window with a Service. (Services -> Format -> Sort Lines Ascending)
That's the BEST way to do it, IMHO. Why send all the stuff to be sorted across the Internet, just to end up in the same window? But the rest of the world has yet to catch up with Apple.
You're right, of course.
:::: Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we. -- George W. Bush :::: Jan Steinman http://www.Bytesmiths.com/Events
If you are using a Microsoft operating system, can you please look at: http://www.IslandSeeds.org/wiki and tell me if the user tools (the ones that go across the top, like "66.93.41.199 Talk for this IP Create an account or log in") appear BELOW the banner graphic or ON TOP OF it?
It looks fine using four different browsers on MacOS X, but I'm having complaints from Microsoft users that it goes over the graphic.
If you try this and get either result, please reply privately and note your OS version and browser application and version. Thanks!
:::: I think our [energy] policy is called "aircraft carriers." -- Irwin Steltzer, 1987 :::: Jan Steinman http://www.Bytesmiths.com/Van
If you try this and get either result, please reply privately and note your OS version and browser application and version. Thanks!
I got a JavaScript error before I saw the page. "Line 3." I think it's because the system is sending out the main page instead of the raw JavaScript for the call on line 18. But the login link is below the image. Windows 2000, IE6.0.2800.1106.
--NDB
On 16 Feb 2005, at 11:01, N. M. Buzdor wrote:
If you try this and get either result, please reply privately and note your OS version and browser application and version. Thanks!
I got a JavaScript error before I saw the page. "Line 3." I think it's because the system is sending out the main page instead of the raw JavaScript for the call on line 18. But the login link is below the image. Windows 2000, IE6.0.2800.1106.
Damn. Thanks. I'll try to figure it out. Although that will be tough without any Microsoft products...
I'm glad to hear the link is below the banner, though. I didn't change anything from the monobook skin except transparency and offsets in skins/[copy of monobook]/main.css and skins/[copy of monobook].php, so I'm not looking forward to figuring out why it broke ONLY FOR MICROSOFT!
:::: ECONOMIST: a person who, upon encountering an auditorium containing 40,000 destitute, unemployed people and Bill Gates, says, “On average, I see a room full of millionaires!” :::: Jan Steinman http://www.Bytesmiths.com/Van
(I know it's an older message) It appears under, in the green strip. I'm using FireFox 1.0 on Windows XP SP1 (NT Version 5.1 (Build 2600.xpsp2.040919-1003 : Service Pack 1)).
You may want to look at it using FireFox's DOM Inspector (if supported on OS X). It seems that the DIV (p-personal) with that bar is a sibling of the image.
On Wed, 16 Feb 2005 09:40:49 -0800, Jan Steinman Jan@bytesmiths.com wrote:
If you are using a Microsoft operating system, can you please look at: http://www.IslandSeeds.org/wiki and tell me if the user tools (the ones that go across the top, like "66.93.41.199 Talk for this IP Create an account or log in") appear BELOW the banner graphic or ON TOP OF it?
It looks fine using four different browsers on MacOS X, but I'm having complaints from Microsoft users that it goes over the graphic.
If you try this and get either result, please reply privately and note your OS version and browser application and version. Thanks!
:::: I think our [energy] policy is called "aircraft carriers." -- Irwin Steltzer, 1987 :::: Jan Steinman http://www.Bytesmiths.com/Van
-- Jamie ------------------------------------------------------------------- http://endeavour.zapto.org/astro73/ Thank you to JosephM for inviting me to Gmail! Has lots of invites.
mediawiki-l@lists.wikimedia.org