Difference between revisions of "User:Jayt"

From NetHackWiki
Jump to navigation Jump to search
(uploaded source wikification script)
m (Source wikification script)
Line 5: Line 5:
  
 
<pre>
 
<pre>
 +
 
#!/usr/bin/python
 
#!/usr/bin/python
 
import sys
 
import sys
Line 22: Line 23:
  
 
print '</div>'
 
print '</div>'
 +
 
</pre>
 
</pre>
 +
 +
--[[User:Jayt|Jayt]] 18:39, 12 June 2006 (UTC)

Revision as of 18:39, 12 June 2006

Hi fellow Hackers! Now that this wiki has some proper admins, I feel better about spending time contributing to it (before, we had spam attacks and couldn't do anything about them). Hopefully this will develop into a solid resource for dungeoneers the world over! --Jayt 23:24, 4 June 2006 (UTC)


Here are my thoughts on completeness

Source wikification script


#!/usr/bin/python
import sys
f = open(sys.argv[1])
i=1
print 'Below is the full text to src/' + sys.argv[1] + ' from NetHack \
3.4.3. To link to a particular line, write [[' + sys.argv[1] + \
'#line123|[[' + sys.argv[1] + '#line123]]]], for example.'
print '<div style="font-family:monospace">\n'

lines = f.readlines()

for line in lines:
        print '<span id="line' + str(i) + '" style="white-space:pre">' \
+ (str(i) + '.').ljust(6)+line.rstrip("\n")+'</span>\n<br/>'
        i += 1

print '</div>'

--Jayt 18:39, 12 June 2006 (UTC)