01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#!/usr/bin/env ruby
lines = ARGF.readlines.map{|e| e.chomp }
label = lines.shift
lines.each_with_index do |l, i|
val = l.downcase.gsub( /[^\w ]/, " " ).gsub( /\s+/, " " ).strip
puts %Q[<input type="radio" name="#{ label }" value="#{ val }" id="#{ label }#{ i }"><label for="#{ label }#{ i }">#{ l }</label><br>]
end
ebooks_use
Yes
No
<input type="radio" name="ebooks_use" value="yes" id="ebooks_use0"><label for="ebooks_use0">Yes</label><br>
<input type="radio" name="ebooks_use" value="no" id="ebooks_use1"><label for="ebooks_use1">No</label><br>