TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/mcbfc/llms.txt
Use this file to discover all available pages before exploring further.
markdown class (package com.srm.markdown_render) is a convenience wrapper that consolidates all Markwon setup into a single, reusable object. On construction it builds a Markwon instance via Markwon.builder(ctx).build(), creates a MarkwonAdapter configured with the custom BlockCodeEntry for fenced code blocks, and fully wires both to the supplied RecyclerView — setting its layoutManager, itemAnimator, and adapter in one shot.
Constructor
The Android
Context used to build the Markwon instance and passed directly to BlockCodeEntry so its Holder can access ClipboardManager and display Toast messages when the copy button is tapped.The
RecyclerView that will display the rendered markdown. The constructor assigns a LinearLayoutManager, a DefaultItemAnimator, and the internally created MarkwonAdapter to this view — no additional setup is required on the call site.Methods
sett(text: String)
Parses and renders a new markdown document into the RecyclerView.
The raw markdown string to parse and display. The string is handed directly to
adapter.setMarkdown(mark, text), which splits the document into individual AST nodes — each rendered by the appropriate Entry (either the root TextView or BlockCodeEntry for fenced code blocks). After updating the data set, adapter.notifyDataSetChanged() is called to invalidate and redraw all items.Internal fields
Built once in the
init block via Markwon.builder(ctx).build(). Holds the configured Markwon instance responsible for parsing CommonMark text and converting AST nodes into Android Spanned text. Passed to the adapter methods setMarkdown and setParsedMarkdown.Built with
MarkwonAdapter.builderTextViewIsRoot(R.layout.adapter_default_entry), which designates adapter_default_entry.xml as the default item layout for all non-code nodes. A BlockCodeEntry is registered via .include<FencedCodeBlock>(FencedCodeBlock::class.java, BlockCodeEntry(ctx)) so every FencedCodeBlock AST node is inflated and bound using the custom fenced-code layout instead. Assigned to the RecyclerView at the end of init.Full source
markdown.kt