Re: VimWiki: New Tips

2007-06-06 Thread Sebastian Menge
Am Mittwoch, den 06.06.2007, 11:22 +0200 schrieb Sebastian Menge:
> That needs to be fixed in the template. Will take some minutes.

Fixed. If "id" is empty, the template will produce other output. Also
fixed [[TipPreload]] to not use id and rating by default.

Seb.



Re: VimWiki: New Tips

2007-06-06 Thread Sebastian Menge
Am Mittwoch, den 06.06.2007, 10:12 +0100 schrieb A. S. Budden:
> The 'title' line of my tip ends with this: "Karma: Imported from:
> Tip#".  Since it wasn't an imported tip and the rating is supposed to

> 
> Any suggestions?


That needs to be fixed in the template. Will take some minutes.

Thanks for the pointer.

Seb.



Re: VimWiki - released finally

2007-06-05 Thread Sebastian Menge
Some more remarks. When replying it would be clever to change the
subject of the mail ...

Categories:
Tom, the category appears at the very bottom of a page.

see: http://meta.wikimedia.org/wiki/Help:Category

(meta.wikimedia.org is the best source for technical documentation about
mediawiki.)

Discussion:
Im not sure, whether the vim mailinglist is the right place to discuss
technical issues of the wiki !? But on the other hand i dont know any
better place :-) There is a "forum" on the wiki
( http://vim.wikia.com/index.php?title=Forum:Watercooler ), but I dont
like forums ... suggestions?

Ads:
Concerning ads, I recommend a good adblocker. http://adblockplus.org/
works well for me. :-) I asked the wikia staff to remove the ugly "Wikia
Spotlight" but they didnt react so far. 
We are a quite large community, and the user-base is even larger. It
would be interesting to estimate how much money they earn with us.

Skin:
There is a "skin" called "slate" It looks quite fance, but more
important it has some nice features like top-rated Pages and the like.
Test it here: http://vim.wikia.com/wiki/Main_Page?useskin=slate
I dont like the layout, but the features are quite nice ... (try to drag
and drop the boxes on the left ...) We could discuss that on the
http://vim.wikia.com/wiki/Talk:Main_Page.

Scripts:
Yeah that's an issue that would need some brainwork before. I never used
the scripts_db extensively, so im the wrong guy for that ... But when I
look at it, i dont see anything that couldn't be done with the wiki. But
that doesn't mean it should be done that way :-)

Sebastian.



Re: VimWiki - released finally

2007-06-05 Thread Sebastian Menge
Am Dienstag, den 05.06.2007, 11:14 -0500 schrieb Tom Purl:
> How do you update the categories?  I can't seem to find that text when I
> edit the full page.

It's a tree (or a directed acyclic graph !?): Simply tag a category with
its parent category/ies. For example


[[Category:LanguageSpecific]]

This category is for tips about the Python programming language. It is a
subcategory of Category:LanguageSpecific.




Re: VimWiki - released finally

2007-06-05 Thread Sebastian Menge
Am Dienstag, den 05.06.2007, 13:38 +0200 schrieb misi e:
> all what is missing now (as long as I know) an interface to access
> this wiki from vim itself .)

Easy with http://wikipediafs.sf.net :-)

Cool would be a vim-plugin that detects [[WikiPage]] and produces a link
that opens WikiPage.mw from the wikipediafs.

Seb.



VimWiki - released finally

2007-06-05 Thread Sebastian Menge
[cross-posted to vim, vim-dev, vim-announce, wikia-l]

Hi all

Finally I have imported all the vim tips from http://vim.org/tips to 

http://vim.wikia.com

and set up a minimal infrastructure to keep things going. Not everything
is perfect, but I think it is usable now.

Thanks to all the support from vim@vim.org and especially to the very
kind wikia community (#wikia on freenode and the mailing list,
Greetings!).

Some words on contribution: A good wiki depends on two main factors:
Excellent content and a lively community. We have a lot of good content
now, but to make it excellent we need You!

If you ever posted a tip or a comment to the old tips database, please
have a look at it on the wiki, and review the page. Every little bit
helps!

See you on the wiki, Sebastian.



vimlatex and mks

2007-06-04 Thread Sebastian Menge
Hey

I have a problem with vimlatex and mks.

To reproduce it:

1) create a simple tex file see attachment.
2) :mks!
3) quit vim
4) vim -S Session.vim

You should see something like this (from a more complicated
tex-file ...)

---
Fehler beim Ausführen von
"/home/menge/.vim/ftplugin/latex-suite/folding.vim":
Zeile   11:
"settings_preamble.tex" 47L, 721C
Fehler beim Ausführen von "/home/menge/Diss/sketches/sketches.vim":
Zeile  739:
"settings_preamble.tex" 47L, 721C
Zeile  885:
E165: Kann nicht über die letzte Datei hinausgehen
---

Hope there is someone around using vimlatex ...

TIA, Sebastian.
\documentclass{article}

\begin{document}
test
\end{document}


Re: Why bottom-posting is prefered on Vim Mainling List?

2007-05-30 Thread Sebastian Menge
Am Dienstag, den 29.05.2007, 17:05 +0800 schrieb [EMAIL PROTECTED]:
> PS: This Off-topic thread has been talked long and I'm sorry to bring
> excess load to vim mailing list, please mail directly to me if any vimmer
> friends wants to talk futher about it. Thanks.

