docs-kit 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +86 -20
- data/app/components/docs_ui/archived_page.rb +45 -0
- data/app/components/docs_ui/brand_mark.rb +1 -2
- data/app/components/docs_ui/landing.rb +9 -18
- data/app/components/docs_ui/logo.rb +74 -0
- data/app/components/docs_ui/shell.rb +21 -1
- data/app/components/docs_ui/sidebar.rb +30 -14
- data/app/controllers/docs_kit/llms_controller.rb +8 -1
- data/app/controllers/docs_kit/mcp_controller.rb +5 -1
- data/app/controllers/docs_kit/search_controller.rb +6 -1
- data/exe/docs-kit +5 -5
- data/lib/docs_kit/brand_logo.rb +124 -0
- data/lib/docs_kit/configuration.rb +136 -4
- data/lib/docs_kit/controller.rb +11 -2
- data/lib/docs_kit/doc_version.rb +59 -0
- data/lib/docs_kit/landing_config.rb +8 -24
- data/lib/docs_kit/llms_text.rb +31 -4
- data/lib/docs_kit/markdown_export/blocks.rb +3 -2
- data/lib/docs_kit/mcp_tools.rb +2 -1
- data/lib/docs_kit/registry.rb +7 -0
- data/lib/docs_kit/scope.rb +59 -0
- data/lib/docs_kit/scoping.rb +28 -0
- data/lib/docs_kit/snapshot/entry.rb +48 -0
- data/lib/docs_kit/snapshot.rb +151 -0
- data/lib/docs_kit/templates/new_site.rb +64 -12
- data/lib/docs_kit/version.rb +1 -1
- data/lib/docs_kit.rb +3 -0
- data/lib/generators/docs_kit/install/install_generator.rb +1 -1
- data/lib/generators/docs_kit/install/templates/Dockerfile.tt +5 -5
- data/lib/generators/docs_kit/install/templates/agents_md.erb +1 -1
- data/lib/generators/docs_kit/install/templates/dockerignore +1 -0
- data/lib/generators/docs_kit/install/templates/docs_kit.rb.erb +17 -0
- data/lib/generators/docs_kit/install/templates/skill.md.erb +1 -1
- metadata +13 -5
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "json"
|
|
4
|
+
require "pathname"
|
|
5
|
+
|
|
6
|
+
module DocsKit
|
|
7
|
+
# Reads a committed Markdown snapshot of one documentation version back as the
|
|
8
|
+
# registry duck type the rest of the kit already speaks (#all / #from_slug /
|
|
9
|
+
# #nav_items), so an archived version renders through TODAY's chrome — only
|
|
10
|
+
# the content is frozen.
|
|
11
|
+
#
|
|
12
|
+
# A snapshot lives at <config.snapshots_path>/<version id>/: a manifest.json
|
|
13
|
+
# describing the nav structure (see the schema in the snapshot task) plus one
|
|
14
|
+
# .md file per page, written by the host-run `bin/rails docs_kit:snapshot[id]`
|
|
15
|
+
# task at release time.
|
|
16
|
+
#
|
|
17
|
+
# A missing directory or unreadable manifest degrades to an EMPTY snapshot
|
|
18
|
+
# (no pages) — a version configured before its snapshot is written must never
|
|
19
|
+
# take the site down. The install generator's --sync report warns about the
|
|
20
|
+
# drift instead.
|
|
21
|
+
class Snapshot
|
|
22
|
+
# The manifest format this reader understands; the writer stamps it so a
|
|
23
|
+
# future format change is detectable rather than silently misread.
|
|
24
|
+
SCHEMA = 1
|
|
25
|
+
|
|
26
|
+
class << self
|
|
27
|
+
# The snapshot for this version, memoized per [version id, directory] and
|
|
28
|
+
# invalidated when manifest.json's mtime changes — the same
|
|
29
|
+
# reload-on-change posture as Configuration#openapi_document, so editing
|
|
30
|
+
# a snapshot in development is picked up without a server restart.
|
|
31
|
+
def for(version, config: DocsKit.configuration)
|
|
32
|
+
version = DocVersion.from(version)
|
|
33
|
+
root = root_for(version, config)
|
|
34
|
+
mtime = manifest_mtime(root)
|
|
35
|
+
key = [version.id.to_s, root.to_s]
|
|
36
|
+
|
|
37
|
+
@cache ||= {}
|
|
38
|
+
cached = @cache[key]
|
|
39
|
+
return cached.fetch(:snapshot) if cached && cached.fetch(:mtime) == mtime
|
|
40
|
+
|
|
41
|
+
new(version: version, root: root).tap do |snapshot|
|
|
42
|
+
@cache[key] = { snapshot: snapshot, mtime: mtime }
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def reset_cache!
|
|
47
|
+
@cache = {}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
# <snapshots_path>/<id>, or nil when no snapshots path resolves (no
|
|
53
|
+
# config, no Rails) — which reads back as an empty snapshot.
|
|
54
|
+
def root_for(version, config)
|
|
55
|
+
base = config.snapshots_path
|
|
56
|
+
return if base.nil?
|
|
57
|
+
|
|
58
|
+
Pathname.new(base).join(version.id.to_s)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def manifest_mtime(root)
|
|
62
|
+
return if root.nil?
|
|
63
|
+
|
|
64
|
+
path = root.join("manifest.json")
|
|
65
|
+
path.file? ? path.mtime : nil
|
|
66
|
+
rescue StandardError
|
|
67
|
+
nil
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
attr_reader :version, :root
|
|
72
|
+
|
|
73
|
+
def initialize(version:, root:)
|
|
74
|
+
@version = version
|
|
75
|
+
@root = root
|
|
76
|
+
@manifest = read_manifest
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Every snapshot page across the manifest's registries, in manifest order —
|
|
80
|
+
# each a Snapshot::Entry quacking like a Registry::Entry.
|
|
81
|
+
def all
|
|
82
|
+
registries.flat_map { |registry| registry.fetch(:entries) }
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def from_slug(slug)
|
|
86
|
+
all.find { |entry| entry.slug.to_s == slug.to_s }
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# { group => [NavItem] }, the Registry.nav_items shape — hrefs already carry
|
|
90
|
+
# the version prefix, so the Sidebar's strict path == href active-matching
|
|
91
|
+
# works unchanged.
|
|
92
|
+
def nav_items
|
|
93
|
+
nav_items_for(all)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# { heading => { group => [NavItem] } }, the Configuration#nav_groups shape,
|
|
97
|
+
# from the manifest's per-registry headings — a heading with no pages is
|
|
98
|
+
# dropped so the sidebar never shows an empty group.
|
|
99
|
+
def nav_groups
|
|
100
|
+
registries.each_with_object({}) do |registry, acc|
|
|
101
|
+
items = nav_items_for(registry.fetch(:entries))
|
|
102
|
+
acc[registry.fetch(:heading)] = items unless items.empty?
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# The version-prefixed docs prefix (e.g. "/1.0/docs").
|
|
107
|
+
def path_prefix
|
|
108
|
+
"#{version.path_prefix}/docs"
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# The raw Markdown body of the page with this slug, or nil when unknown.
|
|
112
|
+
def markdown_for(slug)
|
|
113
|
+
from_slug(slug)&.markdown
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
private
|
|
117
|
+
|
|
118
|
+
# The manifest's registries as { heading:, entries: [Snapshot::Entry] }.
|
|
119
|
+
def registries
|
|
120
|
+
@registries ||= Array(@manifest && @manifest["registries"]).map do |registry|
|
|
121
|
+
prefix = registry["path_prefix"] || "/docs"
|
|
122
|
+
{
|
|
123
|
+
heading: registry["heading"],
|
|
124
|
+
entries: Array(registry["pages"]).map do |attrs|
|
|
125
|
+
Entry.new(attrs, version: version, root: root, registry_prefix: prefix)
|
|
126
|
+
end
|
|
127
|
+
}
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def nav_items_for(entries)
|
|
132
|
+
entries.group_by(&:group).transform_values do |grouped|
|
|
133
|
+
grouped.map { |entry| NavItem.new(href: entry.href, label: entry.title, icon: entry.icon) }
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# The parsed manifest Hash, or nil (→ empty snapshot) when the directory or
|
|
138
|
+
# manifest is missing/unreadable — degrade, never raise (the site must stay
|
|
139
|
+
# up with a version configured before its snapshot exists).
|
|
140
|
+
def read_manifest
|
|
141
|
+
return if root.nil?
|
|
142
|
+
|
|
143
|
+
path = root.join("manifest.json")
|
|
144
|
+
return unless path.file?
|
|
145
|
+
|
|
146
|
+
JSON.parse(path.read)
|
|
147
|
+
rescue JSON::ParserError, SystemCallError
|
|
148
|
+
nil
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -14,16 +14,16 @@ require "securerandom"
|
|
|
14
14
|
# * adds docs-kit + its runtime deps to the Gemfile,
|
|
15
15
|
# * runs `docs_kit:install` (all the Ruby/CSS/Stimulus wiring),
|
|
16
16
|
# * syncs the lucide icon set and builds the CSS,
|
|
17
|
-
# * scaffolds a deployable
|
|
17
|
+
# * scaffolds a deployable dash setup that calls docs-kit's reusable workflow.
|
|
18
18
|
#
|
|
19
19
|
# The generated app is a complete, deployable standalone docs site.
|
|
20
20
|
|
|
21
21
|
# --- config the template reads ------------------------------------------------
|
|
22
22
|
# DOCS_KIT_GEM_SOURCE lets the dogfood site (docs-kit/docs) depend on the gem via
|
|
23
23
|
# path: ".." while a real new site depends on the released gem. Default: rubygems.
|
|
24
|
-
gem_source = ENV.fetch("DOCS_KIT_GEM_SOURCE", "") # e.g. 'path: "..", ' or 'github: "
|
|
24
|
+
gem_source = ENV.fetch("DOCS_KIT_GEM_SOURCE", "") # e.g. 'path: "..", ' or 'github: "zoolutions/docs-kit", '
|
|
25
25
|
# The GHCR image/service = the OWNER/REPO the site will live in (repo-linked pkg).
|
|
26
|
-
image = ENV.fetch("DOCS_KIT_IMAGE", "
|
|
26
|
+
image = ENV.fetch("DOCS_KIT_IMAGE", "zoolutions/#{app_name}")
|
|
27
27
|
service = ENV.fetch("DOCS_KIT_SERVICE", app_name)
|
|
28
28
|
|
|
29
29
|
# --- gems ---------------------------------------------------------------------
|
|
@@ -53,14 +53,26 @@ after_bundle do
|
|
|
53
53
|
run "bun install --silent" if system("command -v bun >/dev/null 2>&1")
|
|
54
54
|
run "bun run build:css" if system("command -v bun >/dev/null 2>&1")
|
|
55
55
|
|
|
56
|
-
# --- deploy scaffolding (
|
|
56
|
+
# --- deploy scaffolding (dash + the reusable workflow) ---------------------
|
|
57
57
|
create_file "config/deploy.yml", <<~YAML
|
|
58
|
-
#
|
|
58
|
+
# dash deploy → the oss-infrastructure server (Cloudflare Tunnel + dash-proxy).
|
|
59
59
|
# service/image = the repo OWNER/REPO so the ghcr package auto-links to the
|
|
60
60
|
# repo and GITHUB_TOKEN can push + pull it (no PAT). See docs-kit's README.
|
|
61
|
+
# `dash docs` / `dash docs proxy` is the always-current reference for every key.
|
|
61
62
|
service: #{service}
|
|
62
63
|
image: #{image}
|
|
63
64
|
|
|
65
|
+
# dash 4 renamed the on-host proxy (kamal-proxy → dash-proxy) and migrates a
|
|
66
|
+
# host in place; an older CLI must not deploy this config.
|
|
67
|
+
minimum_version: 4.0.0
|
|
68
|
+
|
|
69
|
+
# A stateless docs site never rolls back far — keep the host tidy.
|
|
70
|
+
retain_containers: 2
|
|
71
|
+
|
|
72
|
+
# Status-named pages (public/502.html, 503, 504) the proxy serves in place of
|
|
73
|
+
# the app's during a deploy gap — paired with `proxy.intercept_errors` below.
|
|
74
|
+
error_pages_path: public
|
|
75
|
+
|
|
64
76
|
servers:
|
|
65
77
|
web:
|
|
66
78
|
hosts:
|
|
@@ -72,17 +84,51 @@ after_bundle do
|
|
|
72
84
|
proxy:
|
|
73
85
|
host: <%= ENV["DEPLOY_DOMAIN"] %>
|
|
74
86
|
app_port: 3000
|
|
87
|
+
# TLS terminates at Cloudflare; the tunnel reaches the proxy over plain HTTP.
|
|
75
88
|
ssl: false
|
|
76
89
|
healthcheck:
|
|
77
90
|
path: /up
|
|
78
91
|
interval: 5
|
|
79
92
|
timeout: 30
|
|
80
93
|
|
|
94
|
+
# --- dash-proxy per-app features ------------------------------------------
|
|
95
|
+
# zstd / br / gzip negotiated at the edge; responses the app already encoded
|
|
96
|
+
# (Thruster) pass through untouched.
|
|
97
|
+
compress: true
|
|
98
|
+
|
|
99
|
+
# RFC 9111 shared cache. Only responses the app marks `Cache-Control: public,
|
|
100
|
+
# max-age` are stored (Propshaft assets, /llms*.txt) — HTML carrying a session
|
|
101
|
+
# cookie is refused by design. `dash proxy cache stats` shows what it holds.
|
|
102
|
+
cache:
|
|
103
|
+
enabled: true
|
|
104
|
+
max_ttl: 300
|
|
105
|
+
|
|
106
|
+
# Security headers set once here instead of per app; drop server fingerprints.
|
|
107
|
+
headers:
|
|
108
|
+
response:
|
|
109
|
+
set:
|
|
110
|
+
X-Content-Type-Options: nosniff
|
|
111
|
+
Referrer-Policy: strict-origin-when-cross-origin
|
|
112
|
+
remove:
|
|
113
|
+
- Server
|
|
114
|
+
- X-Powered-By
|
|
115
|
+
|
|
116
|
+
# Serve public/<status>.html instead of a bare "Bad Gateway" while a
|
|
117
|
+
# container is swapped or unhealthy.
|
|
118
|
+
intercept_errors:
|
|
119
|
+
- 502
|
|
120
|
+
- 503
|
|
121
|
+
- 504
|
|
122
|
+
|
|
123
|
+
# Keep the health probe out of the request histograms.
|
|
124
|
+
exclude_metrics_paths:
|
|
125
|
+
- /up
|
|
126
|
+
|
|
81
127
|
registry:
|
|
82
128
|
server: ghcr.io
|
|
83
129
|
username: mhenrixon
|
|
84
130
|
password:
|
|
85
|
-
-
|
|
131
|
+
- DASH_REGISTRY_PASSWORD
|
|
86
132
|
|
|
87
133
|
builder:
|
|
88
134
|
arch: amd64
|
|
@@ -98,18 +144,24 @@ after_bundle do
|
|
|
98
144
|
SECRET_KEY_BASE: "#{SecureRandom.hex(64)}"
|
|
99
145
|
YAML
|
|
100
146
|
|
|
101
|
-
|
|
147
|
+
# The status pages `proxy.intercept_errors` serves for a deploy gap — `rails new`
|
|
148
|
+
# ships 500.html; the proxy looks for the exact status it intercepted.
|
|
149
|
+
%w[502 503 504].each do |status|
|
|
150
|
+
create_file "public/#{status}.html", File.read("public/500.html") if File.exist?("public/500.html")
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
create_file ".dash/secrets", <<~SH
|
|
102
154
|
# In CI the deploy workflow sets this to the job's GITHUB_TOKEN. Locally,
|
|
103
|
-
# export it (e.g.
|
|
104
|
-
|
|
155
|
+
# export it (e.g. DASH_REGISTRY_PASSWORD=$(gh auth token)).
|
|
156
|
+
DASH_REGISTRY_PASSWORD=$DASH_REGISTRY_PASSWORD
|
|
105
157
|
SH
|
|
106
158
|
|
|
107
159
|
# The Dockerfile + .dockerignore are written by `docs_kit:install` (run above in
|
|
108
160
|
# after_bundle) so a scaffolded site and an upgrading site share ONE optimized,
|
|
109
161
|
# version-stamped Dockerfile — no divergent copy to maintain here. The generator
|
|
110
162
|
# derives the LABEL service from the app dir basename (= app_name); if the site
|
|
111
|
-
# deploys under a DIFFERENT
|
|
112
|
-
# match config/deploy.yml so
|
|
163
|
+
# deploys under a DIFFERENT dash service (`--service`), correct the label to
|
|
164
|
+
# match config/deploy.yml so dash's --skip-push validate_image passes.
|
|
113
165
|
gsub_file "Dockerfile", /LABEL service=".*"/, %(LABEL service="#{service}") if service != app_name
|
|
114
166
|
|
|
115
167
|
create_file ".github/workflows/deploy-docs.yml", <<~YAML
|
|
@@ -120,7 +172,7 @@ after_bundle do
|
|
|
120
172
|
workflow_dispatch:
|
|
121
173
|
jobs:
|
|
122
174
|
deploy:
|
|
123
|
-
uses:
|
|
175
|
+
uses: zoolutions/docs-kit/.github/workflows/deploy.yml@main
|
|
124
176
|
with:
|
|
125
177
|
image: #{image}
|
|
126
178
|
service: #{service}
|
data/lib/docs_kit/version.rb
CHANGED
data/lib/docs_kit.rb
CHANGED
|
@@ -58,6 +58,9 @@ loader.ignore(File.expand_path("docs_kit/configuration.rb", __dir__))
|
|
|
58
58
|
# ignore it here too or zeitwerk double-manages the constant.
|
|
59
59
|
loader.ignore(File.expand_path("docs_kit/seo_config.rb", __dir__))
|
|
60
60
|
loader.ignore(File.expand_path("docs_kit/landing_config.rb", __dir__))
|
|
61
|
+
# Required eagerly by landing_config.rb (the LandingConfig::Logo alias resolves
|
|
62
|
+
# it at require time, before this loader is set up), so ignore it here too.
|
|
63
|
+
loader.ignore(File.expand_path("docs_kit/brand_logo.rb", __dir__))
|
|
61
64
|
# Loaded ONLY by the host's docs_kit:og rake task (an explicit require), never at
|
|
62
65
|
# gem runtime — so its Rack/browser tooling is never pulled into a host that
|
|
63
66
|
# doesn't run the task. Ignore it so eager_load! doesn't require it.
|
|
@@ -568,7 +568,7 @@ module DocsKit
|
|
|
568
568
|
(name || File.basename(destination_root)).to_s.underscore.humanize
|
|
569
569
|
end
|
|
570
570
|
|
|
571
|
-
# The
|
|
571
|
+
# The dash `service` name stamped as the Dockerfile's LABEL — the app dir
|
|
572
572
|
# basename (a docs site's repo name), matching the `docs-kit new` default.
|
|
573
573
|
# Used in Dockerfile.tt via <%= docker_service %>.
|
|
574
574
|
def docker_service
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# `build` stage. Pair it with the shipped .dockerignore so the build context
|
|
8
8
|
# stays small (no node_modules, .git, logs, specs, coverage).
|
|
9
9
|
#
|
|
10
|
-
# Build context is the app root; `docker build .` (
|
|
10
|
+
# Build context is the app root; `docker build .` (dash: context: ".").
|
|
11
11
|
|
|
12
12
|
ARG RUBY_VERSION=<%= ruby_version_arg %>
|
|
13
13
|
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
|
|
@@ -59,9 +59,9 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile && \
|
|
|
59
59
|
# --- Final stage --------------------------------------------------------------
|
|
60
60
|
FROM base
|
|
61
61
|
|
|
62
|
-
#
|
|
62
|
+
# dash's validate_image greps this label on a --skip-push deploy; it must equal
|
|
63
63
|
# `service:` in config/deploy.yml. The reusable deploy workflow also stamps it,
|
|
64
|
-
# but keeping it here means `docker build` alone produces a
|
|
64
|
+
# but keeping it here means `docker build` alone produces a dash-valid image.
|
|
65
65
|
LABEL service="<%= docker_service %>"
|
|
66
66
|
|
|
67
67
|
# Copy ONLY the built artifacts from the build stage: the installed bundle and
|
|
@@ -79,9 +79,9 @@ EXPOSE 3000
|
|
|
79
79
|
<% if thruster? -%>
|
|
80
80
|
# Thruster fronts Puma (HTTP caching + compression + X-Sendfile). It listens on
|
|
81
81
|
# HTTP_PORT and proxies to Puma on TARGET_PORT (it sets PORT for the child, which
|
|
82
|
-
# config/puma.rb reads). HTTP_PORT MUST be the port traffic is routed to (
|
|
82
|
+
# config/puma.rb reads). HTTP_PORT MUST be the port traffic is routed to (dash's
|
|
83
83
|
# `app_port`, the EXPOSE above) — Thruster's default is 80, which the non-root
|
|
84
|
-
# user can't reliably bind AND which
|
|
84
|
+
# user can't reliably bind AND which dash-proxy (app_port: 3000) would never
|
|
85
85
|
# route to, silently bypassing Thruster straight into Puma.
|
|
86
86
|
ENV HTTP_PORT="3000" \
|
|
87
87
|
TARGET_PORT="3001"
|
|
@@ -8,7 +8,7 @@ reads it through the bundled `write-docs-page` skill. Edit freely — a
|
|
|
8
8
|
<!-- BEGIN docs-kit -->
|
|
9
9
|
## Writing docs pages (docs-kit)
|
|
10
10
|
|
|
11
|
-
<%= app_brand %> is a [docs-kit](https://github.com/
|
|
11
|
+
<%= app_brand %> is a [docs-kit](https://github.com/zoolutions/docs-kit) site: a
|
|
12
12
|
Phlex/daisyUI chrome where **every page is a `DocsUI::Page` subclass** and the
|
|
13
13
|
sidebar, TOC, search, and Markdown twin come free. To document something, you
|
|
14
14
|
scaffold a page, then write its `#content`. Never hand-write HTML or daisyUI
|
|
@@ -21,6 +21,23 @@ Rails.application.config.to_prepare do
|
|
|
21
21
|
# docs live under a subpath:
|
|
22
22
|
# c.brand_href = "/docs"
|
|
23
23
|
|
|
24
|
+
# Your own mark in the topbar + sidebar header instead of the text brand
|
|
25
|
+
# (which stays the accessible name). Exactly ONE of these forms:
|
|
26
|
+
# paths: — inline path-d list; fills with currentColor, so the mark
|
|
27
|
+
# recolors with the active theme (also `svg:` for one path)
|
|
28
|
+
# markup: — a full <svg>…</svg> string, embedded verbatim (use
|
|
29
|
+
# fill="currentColor" in it to stay theme-adaptive)
|
|
30
|
+
# file: — a .svg under this app (e.g. "app/assets/images/mark.svg"),
|
|
31
|
+
# embedded inline at render — same currentColor advice
|
|
32
|
+
# src: — an image asset path/URL rendered as an <img>; note an <img>
|
|
33
|
+
# canNOT inherit currentColor, so it won't adapt to the theme
|
|
34
|
+
# c.brand_logo = { paths: ["M4 2h9l5 5…Z"], viewbox: "0 0 81 45", label: "<%= app_brand %>" }
|
|
35
|
+
|
|
36
|
+
# On desktop (lg:) the pinned sidebar already shows the brand, so the topbar
|
|
37
|
+
# copy is a duplicate. :mobile_only hides the topbar brand at lg:; the
|
|
38
|
+
# default (:always) keeps it everywhere.
|
|
39
|
+
# c.topbar_brand = :mobile_only
|
|
40
|
+
|
|
24
41
|
# Docs embedded in a bigger app? Add the way BACK to that app — a labeled
|
|
25
42
|
# link rendered once in the topbar, right after the brand. brand_href is the
|
|
26
43
|
# DOCS home (brand, sidebar, and the page masthead's "← Docs home" all
|
|
@@ -5,7 +5,7 @@ description: "Write, add, or update a documentation page in this docs-kit site.
|
|
|
5
5
|
|
|
6
6
|
# Write a docs page
|
|
7
7
|
|
|
8
|
-
This is a [docs-kit](https://github.com/
|
|
8
|
+
This is a [docs-kit](https://github.com/zoolutions/docs-kit) site (<%= app_brand %>).
|
|
9
9
|
Every page is a `DocsUI::Page` subclass; the shell, sidebar, "On this page" TOC,
|
|
10
10
|
search, and the `.md` twin all come free. Your job is to scaffold a page and
|
|
11
11
|
write its `#content` — never hand-write HTML or daisyUI markup.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: docs-kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikael Henriksson
|
|
@@ -164,6 +164,7 @@ files:
|
|
|
164
164
|
- CHANGELOG.md
|
|
165
165
|
- LICENSE.txt
|
|
166
166
|
- README.md
|
|
167
|
+
- app/components/docs_ui/archived_page.rb
|
|
167
168
|
- app/components/docs_ui/brand_mark.rb
|
|
168
169
|
- app/components/docs_ui/callout.rb
|
|
169
170
|
- app/components/docs_ui/code.rb
|
|
@@ -175,6 +176,7 @@ files:
|
|
|
175
176
|
- app/components/docs_ui/icon.rb
|
|
176
177
|
- app/components/docs_ui/json_response.rb
|
|
177
178
|
- app/components/docs_ui/landing.rb
|
|
179
|
+
- app/components/docs_ui/logo.rb
|
|
178
180
|
- app/components/docs_ui/markdown.rb
|
|
179
181
|
- app/components/docs_ui/markdown_action.rb
|
|
180
182
|
- app/components/docs_ui/meta_tags.rb
|
|
@@ -205,8 +207,10 @@ files:
|
|
|
205
207
|
- lib/docs_kit/api_client.rb
|
|
206
208
|
- lib/docs_kit/api_request.rb
|
|
207
209
|
- lib/docs_kit/api_templates.rb
|
|
210
|
+
- lib/docs_kit/brand_logo.rb
|
|
208
211
|
- lib/docs_kit/configuration.rb
|
|
209
212
|
- lib/docs_kit/controller.rb
|
|
213
|
+
- lib/docs_kit/doc_version.rb
|
|
210
214
|
- lib/docs_kit/engine.rb
|
|
211
215
|
- lib/docs_kit/landing_config.rb
|
|
212
216
|
- lib/docs_kit/llms_text.rb
|
|
@@ -224,11 +228,15 @@ files:
|
|
|
224
228
|
- lib/docs_kit/open_api/schema.rb
|
|
225
229
|
- lib/docs_kit/registry.rb
|
|
226
230
|
- lib/docs_kit/rubocop.rb
|
|
231
|
+
- lib/docs_kit/scope.rb
|
|
232
|
+
- lib/docs_kit/scoping.rb
|
|
227
233
|
- lib/docs_kit/search_hit.rb
|
|
228
234
|
- lib/docs_kit/search_index.rb
|
|
229
235
|
- lib/docs_kit/search_index/snippet.rb
|
|
230
236
|
- lib/docs_kit/seo_config.rb
|
|
231
237
|
- lib/docs_kit/shortcut.rb
|
|
238
|
+
- lib/docs_kit/snapshot.rb
|
|
239
|
+
- lib/docs_kit/snapshot/entry.rb
|
|
232
240
|
- lib/docs_kit/templates/new_site.rb
|
|
233
241
|
- lib/docs_kit/topbar_link.rb
|
|
234
242
|
- lib/docs_kit/version.rb
|
|
@@ -258,13 +266,13 @@ files:
|
|
|
258
266
|
- lib/generators/docs_kit/page/templates/page.rb.erb
|
|
259
267
|
- lib/rubocop/cop/docs_kit/escaped_interpolation_in_heredoc.rb
|
|
260
268
|
- lib/rubocop/cop/docs_kit/render_component_preferred.rb
|
|
261
|
-
homepage: https://github.com/
|
|
269
|
+
homepage: https://github.com/zoolutions/docs-kit
|
|
262
270
|
licenses:
|
|
263
271
|
- MIT
|
|
264
272
|
metadata:
|
|
265
|
-
source_code_uri: https://github.com/
|
|
266
|
-
changelog_uri: https://github.com/
|
|
267
|
-
bug_tracker_uri: https://github.com/
|
|
273
|
+
source_code_uri: https://github.com/zoolutions/docs-kit
|
|
274
|
+
changelog_uri: https://github.com/zoolutions/docs-kit/blob/main/CHANGELOG.md
|
|
275
|
+
bug_tracker_uri: https://github.com/zoolutions/docs-kit/issues
|
|
268
276
|
rubygems_mfa_required: 'true'
|
|
269
277
|
rdoc_options: []
|
|
270
278
|
require_paths:
|