The Eric Wroolie Blog

Overpass Experiences

  • Blog
  • Videos
  • Overpass Apps

Powered by Overpass Apps

Line Breaks in Webby

September 18, 2009 by wroolie 2 Comments

For the past few weeks, I’ve been using a tool called Webby for static html pages.  Webby is a Ruby-based tool which produces static html pages based on templates you create.  Think of it as using master pages in ASP.Net, except that the final product is files with a .html extension instead of .aspx (and you don’t get the asp.net processor kicking in each time this static page is called).

It’s a great tool, because most of my sites need to have a consistent look and feel.  I don’t want to copy html from one file to another and I can use a master page-like concept.  And it gives me the chance to toy around with Ruby a little bit (but not much).

In Webby, you create a layout page and the other pages as .txt files with html.  Run the command “webby autobuild” in a command window and each time you make a change to any of the files, it will create a folder called output with all of your processed html pages.

A problem I did have with the tool is that it was adding <br /> tags into my html where the line breaks where in my files.  I absolutely hate it when something tries to inject html into my code.  This is why I didn’t use Frontpage and won’t use tools like Dreamweaver.  I know html is a lost art but . . .

So, in my files, I would type

<p>I would type a paragraph that might be
lengthy, so I use multiple lines in the code
but don't expect the browser to interpret these.
I just want it to look for the tags.</p>

What I got back in return was

<p>I would type a paragraph that might be <br />
lengthy, so I use multiple lines in the code<br />
but don't expect the browser to interpret these.<br />
I just want it to look for the tags.</p><br />

It took me a few hours to figure out why this was happening (I couldn’t find anything on Google with a “BR tags in Webby” search).

The problem is not with Webby, but with a tool called RedCloth, which Webby uses.  Redcloth does the html processing with something called Textile.  This is not a problem, but a feature in Redcloth from very 4 onwards.

After searching for hours (and contemplating whether to just transfer everything to aspx pages), I found that Webby was automatically adding a “- textile” filter to all of the pages:

---
title:      <%= title %>
created_at: <%= Time.now.to_y %>
filter:
  - erb
  - textile
---

The simple solution, was the remove the textfile flag from all pages.  Remove the flag from the “templates/page.erb” file in the project and you should remove it from all pages in the project.  Then you are master of all your html, my son.

I hope this

Filed Under: Software Dev & Productivity Tagged With: BR, Line Break, Redcloth, Ruby, Textile, Webby

Slip and fall down carefully

September 7, 2009 by wroolie 4 Comments

20090828_8

One of the things I’ve heard about China before arriving was that the English translations I would see on signs and literature might not be the best use of English.  While in Beijing, we saw lots of examples of signs that were just funny.  In the pool area of our hotel is a sign that says “Slip and fall down carefully”.