This was a very good comment. 

Please do your best for good etiquette and focus on good tips and tricks
for vim :-)

Thanks, Sebastian.



Re: VimWiki - First Beta

2007-05-29 Thread Sebastian Menge
Am Dienstag, den 29.05.2007, 09:57 -0500 schrieb Tom Purl:
> At first blush, it looks really good.  I'm making a httrack copy of it
> right now since I know that it won't be up much longer.

No need to do that, ill leave the machine in the office, so everyone can
test all night long :-)

But please dont spam my machine ... ;-)

Sebastian.



Re: VimWiki - First Beta

2007-05-29 Thread Sebastian Menge
Am Dienstag, den 29.05.2007, 02:45 -1100 schrieb Yakov Lerner:
> On 5/29/07, Sebastian Menge <[EMAIL PROTECTED]> wrote:
> > Hi all
> >
> > Access the first beta here: http://tinyurl.com/34kfj5
> 
> Where can I see the "recently posted"/"by recency" view ?
> In other words, what's used for RSS ?

It's a quick and dirty installation on my machine, probably RSS is an
extension that is not installed. That will change on vim.wikia.com.

Recent Changes in HTML-Form can be found here:

http://tinyurl.com/34kfj5/index.php/Special:Recentchanges

Seb.




VimWiki - First Beta

2007-05-29 Thread Sebastian Menge
Hi all

Access the first beta here: http://tinyurl.com/34kfj5 

I did a lot of experiments over the weekend. I mostly used a local
mediawiki-installation and even from localhost to localhost a full
import takes about an hour. Im excited to learn how long it will take to
import to a remote mediawiki ...

Some notes about it:

1) references to other tips get automatically replaced like in
http://tinyurl.com/34kfj5/VimTip123

2) references to the vim help get replaced by links to the
vim-doc.sf.net as in http://tinyurl.com/34kfj5/VimTip26

3) the following chars are forbidden in titles : [] {} # | +
These get replaced by __HASH__ __PLUS__ and the like. This is ugly but i
dont want to do any editorial work on the articles now.

4) The formatting of the tips and comments gets broken fairly often.
This is because original tips are verbatim and could contain wiki-markup
(eg. one space indent is interpreted as verbatim by the wiki or the vim
command '[[' starts a wiki tag)

5) we definitely need to edit the tips later on. I wont tweak the script
up to infinity. Some things are easier repaired by Hand (e.g.
http://tinyurl.com/34kfj5/VimTip7 )

My host is only accessible until 17h MESZ (thats 3h from now on). Then
i'll be offline. 

Please give feedback!

Sebastian.





Re: VimWiki - Page Titles

2007-05-29 Thread Sebastian Menge
Am Dienstag, den 29.05.2007, 21:03 +1000 schrieb John Beckett:
> Sebastian Menge wrote:
> >> Put the list of 1500 tip titles in one file, one title per
> >> line. Then edit that file to clean up the titles. Then run a
> >> script to rename each tip to match the cleaned-up title.
> >
> > One idea was that the editing can be done on the wiki. Just
> > edit the Errornames page :-)
> 
> Neat, but please give explicit directions if that's what you
> want. There's not much point in my editing the titles if you
> meanwhile are planning to use some other scheme.

Forget that, most problems came from slashes which could not be handled
by wikipediafs. I fixed that.

Other special chars get replaced by "__HASH__" or "__BRACKET__" and the
like. Ugly, I know.

> Also, we (actually, you, because it looks like you're doing all
> the work:), need to resolve the issue of exactly what is allowed
> in a title, and we should agree on some general guidelines.
> 
> I think the Wikipedia style of prominently saying something like
> "this page should be titled xxx but due to technical
> restrictions we can't do that" is too ponderous (although
> reasonable in their context).
> 
> Maybe we could have something more informal (if scriptable).
> For example: tip 249 in your errornames might be:
> 
> Title = C - Quickly insert precompiler directives
>   [I'm not very happy with this wording]
> But first line of the tip might say:
>   C/C++: Quickly insert #if 0 - #endif around block of code
> 

I decided for myself that I dont wont to do editorial work on the tips
or comments. So some pages will look ugly and have to be repaired
manually later. But its a wiki: I hope that will evolve naturally.

> > stable regexes for 1500 pages are not easy to do
> 
> I'm glad it's you and not me! It's hardly reasonable to come up

As you perhaps guessed its a bit of fun for me :-) I'm learning python,
I deepen my regex understanding etc. Its a nice study :-)

See my next post for details ...

S.




Re: VimWiki - Page Titles

