Fixed a CSS problem regarding <pre> elements. Made Zita look better.

This commit is contained in:
Niels Serup 2011-11-11 16:51:28 +01:00
parent 873e5fc8d9
commit 50e7e08a1b
3 changed files with 24 additions and 16 deletions

View File

@ -169,7 +169,6 @@ tt, code, samp, pre, var {
pre { pre {
margin-top: 10px; margin-top: 10px;
white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
} }
@ -420,6 +419,10 @@ div.left-float, img.left-float, video.left-float, audio.left-float {
padding: 2px 4px; padding: 2px 4px;
} }
.highlight span {
white-space: pre;
}
.highlighttable { .highlighttable {
margin: 5px 0 5px 0; margin: 5px 0 5px 0;
} }

View File

@ -106,3 +106,8 @@ ul#menulinks {
.highlighttable .code { .highlighttable .code {
width: 600px; width: 600px;
} }
pre {
max-width: 660px;
overflow: auto;
}

View File

@ -83,8 +83,8 @@ Python code in the main file is executed before Zita starts a game. This means
that the main file is suitable to use to print a welcome message, though this that the main file is suitable to use to print a welcome message, though this
is of course also possible to do in the 'prerun' file.<br /> What should be is of course also possible to do in the 'prerun' file.<br /> What should be
done in the main file and not in the 'prerun' file is including files. The done in the main file and not in the 'prerun' file is including files. The
<span class='code'>include</span> function loads and executes both files and =include= function loads and executes both files and files in
files in subdirectories. In the above example, only files are imported, as no subdirectories. In the above example, only files are imported, as no
subdirectories exist. If, however, such directories did exist, the include subdirectories exist. If, however, such directories did exist, the include
command would look for those too. command would look for those too.
@ -98,9 +98,9 @@ We have a game directory with a file named 'stuff' and a directory named
This makes Zita load and execute both the 'stuff' file and the files in the This makes Zita load and execute both the 'stuff' file and the files in the
'stuff' folder. 'stuff' folder.
It is possible to make the <span class='code'>include</span> function accept It is possible to make the =include= function accept only either one file, all
only either one file, all files or files in subdirectories. Refer to the files or files in subdirectories. Refer to the =include= and =getfilenames=
=include= and =getfilenames= functions found in defs.py. functions found in defs.py.
When Zita has succesfully loaded all data that it needs to run a game When Zita has succesfully loaded all data that it needs to run a game
succesfully, it is important to use the =goto= function to create a starting succesfully, it is important to use the =goto= function to create a starting
@ -287,7 +287,7 @@ among other stuff, this (commented version):
#+BEGIN_SRC python2 #+BEGIN_SRC python2
var = { var = {
# 'imposs' does not have to exist, though Zeqy needs it in the <span class='code'>default</span> # 'imposs' does not have to exist, though Zeqy needs it in the default
# variable. # variable.
'imposs': ['That\'s not an option.', 'I am unable to accomplish that \ 'imposs': ['That\'s not an option.', 'I am unable to accomplish that \
particular feat.', 'That seems out of the question.', 'Are you stupid?', 'I \ particular feat.', 'That seems out of the question.', 'Are you stupid?', 'I \
@ -301,12 +301,12 @@ could try, but I don\'t want to.', 'I\'m not doing that!', 'No way.'],
# > eat python # > eat python
# Which python? # Which python?
# <span class='b'>a</span>. dangerous python # a. dangerous python
# <span class='b'>b</span>. Monty Python # b. Monty Python
# 'which' MUST exist. It holds what to output when multiple items are # 'which' MUST exist. It holds what to output when multiple items are
# available. The variable <span class='code'>what</span> holds the current # available. The variable what holds the current
# object specified by the user. In the above example, <span class='code'>what</span> would be python. # object specified by the user. In the above example, what would be python.
'which': "'Which ' + what + '?'", 'which': "'Which ' + what + '?'",
# 'invalidwhich' MUST exist. The value of this variable is output when # 'invalidwhich' MUST exist. The value of this variable is output when
@ -326,7 +326,7 @@ could try, but I don\'t want to.', 'I\'m not doing that!', 'No way.'],
'inventory': [], 'inventory': [],
# 'location' MUST exist, though it isn't completely necessary to have it # 'location' MUST exist, though it isn't completely necessary to have it
# defined here. Mostly, writing a <span class='code'>goto</span> function in the main file is better # defined here. Mostly, writing a goto function in the main file is better
# than defining the room here. Defining the room here means that the user # than defining the room here. Defining the room here means that the user
# will not see a startup message describing the current location. # will not see a startup message describing the current location.
'location': None, 'location': None,
@ -368,7 +368,7 @@ else:
if rname[0] == '!': if rname[0] == '!':
exec(rname[1:]) # Only execute what's after the exclamation mark. exec(rname[1:]) # Only execute what's after the exclamation mark.
else: else:
goto(rname) # Use the <span class='code'>goto</span> function goto(rname) # Use the goto function
elif '&rest' in room[var['location']]['dir']: # Default action elif '&rest' in room[var['location']]['dir']: # Default action
rname = room[var['location']]['dir']['&rest'] rname = room[var['location']]['dir']['&rest']
if rname[0] == '!': if rname[0] == '!':
@ -415,7 +415,7 @@ default = {
'item': { # Default values for items 'item': { # Default values for items
'cmd': { # Either 'a', 'an', 'some', etc. 'cmd': { # Either 'a', 'an', 'some', etc.
'look': "p('It\\'s ' + getprefix(citem) + ' ' + item[citem]['name'] + 'look': "p('It\\'s ' + getprefix(citem) + ' ' + item[citem]['name'] +
'.')", # The <span class='code'>exec_proper_command</span> function will find the correct place to look '.')", # The exec_proper_command function will find the correct place to look
# for a command. A hierachy is defined in Zeqy's defs.py. # for a command. A hierachy is defined in Zeqy's defs.py.
'lookat': "exec_proper_command('look', i, i_or_o, citem)", 'lookat': "exec_proper_command('look', i, i_or_o, citem)",
@ -437,8 +437,8 @@ inv(citem) # Adds item to inventory
}, },
# 'item-substitutes' MUST exist. It is used as a reference to a previous item. # 'item-substitutes' MUST exist. It is used as a reference to a previous item.
# This specific property could just as well have been placed in the <span class='code'>var</span> # This specific property could just as well have been placed in the var
# variable, but for now it must be in <span class='code'>default</span>. # variable, but for now it must be in default.
'item-substitutes': ['it'], 'item-substitutes': ['it'],
# Zita will print a random messages of the list when there is no command match. # Zita will print a random messages of the list when there is no command match.