Module: Avm::EacAsciidoctorBase0::Sources::Base::Theme

Defined in:
lib/avm/eac_asciidoctor_base0/sources/base/theme.rb

Constant Summary collapse

CONFIGURATION_THEME_KEY =
'theme'
DEFAULT_THEME_DIRECTORY_SUBPATH =
'theme'
THEME_STYLESHEET_BASENAME =
'main.css'

Instance Method Summary collapse

Instance Method Details

#copy_theme_directory_to(target_directory_path) ⇒ Object

Parameters:

  • target_directory_path (Pathname)


16
17
18
19
# File 'lib/avm/eac_asciidoctor_base0/sources/base/theme.rb', line 16

def copy_theme_directory_to(target_directory_path)
  target_directory_path.parent.mkpath
  ::FileUtils.copy_entry(theme_directory, target_directory_path)
end

#default_theme_directoryPathname

Returns:

  • (Pathname)


22
23
24
# File 'lib/avm/eac_asciidoctor_base0/sources/base/theme.rb', line 22

def default_theme_directory
  path.join(DEFAULT_THEME_DIRECTORY_SUBPATH)
end

#theme_directoryPathname

Returns:

  • (Pathname)


27
28
29
# File 'lib/avm/eac_asciidoctor_base0/sources/base/theme.rb', line 27

def theme_directory
  theme_directory_by_configuration || default_theme_directory
end

#theme_directory_by_configurationPathname

Returns:

  • (Pathname)


32
33
34
35
36
# File 'lib/avm/eac_asciidoctor_base0/sources/base/theme.rb', line 32

def theme_directory_by_configuration
  configuration_entry(CONFIGURATION_THEME_KEY).value.if_present do |v|
    v.to_pathname.expand_path(path)
  end
end

#theme_stylesheet_pathPathname

Returns:

  • (Pathname)


39
40
41
# File 'lib/avm/eac_asciidoctor_base0/sources/base/theme.rb', line 39

def theme_stylesheet_path
  theme_directory.join(THEME_STYLESHEET_BASENAME)
end