2007-05-28 Thread Sebastian Menge
Am Montag, den 28.05.2007, 16:18 +0200 schrieb A.J.Mechelynck:
> This is where my redirect suggestion comes into play (assuming wiki software 

I took your advice silently. Your suggestion is already in the script.

Sebastian.



Re: VimWiki - Page Titles

2007-05-28 Thread Sebastian Menge
Am Montag, den 28.05.2007, 19:32 +1000 schrieb John Beckett:
> Sebastian Menge wrote:
> > Find the list (95 entries) here:
> > http://scratchpad.wikia.com/wiki/Errornames
> 
> Thanks for the good start.
> FYI there are a couple of lines with broken links:
> 157 160: 171: Do you know the "g/" and "g?" commands?

That is fixed now. Was a problem with the script that produced the page.

> Yes! In option (b), you have to change every '/' to '__OR__', so
> you may as well change the titles to something good now.

That could be done by a regex.

> Can you readily do something like this: Put each tip in a
> separate file on your disk. Name them tip0001, tip0002, etc.
> 
> Put the list of 1500 tip titles in one file, one title per
> line. Then edit that file to clean up the titles. Then run a
> script to rename each tip to match the cleaned-up title.

One idea was that the editing can be done on the wiki. Just edit the
Errornames page :-)

> > or
> > b) replace '/' by sth like '__OR__' and fix the whole
> >title later?
> 
> Whatever works, but wouldn't this create a whole bunch of
> problems? I don't understand the internals of wikis but I think
> your suggestion would create 95 tips with URLs that will later
> need to be manually edited. Not so easy, and probably involves
> copying the content from the wiki to a new page, then deleting
> the old page (I guess).

Moving/Renaming is easy in wikis.

> > BTW: For the import I will now use WikipediaFS.
> 
> Wow - amazing.
> 
> How do you get the wiki format files from the VimTips web site?
> If you're going to do the work, I don't need this answered, but
> I'm thinking that you're going to need one of the scripts to
> convert the existing html to wiki format.
> 
> I noticed that Charles Campbell's script does appropriate things
> with common html codes like nonbreaking space. Probably all that
> processing should be done before the files are uploaded?
> 
> With your scheme, you're going to get 1500 tip files on your
> disk. It would be great if you could clean them as much as
> possible before uploading. It would be pretty easy to find all
> html markups and '&' codes when the files are still on your
> disk.

The cool thing with the WikipediaFS is that i can do scripting on the
pages _as if _ they were on my disk!

My general approach:

First i downloaded all tips to my machine. I startet with the script
vimtips.py and hacked it alot. The script uses a perl-module that
converts html to wiki-markup. But I still have problems with some
regexes: stable regexes for 1500 pages are not easy to do. I have to
clean up the script and will post it here, because I guess there are
some regex gurus around ...

Thanks, Sebastian.



VimWiki - Page Titles

2007-05-27 Thread Sebastian Menge
Hi

I have prepared a list with problematic page titles. Especially titles
with chars like [/#{}[]*] and the like are problematic since mediawiki
doesnt allow them (even if one urlencodes them).

Find the list (95 entries) here:

http://scratchpad.wikia.com/wiki/Errornames

Im not sure howto proceed here. Should we 

a) find better titles before the import or 
b) replace '/' by sth like '__OR__' and fix the whole title later?

I tend to b). Other suggestions?

BTW: For the import I will now use WikipediaFS. A great little
filesystem that lets you treat mediawiki articles like real files.
Simply edit with vim, :wq, done. Or for the bulkimport: copy/write
prepared files to the fs.

Sebastian.



Re: VimWiki - Poll on wiki hosting

2007-05-25 Thread Sebastian Menge
> On Wed, May 23, 2007 3:03 am, Sebastian Menge wrote:
> > Since John asked for wikibooks again, I've setup a poll to bring this

The poll now says

vim.wikia.com 48% 14 
wikibooks.org 28% 8 
I dont care.  24% 7

total votes: 29

Which is not a lot of votes, but there seems to be a direction. (BTW
thanks to all voters). I hope that those who voted for wikibooks can get
along with that and will support "vim.wikia.com" too.

Well, then I will do the import to wikia in the coming days. Before
that,  I will do further experiments on their scratchpad and report here
to get your comments.

Thanks for all the support,

Sebastian.



Re: VimWiki - referring to vimdoc

2007-05-23 Thread Sebastian Menge
Am Mittwoch, den 23.05.2007, 11:12 -0700 schrieb Gary Johnson:
> Executing ":help tags.txt" shows there is no tags.txt help file,

Yea, there is "tags" in the doc-directory of vim, one can easily use
that with python (python is really cool!) and construct the URL.

You're right, the text of the link should still be ":help sth"

Sebastian

PS: By now only 16 votes for the wiki-issue. I repeat the URL to the
poll just in case someone missed it at first:
http://snappoll.com/poll/194388.php



VimWiki - referring to vimdoc

2007-05-23 Thread Sebastian Menge
Im tweaking the import script right now, and noticed that there are many
references to the :help.

I would like to replace all the occurrences of sth. like (:help
some-text) by a reference to vimdoc.

Does someone know how what URL could be used instead of ":help
sometext" ??

I found the link
http://vimdoc.sourceforge.net/htmldoc/tags.html#help-tags but the page
is not available. (404)

Any ideas?

Sebastian.



VimWiki - Poll on wiki hosting

2007-05-23 Thread Sebastian Menge
Since John asked for wikibooks again, I've setup a poll to bring this
discussion to an end. But before some last words:

> > Wikibooks does not ask you to create "structure in chapters,sections" up 
> > front. It is not even suggested! Suggested is  "Content first" and 
> > "structure 
> > in chapters,sections" later.

But I don't see any structure in the 1500 tips. Neither now nor later.
That's the reason why tips are separated from the manual!

