I’ve put up a new version of gem markdown_helper.
Now, by default, the output markdown has added comments that show:
* The path to the template file.
* The path to each included file.
* The image description (original) for each resolved image file path.
You can suppress those comments using the
I have updated the markdown_helper gem.
- File inclusion
- mage path resolution (new)
The image path resolution replaces relative image paths with absolute image URLs.
- This matters because in the documentation for a gem (on RubyDoc.info), YARD formatting changes some file structures, which breaks relative links to images.
- The resolution to absolute URLs avoids that breakage.
The markdown_helper gem I’ve put up does (so far) one thing:
I have in mind two additional features:
- Support for relative links for images (see below for why this matters).
- Support slideshow-style markdown pages (pages linked by next/prev navigation links).
Query: What else would be useful?
About relative links for images: they work fine in GitHub markdown, but when the project is formed into a gem, the links are broken in the gem’s documentation. That’s because on RubyDoc.info, YARD has rearranged some files and folders.
The workaround is to substitute absolute links to the files in
raw.githubusercontent.com. This would be very inconvenient, not to say tedious and possibly error-prone.
What I want to add to the helper is a method that replaces the relative links with absolute ones automatically. That way, we have the convenience of relative links on GitHub, and correct (absolute) links on RubyDoc.
My first Ruby gem on RubyGems.org, markdown_helper just passed one thousand downloads.
But I can’t get puffed up — the most popular gem, bundler has been downloaded 224 *million* times.
GitHub users have for years been asking for include files in GitHub markdown pages.
I’ve just put up a new Ruby gem, markdown_helper, that implements include files.
A file can be included as:
- Highlighted code block.
- Plain code block.
- Verbatim text.
The gem has an API and a CLI. (For the very young, CLI == command-line interface.)
I have made public my GitHub repository MarkdownHelper.
The first feature is file inclusion for GitHub markdown, supporting included text as:
* Highlighted code block.
* Plain code block.
* Verbatim text.
I have no idea how many times I’ve typed code like this (to do printf-style debugging):
my_hash.each_pair do |key, value|
p [key, value]
I’ve finally wised up, and built a helper method to support this:
The method allows any data, and specifically supports Hash-like and Array-like structures.
It also allows an optional name (defaults to data class-name) and message.
a => 0
b => 1
c => 2
And here’s my helper class:
# Class to help in 'printf' debugging.
def self.printf(data, name = data.class.to_s, description = '')
size = data.respond_to?(:size) ? data.size : 1
puts format('%s (size=%d) %s', name, size, description)
data.each_pair do |k, v|
puts format(' %s => %s', k, v)
# Array-like or Set-like.
data.each_with_index do |v, i|
puts format(' %6d: %s', i, v)
puts format(' %s', data.inspect)
“Test Automation Professional / Zealot” is the title I have in my resume.
But I’m not a tester, and still less a “quality” engineer.
Then what am I?
To borrow from mountain-climbing vocabulary, I’m not a climber, I’m a sherpa — one who does much of the heavy lifting, creates base camps, and keeps the climbers progressing happily and safely.
In that spirit, I aim to make it possible for others to do automated testing easily and reliably.
For a year now I’ve worked on my GitHub project, RubyTest, which embodies what I’ve learned in long years of building test automation.
- Core (application-independent) support:
- Base classes
- Helper classes
- Unit testing for the core (of course!).
- Example domain-specific code:
- Page objects, for web UI testing.
- Endpoint objects, for TEST API testing.
- Data objects, for both types of testing.
- Example domain-specific tests.
Most recently, I’ve been building a Tester Tour of part of the project — the part that demonstrates testing for a REST API and a web UI. (The demo test targets are GitHub’s own REST API and web UI.)
You can see the tour here.
Any feedback appreciated, either as Issues on GH, comments here, or private email.