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

#default_theme_directoryPathname

Returns:

  • (Pathname)


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

def default_theme_directory
  path.join(DEFAULT_THEME_DIRECTORY_SUBPATH)
end

#theme_directoryPathname

Returns:

  • (Pathname)


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

def theme_directory
  theme_directory_by_configuration || default_theme_directory
end

#theme_directory_by_configurationPathname

Returns:

  • (Pathname)


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

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)


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

def theme_stylesheet_path
  theme_directory.join(THEME_STYLESHEET_BASENAME)
end