Regarding the ads on wikia: The guys there told me that ads will be
reduced much in space soon. And I even noticed ads on vim.org ... :-)

Now for the vote:

Please review the arguments before voting. I hope you can find all major
arguments in the full quote at the bottom of this mail. Perhaps a word
of Bram would be helpful !?

Now here's the link to the poll:

http://snappoll.com/poll/194388.php

I propose to close the vote on 

Friday, May 25th, 12:00 +0200 (MEZ aka CET).

(please ignore the funny graphic, it was the first result for "free
poll" on google ...)

Sebastian.


Am Dienstag, den 15.05.2007, 21:06 +0200 schrieb Martin Krischik:
> Am Dienstag 15 Mai 2007 schrieb Sebastian Menge:
> > Am Montag, den 14.05.2007, 21:49 +0200 schrieb Martin Krischik:
> > > Now refresh my mind: Why did we choose advertising ridden wikea over
> > > advertising free wikibooks?
> >
> > There was already a lot of discussion on this topic but no real
> > decision. I think that mediawiki is accepted as the most stable,
> > feature-rich and spam-resistant software around.
> >
> > Given that we dont want to host the wiki ourselves, we need a hosting
> > service: Here's a list http://en.wikipedia.org/wiki/List_of_wiki_farms
> > There are no mediawiki-based offers that are completely free.
> >
> > If someone has an idea where/howto host a mediawiki completey free, that
> > would be best!
> >
> > Here my pros and cons for wikia vs wikibooks:
> >
> > 1 +wikia: no costs
> > 2 +wikia: a complete wiki, not just a bunch of pages
> > 3 -wikia: ads
> >
> > 4 +wikibooks: really free, open content
> > 5 -wikibooks: is intended for books/lecture material. vim tips doesnt
> > fit that. A real book would need a structure in chapters,sections etc.
> 
> 6 +wikibooks: "personal" Administrator.
> 
> > For me points 2 and 5 win. But anyway I would love to see a good VimBook
> > on wikibooks.
> >
> > Other ideas/votes?
> 
> Now on WikiBook there is allready a "real book" with structure in chapters, 
> sections ;-) - it's called "Learning the vi editor".  Of the 16 chapters 7 
> are Vim chapters :-). And I belive Vim covers more the 50% of the content.
> 
> Now the Wiki motto is "Content first" so here my advertising free suggestion:
> 
> 1) We add the Vim tips to the "Tips and Tricks" Chapter
> 2) Once we we have enough tips (content) we split the book.
> 
> Wikibooks does not ask you to create "structure in chapters,sections" up 
> front. It is not even suggested! Suggested is  "Content first" and "structure 
> in chapters,sections" later.
> 
> BTW: With a tabbed browser and a fast internet connection you can rename 10 
> pages per minute - I once rename a 200 page book from "Programming:Ada" 
> to "Ada Programming".
> 
> Martin
> 
> [1] http://en.wikibooks.org/wiki/Learning_the_vi_editor
> [2] http://en.wikibooks.org/wiki/Learning_the_vi_editor/Vim/Tips_and_Tricks



Re: Vim Wiki - Tip Page Formatting Deadline

2007-05-21 Thread Sebastian Menge
Am Dienstag, den 15.05.2007, 10:23 -0500 schrieb Tom Purl:
> Task:  Wiki Format Sign-Off
> Deadline:  Monday, May 21st (arbitrary, I know)

OK, it's May 21st.

I reviewed all the contributions and will try to summarize everything in
one mail.

1.) Layout
- Template 2 is strongly preferred. 
- perhaps Metadata in front like in Template 4
- Comments should go on the same page under the assumption, that these
comments will finally find their way into the main tip. The
discussion-page should be used for meta-communication about future of
this tip (e.g. merging with another tip ?)
- comments should be done as in wikipedia:  to sign and  to
separate comments
- everything should fit on one page, no scrolling

The other thing was how to handle page-titles. Two concurring
approaches:

2.) Drop the id for new tips, use old ids just to redirect.
- We would need guidelines to get nice titles (no '(' and ')' )
- Should be easy to remember: "See tip #1" would get "See tip
"the_super_star"

3.) Use some scripting to keep ids, e.g. via a cron job that tidies up
each night or a javascript that uses a timestamp.

My (subjective!) impression is that 2.) is slightly before 3.)
Especially when it comes to the question who will write/host the scripts
(and assure that they will work for a long time)?

===

Now for my two cents:

Write the things we learned into some guideline-page. I will start that
tonight.

Simply use the template 2 as suggested in 1.) and use 2.) as the
approach for page titles. Layout issues of the template can be discussed
in the respective discussion page. Long and ugly titles can be changed
later as follows:

At import time, add a "coloured box" to each page saying that the tip
has been imported by a script and should be reviewed by a human. The box
should contain a link to the guidelines. After Review, the box can be
removed.

Conversion of HTML in Tip-Text. This should be converted to wiki markup
in the long run. Either we get a good script (some real regex guru
around?) that does it at import (which would delay the whole thing
again ...), or we refer in the above mentioned box to the guidelines
frew posted some days ago.

A problem are tips that contain URLs to external sites (e.g. other tips)
This is regarded as spam by mediawiki (captcha). Though the URLs are
clean (since someone edited them before) we have to either import these
tips by hand or convert all  in the script.

