--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi!
I think it makes sense to have a handy abbreviation for 'Learn to
Program'. L2P seems appropriate.
* Chris Pine:
You need Apache set up to allow you to execute *.rbx files.
I'm using thttpd. It runs anything that is marked world executable
and matches a CGI-specifying regexp. Cute feature :->
BTW: I would love to see that someone explains to me how to make
index.rbx a default start page for thttpd. I presently use this as a
workaround:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><meta content="0;url=/index.rbx" http-equiv="refresh"></head>
<body><a href="index.rbx">go ahead...</a></body>
</html>
This issue does not have high priority because the above works good
enough and the intended target system is running Apache.
Let's come to the BUTs. It seems as if there are some preliminaries
before actually starting translation.
Or, looking at my code, is there something I could do to make
translation easier?
The first issue is not so much a translation but a portability one.
You are using absolute URLs to refer to different parts of the
tutorial. This requires changes to the source as soon as the tutorial
is located elsewhere (due to whatever reason). A better solution is
using
LINKFILE = "./index.rbx"
LINKPATH = File.basename(LINKFILE)
And modifying the links appropiately (diff is attached).
Next issue is encoding. As far as I can see you only use iso-646-us
so it seems to be a good idea to change
<?xml version="1.0" encoding="UTF-8"?>
into
<?xml version="1.0" encoding="us-ascii"?>
and adding
meta('http-equiv' =>'content-type',
:content=>'text/html; charset=us-ascii')
to the source. That better shows what to replace by the charset that
is actually used (be it utf-8, iso-8859-15, iso-2022-jp-2, or
koi8-r). utf-8 is too generic to decide wether it is a formal
requirement or an actual charset.
Line length:
1. Normal text: Consider keeping it below 80 chars a line whenever
possible (vim: 'set tw=79') - my fetish is called 'console'
2. Source: Keep it below 70 characters a line. A number of browsers
have default setups that require scrolling when code lines are
longer than this.
On colors used: I am not sure if that still poses a problem but the
ones used are mostly not Web safe. Web save colors have 00, 33, 66,
99, CC, FF as their constituents. Netscape optimized GIFs use these
colors (you perhaps did see the number 216 - that's 6 to the third).
Comment on diff:
'../L2P/Learning-To-Program-2004-02-29-22:12:13' is the snapshot
taken (obvious date and time). 'index.rbx' is the updated version I
will use as a basis for translation.
Now switching to translation mode until the empire of technical
problems strike back.
Josef 'Jupp' SCHUGT
--
E-Mail: .--- ..- .--. .--. .--.-. --. -- -..- .-.-.- -.. .
http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby FAQ
http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge
--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Description: SuggestedChanges.diff
Content-Disposition: attachment; filename=difflog
--- ../L2P/Learning-To-Program-2004-02-29-22:12:13 Sun Feb 29 23:11:11 2004
+++ index.rbx Mon Mar 1 15:43:01 2004
@@ -13,7 +13,8 @@
require 'stringio'
-LINKADDR = "//pine.fm/LearnToProgram/" # was ENV['REDIRECT_URL']
+LINKFILE = "./index.rbx"
+LINKPATH = File.basename(LINKFILE)
class TutorialWebPage
@@ -77,7 +78,7 @@
def selfLink (chap = nil)
# REQUEST_URI includes "?Chapter=Foo"
- LINKADDR+'?Chapter='+(chap ? getChapter(chap) : '')
+ LINKFILE+'?Chapter='+(chap ? getChapter(chap) : '')
end
def makeLink (name, methodName)
@@ -490,8 +491,8 @@
END_PARAGRAPH
end
ul do
- li {'<a href="'+LINKADDR+'SciTEGlobal.properties">Global Properties</a>'}
- li {'<a href="'+LINKADDR+'ruby.properties">Ruby Properties</a>'}
+ li {'<a href="'+LINKPATH+'SciTEGlobal.properties">Global Properties</a>'}
+ li {'<a href="'+LINKPATH+'ruby.properties">Ruby Properties</a>'}
end
para do <<-END_PARAGRAPH
It would also be a good idea to create a folder somewhere to keep
@@ -4648,7 +4649,7 @@
end
para do <<-END_PARAGRAPH
The pages you see (all valid XHTML 1.1) are generated by
- <a href="#{LINKADDR}?ShowTutorialCode=true">this Ruby program</a>.
+ <a href="#{LINKFILE}?ShowTutorialCode=true">this Ruby program</a>.
It may not be the prettiest code around, but
it has some neat features. For example, all of the
code samples are actually being run every time you view
@@ -4757,11 +4758,12 @@
tocString = 'Table of Contents'
tutTitle = 'Learn to Program'
- puts '<?xml version="1.0" encoding="UTF-8"?>'
+ puts '<?xml version="1.0" encoding="us-ascii"?>'
puts '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
html

xmlns=>'
http://www.w3.org/1999/xhtml', 'xml:lang'=>'en') do
head do
- link

rel=>'stylesheet', :type=>'text/css', :href=>LINKADDR+'tutorial.css')
+ link

rel=>'stylesheet', :type=>'text/css', :href=>LINKPATH+'tutorial.css')
+ meta('http-equiv' =>'content-type', :content=>'text/html; charset=us-ascii')
title do
tutTitle + ', by Chris Pine'
end
--/9DWx/yDrRhgMJTb--