📝 README-lmv_bbcode.md

lmv_bbcode — Lightweight Markdown Viewer

Version: 2.0 Status: Live, fully tested Tag: [lmv]...[/lmv]

A standalone SMF BBCode mod that renders .md attachment or URL content inline in a post, using the existing MDParser.php engine from md_bbcode. No iframe, no external viewer — just clean inline Markdown rendering.

Architecturally mirrors pdf_bbcode (URL form, attach-NN position-based attachment form, autodisplay toggle, currentMsgId() pattern) but is a fully separate mod from both pdf_bbcode and md_bbcode, so neither is disturbed by changes here.


Commands (Tag Forms)

Command Form Behavior
URL [lmv]https://example.com/path/to/file.md[/lmv] Fetches and renders the Markdown file at the given URL
Attachment by ID [lmv=ID][/lmv] Renders a specific attachment by attachment ID
Auto-detect [lmv=attach-01][/lmv] Position-based reference to the Nth attachment on the post — no literal attachment ID needed
Force scroll [lmv=scroll]...[/lmv] / [lmv=scroll-N][/lmv] Forces the scroll class regardless of CSS default
Force no-scroll [lmv=noscroll]...[/lmv] / [lmv=noscroll-N][/lmv] Forces the .lmv-viewer-noscroll override class
No-scroll + attach-NN [lmv=noscroll-attach-01][/lmv] Combines auto-detect with the no-scroll override

All modifiers are composable with both the URL and attachment forms. With no modifier, scroll behavior falls through to the CSS default (tri-state: unset → CSS default, scroll → forced on, noscroll → forced off).

CSS

Shared Code with md_bbc

lmv does not have its own Markdown parser. It calls MDParser.php from md_bbc directly as a standalone callable parse function — one engine, two consumers. This was a deliberate choice to avoid maintaining a second parser, while keeping lmv_bbc as a fully separate, independently installable mod so nothing here touches or destabilizes md_bbc's own [md] tag logic.

Where lmv Fits — the Document Management System

lmv is one of five components making up the forum's homegrown Document Management System:

Component Role
md_bbc [md] tag — renders Markdown directly in a post; owns MDParser.php, the shared rendering engine
pdf_bbc [pdf] tag — renders PDF attachments inline via PDF.js; architectural template that lmv was deliberately built to mirror
lmv [lmv] tag — renders .md attachment/URL files inline, reusing md_bbc's MDParser.php
ISE "The ISE Project" (Intelligent Search Engine) — the custom Python post-search engine (search.py), replacing/augmenting native SMF search, with its own query logger, tokenizer, and ranking engine
ISEpdf ISE's PDF-focused sibling — PDFIndexer.py/PDFsearch.py, indexing the PDF library (magic-byte discovery, pdftotext -layout extraction, page-level word index) and surfacing results through the "ISEpdf" search-engine dropdown option

Together: md_bbc, pdf_bbc, and lmv handle rendering documents inline in posts, while ISE and ISEpdf handle finding them — indexing and searching post content and the PDF library respectively. pdf_bbc's architecture (tag-form conventions, install-package pattern) was the template lmv copied; md_bbc's parser is the engine lmv runs on top of.


Architecture

Install Notes

Confirmed Working (Live)

Next Steps