If no one votes strongly against this I would like that this week.
Silence is taken as agreement ;-)

Regards, Sebastian

-- 
I love deadlines. I like the whooshing sound they make as they fly by.

Douglas Adams



RE: Vim Wiki - Tip Page Formatting Deadline

2007-05-16 Thread Sebastian Menge
Am Mittwoch, den 16.05.2007, 09:43 +0200 schrieb Zdenek Sekera:
> - Tip2 template is seems fine to me.
> - Who will or how it will be decided what are the different
>   'complexity' (what terms will be allowed)?

I also vote for v2 (though i wrote v1 :-) )

And lets dont forget, that the layout of the template can be changed
always at a later time. So its no problem if we use a suboptimal
template for the beginning ... More important is that the fields keep
consistent ...


> - I find little inconvenient that when I want to add a comment
>   I can't have the original tip (and perhaps other comments)
>   in front of my eyes (maybe to scroll it manually) but that
>   may be unsolvable
> - it could be useful to have a possibility to have a button
>   saying 'Add a new tip' on every tip page so when I want
>   to add a tip I don't have to start from a different page.
>   That, too, may not be possible, correct?

There is already a "Add Tip" Button on
http://scratchpad.wikia.com/wiki/VimTest . If you try that out, you will
find some instructions on the top. These are freely editable at
http://scratchpad.wikia.com/wiki/TipInstructions .

When using this "AddTip" approach, people have to invent their own
pagename. (autoincrementig the tip-id seems to be impossible) 

Therefore, I would vote for using  tip-title == page-title and let the
categorization be done by [[Category:VimTip]]. Using Wikipedia standards
(CamelCaseIsUgly) we would get pages like "The Super Star" and we could
reuse the title in the template. We would loose the tip-id for new tips.
But that seems to be unavoidable. And what is the id good for anyways?
Using a cron job to convert tips wont work, because we have no access to
the host.

Sebastian.



Re: Vim Wiki - Wiki Template Proposal

2007-05-15 Thread Sebastian Menge
Am Dienstag, den 15.05.2007, 09:09 -0600 schrieb fREW:
> possible to wiki syntax.  Could someone send out the script that was
> used to upload pages initially?  It would be helpful to see it so that
> we could set up some translation code in the script.

I adapted the script vimtips.py from the URL Tom posted and the "bulk
page creator" script for mediawiki. The latter is in php and depends on
another php script. Would be nice if someone could translate the 80lines
php-script to python !?

Then I wrote a simple bashscript that calls both scripts.

A problem with bulkinsert.php was that mediawiki uses a Captcha
mechanism when there is a  in the text. The bash-scripts tries
to detect that and echoes a message.

I attach the three scripts (without any warranty ;-) ). But it would be
better to use a svn repository when we work on it together...

Can we get commit access to
http://vimtips.googlecode.com/svn/trunk/scripts/ ?

Sebastian


bulkinsert.php
Description: application/php
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vimtips.py -- parse tips from www.vim.org
# written by Ali Polatel

import os
import sys
import re, urllib2
import commands

__author__ = 'Ali Polatel'
__contributors__ = []

# Globals
URL = 'http://www.vim.org/tips/tip.php?tip_id=%d'
headers= { 'User-Agent': 'vimtips.py' }
href_r = re.compile(r'.*?)["\']>(?P.*?)',re.IGNORECASE)
 


class comment:
""" Type for additional comments
"""
email = None
date = None
text = None

def htmltowiki(str):
""" Take care of html stuffed 
that's not recognized by wikipedia
"""
# Remove ^M's
str = str.replace('\r','')

# Convert href tags
#m = href_r.findall(str)
#for tag in m:
# Add www.vim.org if the link starts with /
# TODO change this to the corresponding wiki adress of the tip ;)
#if tag[0].startswith('/'):
#link = 'http://www.vim.org' + tag[0]
#str = re.sub(r'%s' % tag[1]
# ,'[%s %s]' % (link, tag[1])
# ,str)

# Initial support for html2wiki
# Very ugly but it does the job well
fp = open('vimtip_tmp.html','w')
fp.write(str)
fp.close()
status,tmpstr = commands.getstatusoutput('html2wiki --dialect MediaWiki vimtip_tmp.html')
if status != 0: # html2wiki is not in PATH or it exited with error
sys.stderr.write('html2wiki not found, skipping conversion\n')
else:
str= tmpstr
os.remove('vimtip_tmp.html')
return str

def gettip(id):
""" Get the tip from www.vim.org
"""
tip_url = URL % id
req = urllib2.Request(tip_url, None, headers)
data = urllib2.urlopen(req)
return data.read()

def parsetip(tip):
""" Parse the tip
"""

title_r = re.compile('Tip #\d*\ -\ (.*?)\s:')
rating_r = re.compile('Rating\s(-?\d+/\d+)')
body_r = re.compile('(.*)')
add_r = re.compile('\n\t\s*\t\s*(?P.*?),\s\n\t\s*\t\s*<.*>\s(?P.*?)')
comment_r = re.compile('(.*)')

