Pure structural grammar of IETF RFC plaintext.
Depagination, masthead fields, section headings and section splitting. Consumed by the RFC text parser and by section-aware chunking.
Pure structural grammar of IETF RFC plaintext. Depagination, masthead fields, section headings and section splitting. Consumed by the RFC text parser and by section-aware chunking.
(abstract lines)The first paragraph of the abstract, or nil.
Matches a bare Abstract heading and a numbered N. ABSTRACT section.
The first paragraph of the abstract, or nil. Matches a bare `Abstract` heading and a numbered `N. ABSTRACT` section.
(depaginate text)Remove RFC page furniture, collapsing the blank runs it leaves behind.
Every content line keeps its indentation.
Remove RFC page furniture, collapsing the blank runs it leaves behind. Every content line keeps its indentation.
(furniture-line? line)True when a line is an RFC page header, page footer, or form feed.
True when a line is an RFC page header, page footer, or form feed.
(heading-at line)Parse one line as a section heading, or nil.
Headings start at column 0. Returns {:level :number :text}.
Parse one line as a section heading, or nil.
Headings start at column 0. Returns {:level :number :text}.(headings text)All section headings in document order.
All section headings in document order.
(masthead-authors masthead)Author names, affiliations and publication date from the masthead's right column. Returns {:rfc/authors [...] :rfc/date "..."}; keys may be absent.
Author names, affiliations and publication date from the masthead's right
column. Returns {:rfc/authors [...] :rfc/date "..."}; keys may be absent.(masthead-fields masthead)RFC masthead fields taken from the left column of the masthead block.
RFC masthead fields taken from the left column of the masthead block.
(preamble-blocks lines)Blank-line-separated blocks preceding the status section.
Block 0 is the masthead; block 1 is the document title.
Blank-line-separated blocks preceding the status section. Block 0 is the masthead; block 1 is the document title.
(references text self)Distinct RFC numbers cited by the text, excluding self.
Returns [{:href url :text "RFC N"} ...] in ascending numeric order.
Distinct RFC numbers cited by the text, excluding `self`.
Returns [{:href url :text "RFC N"} ...] in ascending numeric order.(rfc-url n)Canonical plaintext URL of an RFC number.
Canonical plaintext URL of an RFC number.
(split-columns line)Split a masthead line into [left-column right-column].
A line with no column gap yields ["" trimmed-line].
Split a masthead line into [left-column right-column]. A line with no column gap yields ["" trimmed-line].
(split-sections text)Split depaginated RFC text into sections at column-0 headings.
Returns [{:heading text-or-nil :level n-or-nil :number s-or-nil :lines [...]} ...]; text preceding the first heading forms a leading section with :heading nil.
Split depaginated RFC text into sections at column-0 headings.
Returns [{:heading text-or-nil :level n-or-nil :number s-or-nil :lines [...]}
...]; text preceding the first heading forms a leading section with
:heading nil.(superseded obsoletes)Links to the RFCs an Obsoletes: field names.
Links to the RFCs an Obsoletes: field names.
(title lines)The document title — the centered block following the masthead, or nil.
The document title — the centered block following the masthead, or nil.
(toc-line? line)True for a table-of-contents entry — a dot leader run to a page number.
True for a table-of-contents entry — a dot leader run to a page number.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |