Skip to main content

DocumentProcessor

Markdown/HTML rendering, RichEditor sanitization, document metadata storage (Layer 0 Foundation)

Status​

KeyValue
Layerfoundation
TierL0
Statuswip
Version0.9.0
PriceFree (free)
CategoryContent

Overview​

Overview​

DocumentProcessor is the Layer 0 Foundation Plugin of multi-saas-kit, providing document storage and conversion features shared across projects (academy.how, exam.how, edutech.how).

Features​

  • Markdown β†’ HTML rendering via league/commonmark with GFM
  • HTML section extraction & anchor annotation for paragraph-level comments / memos / translation
  • RichEditor HTML sanitizer with whitelist-based tag/attribute/style/class control and 14 dangerous tags (script/style/iframe/etc.) fully removed
  • Polymorphic Document storage with auto-versioning, derived_from tracking, saas_product_id / tenant_id isolation

Usage​

use App\Plugins\DocumentProcessor\Services\{MarkdownRenderer, DocumentRepository};
use App\Plugins\DocumentProcessor\Enums\DocumentFormat;

$html = app(MarkdownRenderer::class)->render($markdown);

$repo = app(DocumentRepository::class);
$doc = $repo->upsertMarkdown($lesson, $markdown);
$active = $repo->findActiveFor($lesson, DocumentFormat::HTML);

Implementing DocumentableInterface​

use App\Plugins\DocumentProcessor\Contracts\DocumentableInterface;

class Lesson extends Model implements DocumentableInterface
{
public function getSaasProductId(): ?int { return $this->saas_product_id; }
public function getTenantId(): ?int { return $this->tenant_id; }
}

Dependencies​

The following plugins depend on DocumentProcessor:

  • Annotation β€” learner annotations (uses data-anchor)
  • Reader β€” learner viewer
  • StagePipeline β€” AI content generation pipeline
  • AiSvg β€” AI SVG visual asset generation

License​

MIT

Demos​


πŸ›’ View on Plugin Store: store.codebase.how/plugins/document-processor