Class: Jazzy::Doc
- Inherits:
-
Mustache
- Object
- Mustache
- Jazzy::Doc
- Includes:
- Config::Mixin
- Defined in:
- lib/jazzy/doc.rb
Instance Method Summary collapse
- #copyright ⇒ Object
- #docs_title ⇒ Object
- #enable_katex ⇒ Object
- #jazzy_version ⇒ Object
- #language_stub ⇒ Object
- #module_version ⇒ Object
- #objc_first? ⇒ Boolean
Methods included from Config::Mixin
Instance Method Details
#copyright ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jazzy/doc.rb', line 17 def copyright copyright = config.copyright || ( # Fake date is used to keep integration tests consistent date = ENV['JAZZY_FAKE_DATE'] || DateTime.now.strftime('%Y-%m-%d') year = date[0..3] "© #{year} [#{config.}](#{config.}). " \ "All rights reserved. (Last updated: #{date})" ) Markdown.render_copyright(copyright).chomp end |
#docs_title ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/jazzy/doc.rb', line 45 def docs_title if config.title_configured config.title elsif config.version_configured # Fake version for integration tests version = ENV['JAZZY_FAKE_MODULE_VERSION'] || config.version "#{config.module_configs.first.module_name} #{version} Docs" else "#{config.module_configs.first.module_name} Docs" end end |
#enable_katex ⇒ Object
57 58 59 |
# File 'lib/jazzy/doc.rb', line 57 def enable_katex Markdown.has_math end |
#jazzy_version ⇒ Object
28 29 30 31 |
# File 'lib/jazzy/doc.rb', line 28 def jazzy_version # Fake version is used to keep integration tests consistent ENV['JAZZY_FAKE_VERSION'] || Jazzy::VERSION end |
#language_stub ⇒ Object
37 38 39 |
# File 'lib/jazzy/doc.rb', line 37 def language_stub objc_first? ? 'objc' : 'swift' end |
#module_version ⇒ Object
41 42 43 |
# File 'lib/jazzy/doc.rb', line 41 def module_version config.version_configured ? config.version : nil end |
#objc_first? ⇒ Boolean
33 34 35 |
# File 'lib/jazzy/doc.rb', line 33 def objc_first? config.objc_mode && config.hide_declarations != 'objc' end |