While at the Beijing Amusement Park, most of the rides included Alcoholism as one of the symptoms you might have to prevent you from going on a ride (“You must not ride this if you suffer from Heart problems, pregnancy, or alcoholism.”  I kept imagining recovering alcoholics staying off these rides in case they caused a relapse.

Most of the Westerners we saw in Beijing were not English speakers (or at least not as a first language).  We heard people speaking Russian, French, and Swedish . . . but all the signs that were translated, were shown in Chinese and English.  My son pointed out to me, when he saw a sign that said to turn off you cell phone instead of mobile phone, that they were specifically translated into American English.

Beijing 239Some of the signs were okay, but so many were either vague (a sign along a river bank says “Please away from the water”) or complicated (the instructions for how to pay for food in the Food Republic food court at the APM shopping centre on Wanfujing street is impossible to read).  Some are intentionally cute and funny, like a sign in the Olympic village that says “The Grass is smiling at you”.

This is often referred to as Chinglish.  The BBC ran story while we were still over there with several other photos of strange Chinglish signs.  The story is here.

Outside the Forbidden City (on the East Gate) is a set of posh toilets.  (The only reason I call them posh is because it costs 1 yuan –about 10p– to use them.  The sign above the doors in Chinese says that it’s the room for men to urinate in.  But, here greeting you as you enter one of China’s most revered treasures, is my favourite sign of all:

Beijing 405 Beijing 404

The kids love saying it, now.

Filed Under: China Tagged With: Beijing, China, Chinglish

Scaffolding in Tiananmen Square

September 3, 2009 by wroolie 8 Comments

Of all the pictures I was going to take in Beijing, I was most looking forward to the one of me standing in front of the Mao portrait at Tiananmen Square. Everyone gets that picture.  I’ve seen it in books so often—with it’s bold Chinese characters on the read wall behind.  This picture was going to be even better than one standing on the Great Wall.Beijing 149

Well, wouldn’t you know it?  The entire time we were in Beijing (two whole weeks!), several of the monuments in Tiananmen were covered in scaffolding.  In this picture on the right, you can’t even see the “Peoples Republic of China” characters because they are behind green scaffolding.

I kind of felt like Chevy Chase in National Lampoon’s Vacation when he drives cross country to Wally’s World to find out that it’s closed.  I wonder what tourists to New York thought in the eighties when the Statue of Liberty was in scaffolding for months while they refurbished it for the 1986 anniversary. Beijing 109

The 60th Anniversary of the PRC is taking place next month, so they must be getting ready for that.  Even the Monument to the People’s Heroes in the square was covered in scaffolding.

It wasn’t too bad at night, you could still see the characters when they were illuminated.

Despite all the maintenance, the square was packed every day we went (we found ourselves back at the square about 4 times in total).

I mentioned in the earlier post that I was surprised by the number of Chinese tourists.  For some reason, I expected all the tourists to be from the west.  But most of the tourists were from around China making a once in a lifetime trip to see their capital.  It’s no different than the tourists in the States who make the cross-country trip to Washington DC.  I’ve been living in England so long I forgot what is was like being in a big country.  In fact, the Chinese tourists had more reason to be visiting than I did, I guess.  They weren’t put off by the maintenance work at all.Beijing 370

Another site that was closed was the Science and Technology Museum.  We took a taxi across town the visit the museum, but when we arrived (and our taxi left), we found that it was closed for a month for renovations.  There were several ‘unofficial’ taxi drivers swarming around like vultures in the front of the museum trying to get us to take their taxis to another site like the Beijing Aquarium.  We stood there, not sure what to do—but I was sure I didn’t want to watch fish at an aquarium.  I noticed a man with a young boy who seemed to have made the same mistake we did and was trying to decide where to go next.  He was being hounded by the drivers just like us.  I walked over to the man and asked him where he was going next.  He seemed surprised that I was trying to talk to him in Chinese—but I was obviously not a driver and not trying to sell him anything.  He told me that they were going to find the underground train and go to the Military Museum.  I asked if we could follow them.  We had only been taking taxis until then, so it sounded fun.  The drivers were annoyed, but we all walked off.

We walked with this man’s family (himself, his wife, and their son) and another family they were friends with for about a mile and a half to the underground station.  They were visiting from Inner Mongolia.  We talked about school out there and they were very interested in our 3 children.  They didn’t speak any English—but they told me their son was learning English in school (he didn’t want to show me what he knew).

There were two boys in their group.  I asked if they were brothers.  One boy’s mother told me that they couldn’t be brothers because China has too many people.  They could only have one child.  I knew this, of course, so I felt a little stupid.  Then I asked if they were cousins.  No, she told me, they are not cousins but only friends.  The one child rule came in in 1979.  I realised that China would not have siblings, but I never considered that this would one day mean no cousins, no uncles, no aunts . .

It took us ages getting to the subway station—the other Dad, being a tourist too, really had no idea where the station was but shared my keen sense of direction.  We stopped and asked a lot of passers-by for directions.

The subway train we rode was very crowded.  The Beijing subway at 2pm was like the Central Line at 5pm.  It took a couple of hours, but when we finally arrived at the Military Museum . . . it was closed.  It was Monday, and the museum is always closed on Monday.  But I didn’t mind.  This was the only real time we were able to have a lengthy conversation with a Chinese family.  If the Science Museum had been open, we wouldn’t have been able meet them at all.

It was a great experience.

Filed Under: China Tagged With: Beijing, China

  • « Previous Page
  • 1
  • …
  • 39
  • 40
  • 41
  • 42
  • 43
  • …
  • 111
  • Next Page »

Recent Posts

  • My Gig and the Imposter Syndrome
  • Getting Picked Last for Teams in PE
  • One Little Growth Opportunity at a Time
  • I’m sorry if I look like I know what I’m doing
  • New Years Reclamations