Sha256: 0f8f66c8e71b4477a41fb2eb8a643925104ac1c13a561cafff17c825a4518c39

Contents?: true

Size: 871 Bytes

Versions: 11

Compression:

Stored size: 871 Bytes

Contents

require "ssmd/version"
require "ssmd/converter"

module SSMD
  module_function

  ##
  # Translates the given SSMD text to SSML.
  #
  # @param ssmd [String] The SSMD markup to be converted to SSML
  # @param skip [Array<Symbol>] Formats (e.g. `:paragraph`, `:prosody`) to skip.
  #
  # @return [String] Resulting SSML
  def to_ssml(ssmd, skip: [])
    Converter.new(ssmd, skip: skip).convert
  end

  ##
  # Returns the given string without any SSMD annotations.
  # For instance for `hello *world*` would return `hello world`.
  #
  # @param ssmd [String] The SSMD markup to strip from SSMD annotations.
  # @param skip [Array<Symbol>] Formats (e.g. `:paragraph`, `:prosody`) to skip.
  #
  # @return [String]
  def strip_ssmd(ssmd, skip: [])
    Converter.new(ssmd, skip: skip).strip
  end

  def root_dir
    Gem::Specification.find_by_name("ssmd").gem_dir
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ssmd-0.7.6 lib/ssmd.rb
ssmd-0.7.5 lib/ssmd.rb
ssmd-0.7.4 lib/ssmd.rb
ssmd-0.7.3 lib/ssmd.rb
ssmd-0.7.2 lib/ssmd.rb
ssmd-0.7.1 lib/ssmd.rb
ssmd-0.7.0 lib/ssmd.rb
ssmd-0.6.1 lib/ssmd.rb
ssmd-0.6.0 lib/ssmd.rb
ssmd-0.5.0 lib/ssmd.rb
ssmd-0.4.0 lib/ssmd.rb