Sha256: 1143dc0de040509b7eecb94b464d1f3c9c63a024f5239d1e48b36114ef8ca39a

Contents?: true

Size: 1.24 KB

Versions: 60

Compression:

Stored size: 1.24 KB

Contents

# -*- coding: utf-8 -*-
<% Template.target_binary_version(1.0) -%>

#
# 対象小説情報
# タイトル: <%= @setting["title"] %>
# 作者: <%= @setting["author"] %>
# URL: <%= @setting["toc_url"] %>
#
# 詳細については http://bit.ly/1vTEH04 を参照して下さい
#
converter "<%= file_title.gsub('"', '\"') %>" do
  # 各種変換処理がされる「前」の生データに対しての変換処理を記述
  def before(io, text_type)
    super
    io
  end

  # 各種変換処理がされた「後」のデータに対しての変換処理を記述
  def after(io, text_type)
    super

    # サンプル1:ダブルダッシュで囲まれた部分を太字にする
    # io.string.gsub!(/^( ――.+?――)$/, "[#太字]\\1[#太字終わり]")

    # サンプル2:漢数字化したけど、特定の部分はアラビア数字にしたい場合
    # io.string.gsub!(/([〇一二三四五六七八九]+)メートル/) do |match|
    #   match.tr("〇一二三四五六七八九", "0123456789")
    # end

    # サンプル3:最新話以外の挿絵を削除する
    # if @current_index < @subtitles.size - 1
    #  io.string.gsub!(/[#挿絵(.+?)入る]/, "")
    # end

    io
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
narou-3.7.2 template/converter.rb.erb
narou-3.7.1 template/converter.rb.erb
narou-3.7.0 template/converter.rb.erb
narou-3.6.0 template/converter.rb.erb
narou-3.5.1 template/converter.rb.erb
narou-3.5.0.1 template/converter.rb.erb
narou-3.5.0 template/converter.rb.erb
narou-3.4.8 template/converter.rb.erb
narou-3.4.7.1 template/converter.rb.erb
narou-3.4.7 template/converter.rb.erb
narou-3.4.6.1 template/converter.rb.erb
narou-3.4.6 template/converter.rb.erb
narou-3.4.5 template/converter.rb.erb
narou-3.4.3 template/converter.rb.erb
narou-3.4.2 template/converter.rb.erb
narou-3.4.1 template/converter.rb.erb
narou-3.4.0 template/converter.rb.erb
narou-3.3.2 template/converter.rb.erb
narou-3.3.1 template/converter.rb.erb
narou-3.3.0 template/converter.rb.erb