Overpass Experiences

The Eric Wroolie Blog

  • Facebook
  • Google+
  • Linkedin
  • Twitter
  • YouTube
  • Blog
  • Social Activity
  • 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

Recent Posts

  • Preferring to Be Alone
  • How to Kill Someone’s Dreams
  • Are any Puzzle Pieces Missing?
  • Software Development Skills like Currency – And the value is always falling
  • Delegating and Giving up Control

RSS From the Overpass Blog

  • Since Apple Business Manager, Enterprise Apps Are Difficult September 11, 2019
  • Connecting Students Through School Mobile Apps May 14, 2019
  • Can You Make Money with Business Apps? April 5, 2019
  • Is an iPad App Developer the same as an iPhone Developer? February 21, 2019
  • How Apple IOS Developers need to think differently February 13, 2019
  • The Do’s and Don’ts of Enterprise Mobile App Development February 11, 2019
  • Premier mobile app development company expanding its market reach February 1, 2019
  • Overpass Apps is making waves in iOS and Android designs in the UK January 30, 2019
  • Construction Apps From Top UK Construction Companies June 7, 2018
  • Infographic: Top 5 Apps with 1 Billion Downloads June 5, 2018

Tags

Anti-virus Army Days ASP.Net Automation Baseball Beijing BR China Chinglish coding Cornbury CSS DLI Eric Wroolie Family Gym Holiday HTML5 IE6 Line Break Misc. music MVC Framework Nike+ Overpass PNG PowerShell Redcloth Ruby Runkeeper scam Skype Spotify Superpreview Textile Transparency Webby Web Design Web Standards