struct

CRDoc::Entry

Inherits Struct < Value < Object

A single documented item, flattened out of a Model::Root.

Constants

ABBREVIATIONS = {"e.g.", "i.e.", "etc.", "vs.", "cf."}

Words that end in a period without ending a sentence, lowercased.

Constructors

new(source : String, kind : CRDoc::Entry::Kind, owner : Nil | String, name : String, signature : Nil | String = nil, doc : Nil | String = nil, location : CRDoc::Model::Location | Nil = nil, abstract __arg0 : Bool = false, type : Nil | CRDoc::Model::Type = nil)
Source

Class methods

first_sentence(paragraph : String) : String

paragraph up to the first ., ! or ? that is followed by a space or the end. Stops inside code spans and after abbreviations don't count. A backtick without a partner is dropped.

Source
flatten(root : Model::Root, source : String) : Array(Entry)

Flattens a parsed docs tree into entries, depth first.

Source

Instance methods

abstract?
Source
full_name

Qualified name in crdoc query syntax: String, IO::Memory, String#size, String.new, Signal::INT, ARGV. Top-level methods carry a leading ::, as in ::puts, so the name picks them out alone.

Source
kind
Source
location
Source
name

Short name: size, Memory, INT.

Source
owner

Qualified name of the enclosing type without generic parameters (Hash, IO::Memory), or nil for the top level namespace.

Source
signature

Argument list and return type, as crystal docs prints them.

Source
source

Name of the source this entry came from, such as stdlib or shard:kemal.

Source
summary

First sentence of the doc as plain Markdown, or nil when undocumented.

Source
type

The full type record, present only for type entries.

Source

Nested types