Convert RDoc markup to HTML
If you want to convert a README.rdoc
file to HTML, say this from a shell:
rdoc README.rdoc
You will find the generated HTML in doc/index.html
.
If you do this while working on
one of our gems
Show archive.org snapshot
, please .gitignore
everything in doc
and don't commit the generated HTML.
Related cards:
htmlBurger PSD to HTML ยป Home - Convert your Design into Standards compliant XHTML/CSS
We simply convert your design (PSD, PNG, AI, etc.) into a hand coded, pixel perfect and Standards compliant XHTML/CSS. Since our service is targeted to agencies and freelancers the job done by us is 100% confidential. In addition we are offering p...
Semantic markup standard for search engines
If you would like to enrich your website with semantic markup like contact data, places or events you should have a look at schema.org. "Search engines including Bing, Google and Yahoo! rely on this markup to improve the disp...
Ruby: How to convert hex color codes to rgb or rgba
When you have a hex color code, you can easily convert it into its RGB values using plain Ruby.
>> "#ff8000".match(/^#(..)(..)(..)$/).captures.map(&:hex)
=> [255, 128, 0]
You can use that to implement a simple "hex to CSS rgba value ...
Sass: How to convert an RGBA color to its RGB look-alike
Say you have an RGBA color that you need as a non-transparent color because of reasons.
Basically, this is possible. Just understand that you will convert your RGBA color for exactly one base background color as you are giving up transparency.
...
Convert Haml to ERB
This is about converting Haml to ERB and not the other way round which you probably want!
This process can not be automated 100%, but you can still save time.
First do
script/plugin install http://github.com/cgoddard/haml2erb.git
Then in...
How to use Parallel to speed up building the same html partial multiple times (for different data)
The parallel-gem is quite easy to use and can speed up rendering time if you want to render the same partial multiple times (e.g. for rendering long lists of things).
If your parallelized code talks to the da...
How to define a custom context menu within HTML (Firefox 8+)
Since Firefox 8 it is possible to define custom context menus (right clicking) with HTML markup.
Use Nokogiri to convert CSS to XPath
CSS is a lot easier to write and read than clumsy XPath expressions. So when you need to use XPath, you can have Nokogiri help you out on creating it.
Simply use Nokogiri's xpath_for
:
Nokogiri::CSS.xpath_for('#foo')
# => ["//*[@id = 'fo...
How to convert an OpenStruct to a Hash
Simply use OpenStruct#to_h
to receive an OpenStruct's hash representation.
In older Rubies you need OpenStruct#marshal_dump
instead.
Ruby 2.0+
>> OpenStruct.new(foo: 23, bar: 42).to_h
=> { :foo => 23, :bar => 42 }
Ruby 1.9....
Always convert and strip user-provided images to sRGB
Debugging image color profiles is hard. You can't trust your eyes in this matter, as the image rendering depends on multiple factors. At least the operation system, browser or image viewer software and monitor influence the resulting image colors ...