Class: RubyUIAdmin::Views::Docs

Inherits:
Phlex::HTML
  • Object
show all
Defined in:
app/components/ruby_ui_admin/views/docs.rb

Overview

Standalone, self-contained page for the dev-only docs browser. Deliberately does NOT use the admin layout or the host's RubyUI/Tailwind assets — it ships its own minimal CSS so it renders correctly even in a freshly-installed host where the admin's styling isn't wired up yet.

Instance Method Summary collapse

Constructor Details

#initialize(body_html:, title:, nav_groups:, current_slug:) ⇒ Docs

Returns a new instance of Docs.



9
10
11
12
13
14
# File 'app/components/ruby_ui_admin/views/docs.rb', line 9

def initialize(body_html:, title:, nav_groups:, current_slug:)
  @body_html = body_html
  @title = title
  @nav_groups = nav_groups
  @current_slug = current_slug
end

Instance Method Details

#view_templateObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/components/ruby_ui_admin/views/docs.rb', line 16

def view_template
  doctype
  html(lang: "en") do
    head do
      meta(charset: "utf-8")
      meta(name: "viewport", content: "width=device-width, initial-scale=1")
      title { "#{@title} · RubyUI Admin docs" }
      style { raw(safe(STYLES)) }
    end
    body do
      div(class: "rua-docs") do
        render_sidebar
        main(class: "rua-docs-main") do
          article(class: "rua-prose") { raw(safe(@body_html)) }
        end
      end
    end
  end
end