try:
title = title_r.search(tip).groups()[0]
except AttributeError: # Tip doesn't exist
return None
rating = rating_r.search(tip).groups()[0]
body = body_r.search(tip).groups()[0]

# Additional comments
comments = []
m = add_r.finditer(tip)
for match in m:
new = comment()
new.email = htmltowiki(match.group('email'))
new.date = match.group('date')
comments.append(new)

m = comment_r.finditer(tip)
index = 0
for match in m:
comments[index].text = htmltowiki(match.groups()[0])
index+=1

lst = tip.split('\n')

# The lines we want are two lines below these lines
created_td = 'created:'
complexity_td = 'complexity:'
author_td = 'author:'
version_td = 'as of Vim:'

created = re.sub('\s*<.?td>','',lst[lst.index(created_td)+2])
complexity = re.sub('\s*<.?td>','',lst[lst.index(complexity_td)+2])
author = re.sub('\s*<.?td>','',lst[lst.index(author_td)+2])
version = re.sub('\s*<.?td>','',lst[lst.index(version_td)+2])

if not version: # Version empty
version = 'n/a'

return htmltowiki(title), author, created, complexity, version, rating, htmltowiki(body), comments

if __name__ == '__main__':

if len(sys.argv) != 2:
print 'Usage %s tip_id' % sys.argv[0]
sys.exit(-1) 
id = int(sys.argv[1])
tip = gettip(id)
parsedtip = parsetip(tip)
   
if parsedtip is None:
print 'No tip with id %d exists on www.vim.org' % id
sys.exit(-2)

print 'VimTip%d' % id
print '--ENDTITLE--'
print '{{Tip2'
print '|id=%d' % id
print '|title=%s' % parsedtip[0]
print '|created=%s' % parsedtip[2]
print '|complexity=%s' % parsedtip[3]
print '|author=%s' % parsedtip[1]
print '|version=%s' % parsedtip[4]
print '|ratin=%s' % parsedtip[5]
print '|text='
print parsedtip[6]
print '}}'
# And additional comment

RE: Vim Wiki - Wiki Template Proposal

2007-05-15 Thread Sebastian Menge
Am Dienstag, den 15.05.2007, 13:51 +0200 schrieb Zdenek Sekera:
> > http://scratchpad.wikia.com/wiki/VimTest
> > 
> 
> This page gives "error on page" message during loading plus some
> other message, but all flashes so quickly at the bottom of the

Works for me...

S.



RE: Vim Wiki - Wiki Template Proposal

2007-05-15 Thread Sebastian Menge
Am Dienstag, den 15.05.2007, 10:03 +0200 schrieb Sebastian Menge:
> There is an extension called "InbutBox" but I have not
> understood yet howto use it.

Now I have. There is a sample on
http://scratchpad.wikia.com/wiki/VimTest

But it leads to another problem: In a wiki we have no means to
autoincrement the id.

Thus the convention VimTip for page names is not feasible. A good
prefix is a must in my opinion, but what suffix? Howto assure that it is
unique, not cryptic etc? Or what about complete freedom, and revising it
afterwards? Perhaps we can even drop the prefix and use simply a
"category".

Seb.



wiki hosting

2007-05-15 Thread Sebastian Menge
Am Montag, den 14.05.2007, 21:49 +0200 schrieb Martin Krischik:
> Now refresh my mind: Why did we choose advertising ridden wikea over 
> advertising free wikibooks?

There was already a lot of discussion on this topic but no real
decision. I think that mediawiki is accepted as the most stable,
feature-rich and spam-resistant software around.

Given that we dont want to host the wiki ourselves, we need a hosting
service: Here's a list http://en.wikipedia.org/wiki/List_of_wiki_farms
There are no mediawiki-based offers that are completely free. 

If someone has an idea where/howto host a mediawiki completey free, that
would be best!

Here my pros and cons for wikia vs wikibooks:

1 +wikia: no costs
2 +wikia: a complete wiki, not just a bunch of pages
3 -wikia: ads

4 +wikibooks: really free, open content
5 -wikibooks: is intended for books/lecture material. vim tips doesnt
fit that. A real book would need a structure in chapters,sections etc.

For me points 2 and 5 win. But anyway I would love to see a good VimBook
on wikibooks.

Other ideas/votes?

Sebastian.



RE: Vim Wiki - Wiki Template Proposal

2007-05-15 Thread Sebastian Menge
Thanks for the feedback!

1) I think learning to fillout the template is easier than learning wiki
markup.

2) Im pretty sure there is a way to post a new tip by means of an HTML
Form. Perhaps Martin knows more about the abilities of mediawiki in this
respect. There is an extension called "InbutBox" but I have not
understood yet howto use it.

3) The template I posted was just a very first (and ugly) prototype
intended to keep the whole layout question off this list! If you don't
like it, feel free to change it: It's a wiki!

Sebastian.



Wiki: structure, template and logo

2007-05-14 Thread Sebastian Menge
Hi 

The discussion about http://vim.wikia.com seems to die. I doubt we can
hold the schedule if we don't do something.

Using the scripts you posted it is very easy to publish all the tips in
the template-format. So it's a matter of an hour to publish all the tips
to the wikia. If there are at least some people on the list who like
that proposal, I would do that this week. The layout can be changed at
any time. More important is the real data: At the moment the template
looks like this: http://scratchpad.wikia.com/wiki/Template:Tip Did i
forget something important?

