Class SearchIndex
java.lang.Object
ai.redouble.docs.SearchIndex
What the site's search box searches: one entry per place a reader can land on, written
as the page asset
search-index.js. A page gives one entry for its opening, found
by the page's title, and one per heading, found by the heading and reached at the
heading's anchor; a build that ships the javadoc tree adds one entry per public class,
reached at the class's javadoc page. The text of an entry is what the reader sees under
that heading, code included, with the markdown syntax gone.
The index is a script rather than a JSON file because a page opened from disk may load a
script and may not fetch a file. The page loads it, and the search library, the first
time the search box takes focus.- Since:
- 0.1 (2026-10-01)
- Author:
- Andrey Santrosyan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne place a search lands on: the address relative to the site's root, the title of the page or the name of the class, the part of the contents the page belongs to (null for the front matter), the heading of the section (null for a page's opening and for a class) and the text searched. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClasses(Map<String, String> classIndex) One entry per class of the javadoc class index, found by the class's name and its package.voidaddPage(GenerateDocs.Page page, com.vladsch.flexmark.util.ast.Document document) The entries of one page, from the document the page was rendered from: rendering is what gives each heading its anchor, so the document must have been rendered already.entries()voidWritessearch-index.js, the entries as the arraySEARCH_INDEX.
-
Field Details
-
JAVADOC
The part every class entry carries where a page's entry carries its part of the contents.- See Also:
-
-
Constructor Details
-
SearchIndex
public SearchIndex()
-
-
Method Details
-
addPage
The entries of one page, from the document the page was rendered from: rendering is what gives each heading its anchor, so the document must have been rendered already. -
addClasses
-
entries
-
write
Writessearch-index.js, the entries as the arraySEARCH_INDEX.- Throws:
IOException
-