Sha256: a82e2caf30d562146476e01d109b2f59cc39ee5a1b8a527506db41c24c3196ea
Contents?: true
Size: 697 Bytes
Versions: 35
Compression:
Stored size: 697 Bytes
Contents
# encoding: utf-8 require 'active_support/core_ext/object/inclusion' require 'open_classes/string/heading_helper' class String include HeadingHelper # Hatena HATENA = '*' # create heading string with Emmet-like syntax. # # ==== Examples # # > case # # 'hoge>hige'.to_hatena_heading # => '*hoge\n**hige' # # + case # # 'hoge+hige'.to_hatena_heading # => '*hoge\n*hige' # # ^ case # # 'hoge>hige^hege'.to_hatena_heading # => '*hoge\n**hige\n*hege' # def to_hatena_heading heading = to_heading to_hatena heading end private def to_hatena(heading) to_head(heading, HATENA, start_level: 1) end end
Version data entries
35 entries across 35 versions & 1 rubygems