Further I have created a vim logo for the wikia (simply exported vim.svg
to png and the right resolution), but it seems I am not allowed to
upload it as "Wiki.png" which is protected and used as default logo. I
have no idea about rights management in mediawiki, perhaps Tom as the
admin knows more about that?

Last point: Should the wiki be only for tips? Or should the tips be one
part of the wiki? I would prefer the last: Setup a nice frontpage for
the wiki that links to another page "VimTips" which is in turn a
frontpage to the tips "VimTip".

Sebastian.

BTW Is there someone around who knows the wikipedia standards well?
Should it be [[VimTip], [[Vim Tip]] or [[Vim_Tip]] !? Would be nice if
there were someone who could review the pages for things like that ...



Re: Project specific settings

2007-05-14 Thread Sebastian Menge
Am Montag, den 14.05.2007, 10:05 +0200 schrieb Marius Roets:
> I always uses spaces to indent my code, but a current project requires
> me to use tabs. How could I make this setting only be in effect for this
> one project, assuming that the project will always be a in a specific
> directory.

:help mksession
:help tabstop

:-)

Sebastian



RE: VimWiki - again - but with a brand new option

2007-05-10 Thread Sebastian Menge
Am Donnerstag, den 10.05.2007, 11:40 -0500 schrieb Tom Purl:
> For the record, a couple of very knowledgeable people have already done
> most of the hard work.  For examples, we have a collection of conversion
> scripts already:
> 
> * http://vimtips.googlecode.com/svn/trunk/scripts/

Doh! -- Seb.



Re: VimWiki - again - but with a brand new option

2007-05-10 Thread Sebastian Menge
Am Donnerstag, den 10.05.2007, 10:44 -0500 schrieb Tom Purl:
> > did last time: Put a sample tip on a wiki page so we can agree
> > on its features.
> 
> We already have a tip on the page that people have been working on.  You
> can see the link to it on the following page:
> 
> * http://en.wikibooks.org/wiki/Learning_the_vi_editor/Vim/TipsSandbox

And we have 
> http://scratchpad.wikia.com/wiki/VimTest
> http://scratchpad.wikia.com/wiki/Template:Tip

The proposal was not about the layout directly but about separating
formatting from content! So feel free to change the formatting of the
Template, but with this approach noone has ever to edit the tips
directly to change the design ...

Please dont mix content and markup at import time!

As for scripting: There is 
http://meta.wikimedia.org/wiki/MediaWiki_Bulk_Page_Creator
and
http://hawking.nonlogic.org/stuff/python/vimtips.py

The adaption and combination of both resulted in:

http://scratchpad.wikia.com/wiki/VimTip1
http://scratchpad.wikia.com/wiki/VimTip2
http://scratchpad.wikia.com/wiki/VimTip3
http://scratchpad.wikia.com/wiki/VimTip4
http://scratchpad.wikia.com/wiki/VimTip5

All use the Template:Tip

(15 Minutes of work ...)

But i guess there are better scripts to parse the tips. Perhaps someone
could even setup a php-script directly on vim.org that produces the
right markup (without parsing the html of tips.php ...)

> Thanks for the feedback!  My "proposal" is basically what I said
> yesterday - that we follow some sort of schedule and make some
> decisions.  I like your suggestions.  What does everyone else think?

Lets just go ahead on the Wikia. 

Sebastian.



Re: VimWiki - again - but with a brand new option

2007-05-09 Thread Sebastian Menge
Am Mittwoch, den 09.05.2007, 13:06 -0500 schrieb Tom Purl:
> We do have a Wikia site available if we want it
> (http://vim.wikia.com/wiki/Main_Page).  I agree with you; it has a lot
> of nice features, and may give us a bit more flexibility than the
> wikibooks option.  I think we should revisit this topic once we're ready

The features are mostly the same. In fact all major extensions are
installed on wikibooks too. On any mediawiki try out the page
"Special:Version" to see all installed extensions:
http://wikibooks.org/wiki/Special:Version

Note the modules SpamBlacklist, UsernameBlacklist and ConfirmEdit
(Captcha)

Wikia.com is clearly aimed at making money with ads. Therefore I now
vote for wikibooks.org. :-)

Sebastian.



Re: VimWiki - again - but with a brand new option

2007-05-09 Thread Sebastian Menge
Am Mittwoch, den 09.05.2007, 10:33 -0500 schrieb Tom Purl:
> I wasn't aware of this, and it's definitely a problem.  Here's what I
> propose we do:

First, im not sure about what you mean by a) "formatting standard" and
b) a "script that supports the standard"

is a) something like a template in mediawiki-speak? see: 
   http://home.comcast.net/~gerisch/MediaWikiTemplates.html
   http://www.mediawiki.org/wiki/Help:Templates

is b) something that reads the tips-db on vim.org and posts it to the
wiki?

Everything else is agreed and appreciated :-)

Seb.

PS: When writing this mail I got my hands dirty on the scratchpad of
wikia.com:
http://scratchpad.wikia.com/wiki/VimTest
http://scratchpad.wikia.com/wiki/Template:Tip

PPS: There are extensions for mediawiki that could be useful:

