class Books::ChapterEntry

Overview

Chapter entry from SUMMARY.md (parsed structure)

Defined in:

books.cr
books/summary_parser.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(title : String, path : Nil | String = nil, number : Array(Int32) = [] of Int32, level : Int32 = 0) #

[View source]

Instance Method Detail

def children : Array(ChapterEntry) #

[View source]
def children=(children : Array(ChapterEntry)) #

[View source]
def find_next(flat : Array(ChapterEntry)) : ChapterEntry | Nil #

Find the next chapter


[View source]
def find_prev(flat : String) : ChapterEntry | Nil #

Find the previous chapter


[View source]
def formatted_number : String #

Returns the formatted chapter number (e.g., "1.2.3")


[View source]
def has_content? : Bool #

Returns true if this chapter has content (not just a divider)


[View source]
def is_part : Bool #

ameba:disable Naming/QueryBoolMethods


[View source]
def is_part=(is_part : Bool) #

ameba:disable Naming/QueryBoolMethods


[View source]
def level : Int32 #

[View source]
def level=(level : Int32) #

[View source]
def link(book_name : String) : String #

Get the link for this chapter (preserves directory structure)


[View source]
def number : Array(Int32) #

[View source]
def number=(number : Array(Int32)) #

[View source]
def part=(value : Bool) #

[View source]
def part? : Bool #

[View source]
def path : String | Nil #

[View source]
def path=(path : String | Nil) #

[View source]
def slug : String #

Get the slug from path (preserves directory structure)


[View source]
def title : String #

[View source]
def title=(title : String) #

[View source]