Module: Docbook::Elements::Titled
- Included in:
- Acknowledgements, Appendix, Article, Bibliography, Bibliolist, Bibliomixed, BlockQuote, Book, CalloutList, Caution, Chapter, Colophon, Danger, Dedication, Equation, Example, Figure, FormalPara, GlossEntry, Glossary, Important, Index, IndexDiv, Info, LegalNotice, Note, Part, Preface, Procedure, QandASet, RefEntry, RefSect1, RefSect2, RefSect3, RefSection, Reference, Sect1, Sect2, Sect3, Sect4, Sect5, Section, Set, SetIndex, SideBar, Simplesect, Step, Table, Tip, Toc, TocDiv, Topic, Warning
- Defined in:
- lib/docbook/elements/concerns/titled.rb
Overview
Elements that have a displayable title. Default: title.content → info.title.content → nil. Override resolve_title in elements with different title paths.
Instance Method Summary collapse
Instance Method Details
#has_title? ⇒ Boolean
17 18 19 |
# File 'lib/docbook/elements/concerns/titled.rb', line 17 def has_title? (t = resolve_title) && !t.strip.empty? end |
#resolve_title ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/docbook/elements/concerns/titled.rb', line 9 def resolve_title if title&.content title.content.join elsif info&.title&.content info.title.content.join end end |
#titled? ⇒ Boolean
21 22 23 |
# File 'lib/docbook/elements/concerns/titled.rb', line 21 def titled? true end |