To supply a HTML-Form to submit a tip:
http://meta.wikimedia.org/wiki/Help:Inputbox 

To order a list of pages by "popularity"
http://semeb.com/dpldemo/index.php/Manual

Both are installed on wikia.org



Re: VimWiki - again - but with a brand new option

2007-05-08 Thread Sebastian Menge
Am Montag, den 07.05.2007, 16:07 -0700 schrieb Ian Tegebo:
> The Wiki would ideally understand how to link to vim-scripts and vim-tips like
> vimonline currently does.  As a bonus, mailing-list posts would also linkable

Easy:http://en.wikipedia.org/wiki/Interwiki#Shorthand_for_non-wiki_sites
For Wikia: http://www.wikia.com/wiki/Interwiki_map

But this touches the critical point: The real question is, howto
organize/access existing contributions (and contribution channels) from
a wiki.

Wikipages are generic, while tips, scripts, plugins, helpfiles etc. have
more structure and - perhaps because of that - an established
infrastructure.

There is nothing against writing new things freely in the wiki and then,
afterwards, copy them to svn or make a script/plugin/syntax-file/tutor
or whatever ... Probably one could also easily write some html-form that
submits a tip/script to the database on vim.org

I would like to see the VimWiki as a kind of portal to the plethora of
vim-related material. (Recall the slogan: Avoid redundancy!)

In such a community-driven portal, each contributor has an interest to
get her contribution found. Thus there is no need for a centralized
management as on vim.org.

A question to the experienced users/developers: How is that plethora
organized internally? What are the main (most important, most popular)
sections? 

Sebastian.



Re: VimWiki - again - but with a brand new option

2007-05-06 Thread Sebastian Menge
Hi all

Independent of the implementation used, I suggest to develop good
guidelines. The Wiki should be really valuable and not redundant to
vim-tips or mailing-lists.

I think it's also important to have some people feeling responsible for
it so if someone doesn't follow the rules, they will tidy it up quickly.

my 2 cents,

Sebastian.

PS: I would clearly prefer wikia.org over sf.net (I would not build up
upon any beta ...)



RE: Reannouncing vimplugin: A vim plugin for Eclipse

2007-04-01 Thread Sebastian Menge
Am Samstag, den 31.03.2007, 20:41 -0400 schrieb David Fishburn:
> > for the UI-integration (simple textbased vim inside eclipse) 
> > you need cygwin.
> 
> Is there separate instructions for how to setup the integrated one?

>From the vimplugin-devel list.

> I have set up an eclipse update site under
> 
> http://vimplugin.sf.net/update
> 
> In your eclipse use 
> 1) "help|updates|find and install"
> 2) "search for new features"
> 3) "new remote site" with the URL given above
> 4) finish. A dialog should popup presenting you the plugin to install.
> 5) restart eclipse.
> 
> The plugin runs equally well under windows with the vim version of
> cygwin. If you are under windows, the plugin tries to use
> "c:/cygwin/bin/vim.exe", but you can specify another path in the
> preference page of the plugin.

To subscribe to that list go to:
http://lists.sourceforge.net/mailman/listinfo/vimplugin-devel

Your experience reports are greatly appreciated...

Thanks, Sebastian.



RE: Reannouncing vimplugin: A vim plugin for Eclipse

2007-03-30 Thread Sebastian Menge
Am Freitag, den 30.03.2007, 12:24 -0400 schrieb David Fishburn:
> The README indicates:
> The only external dependency is a functional gvim compiled with "netbeans" 
> support.
> 
> But your email says:
> > Microsoft users have to use the cygwin version of vim.
> 
> Can you confirm which is required.  Why would the cygwin version of Vim be
> required it is just talks to it over a protocol?
> 
> I have cygwin installed, but I have never actually compiled an actual cygwin
> version of Vim, I just use the standard win32 version which I compile
> myself.

for the UI-integration (simple textbased vim inside eclipse) you need
cygwin.

for the netbeans-prototype you need gvim. It fires up an external gvim
and talks with it via a socket. I havent tested that under windows.

One day i wanna integrate both. bvut at the moment they are mutual
exclusive.

Seb.



Reannouncing vimplugin: A vim plugin for Eclipse

2007-03-30 Thread Sebastian Menge
Hi all 

After a long time of no activity we restarted the work on a small plugin
to embed vim into the Eclipse IDE.

See http://vimplugin.sf.net and http://sf.net/vimplugin for details.

If you are familiar with eclipse, there is an update site
http://vimplugin.sf.net/update with the latest build.

Microsoft users have to use the cygwin version of vim.

We also have a prototype of an eclipse-plugin that talks to a gvim that
acts as "netbeans" server (:help netbeans).

More detailed info on that can be found here: 
http://vimplugin.svn.sourceforge.net/svnroot/vimplugin/branches/vimclient/doc/README

Both projects are standard eclipse projects that can be checked out
anonymously via subversion (you need subclipse then):

http://vimplugin.svn.sourceforge.net/svnroot/vimplugin/trunk/vimplugin
http://vimplugin.svn.sourceforge.net/svnroot/vimplugin/branches/vimclient

This time we'll keep an better eye on community building: So please try
it out and give some feedback. On http://sf.net/projects/vimplugin you
can find forums and of course mailinglists.

Best regards, Sebastian.