From 50e7e08a1b2b8b39ecba4a152264399f22778b94 Mon Sep 17 00:00:00 2001 From: Niels Serup Date: Fri, 11 Nov 2011 16:51:28 +0100 Subject: [PATCH] Fixed a CSS problem regarding
 elements. Made Zita look
 better.

---
 prestatic/general.css        |  5 ++++-
 prestatic/screen.css         |  5 +++++
 site/projects/zita/index.org | 30 +++++++++++++++---------------
 3 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/prestatic/general.css b/prestatic/general.css
index 4b1ef32..f2166d3 100644
--- a/prestatic/general.css
+++ b/prestatic/general.css
@@ -169,7 +169,6 @@ tt, code, samp, pre, var {
 
 pre {
     margin-top: 10px;
-    white-space: pre-wrap;
     word-wrap: break-word;
 }
 
@@ -420,6 +419,10 @@ div.left-float, img.left-float, video.left-float, audio.left-float  {
     padding: 2px 4px;
 }
 
+.highlight span {
+    white-space: pre;
+}
+
 .highlighttable {
     margin: 5px 0 5px 0;
 }
diff --git a/prestatic/screen.css b/prestatic/screen.css
index 80eb8ae..29a5b4d 100644
--- a/prestatic/screen.css
+++ b/prestatic/screen.css
@@ -106,3 +106,8 @@ ul#menulinks {
 .highlighttable .code {
     width: 600px;
 }
+
+pre {
+    max-width: 660px;
+    overflow: auto;
+}
diff --git a/site/projects/zita/index.org b/site/projects/zita/index.org
index 6d67e64..4d91654 100644
--- a/site/projects/zita/index.org
+++ b/site/projects/zita/index.org
@@ -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
 is of course also possible to do in the 'prerun' file.
What should be done in the main file and not in the 'prerun' file is including files. The -include function loads and executes both files and -files in subdirectories. In the above example, only files are imported, as no +=include= function loads and executes both files and files in +subdirectories. In the above example, only files are imported, as no subdirectories exist. If, however, such directories did exist, the include 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 'stuff' folder. -It is possible to make the include function accept -only either one file, all files or files in subdirectories. Refer to the -=include= and =getfilenames= functions found in defs.py. +It is possible to make the =include= function accept only either one file, all +files or files in subdirectories. Refer to the =include= and =getfilenames= +functions found in defs.py. 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 @@ -287,7 +287,7 @@ among other stuff, this (commented version): #+BEGIN_SRC python2 var = { - # 'imposs' does not have to exist, though Zeqy needs it in the default + # 'imposs' does not have to exist, though Zeqy needs it in the default # variable. 'imposs': ['That\'s not an option.', 'I am unable to accomplish that \ 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 # Which python? - # a. dangerous python - # b. Monty Python + # a. dangerous python + # b. Monty Python # 'which' MUST exist. It holds what to output when multiple items are - # available. The variable what holds the current - # object specified by the user. In the above example, what would be python. + # available. The variable what holds the current + # object specified by the user. In the above example, what would be python. 'which': "'Which ' + what + '?'", # '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': [], # 'location' MUST exist, though it isn't completely necessary to have it - # defined here. Mostly, writing a goto 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 # will not see a startup message describing the current location. 'location': None, @@ -368,7 +368,7 @@ else: if rname[0] == '!': exec(rname[1:]) # Only execute what's after the exclamation mark. else: - goto(rname) # Use the goto function + goto(rname) # Use the goto function elif '&rest' in room[var['location']]['dir']: # Default action rname = room[var['location']]['dir']['&rest'] if rname[0] == '!': @@ -415,7 +415,7 @@ default = { 'item': { # Default values for items 'cmd': { # Either 'a', 'an', 'some', etc. 'look': "p('It\\'s ' + getprefix(citem) + ' ' + item[citem]['name'] + -'.')", # The exec_proper_command 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. '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. -# This specific property could just as well have been placed in the var -# variable, but for now it must be in default. +# This specific property could just as well have been placed in the var +# variable, but for now it must be in default. 'item-substitutes': ['it'], # Zita will print a random messages of the list when there is no command match.