Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 0 additions & 124 deletions vendor/wheels/public/docs/DocsHelper.cfc

This file was deleted.

122 changes: 69 additions & 53 deletions vendor/wheels/public/docs/guides.cfm
Original file line number Diff line number Diff line change
@@ -1,66 +1,82 @@
<cfscript>
// Guides Documentation System
// Wheels Guides — moved to guides.wheels.dev
// The GitBook-era in-app renderer was retired in PR #2189 (April 2026).
// This endpoint now redirects HTML callers to the external Starlight site and
// returns a sidebar-derived summary to AI/MCP callers hitting ?format=json.

param name="request.wheels.params.path" default="";
param name="request.wheels.params.format" default="html";

// Setup paths
local.docsPath = "/wheels/docs/src/";
if (!directoryExists(expandPath(local.docsPath))) {
// Fall back to relative path
local.docsPath = "../../wheels/docs/src/";
local.externalBase = "https://guides.wheels.dev/v4-0-0-snapshot/";
local.deepLink = local.externalBase;
if (Len(request.wheels.params.path)) {
local.cleanPath = ReReplace(request.wheels.params.path, "\.md$", "");
local.cleanPath = ReReplace(local.cleanPath, "^/+", "");
local.deepLink &= local.cleanPath;
if (Len(local.cleanPath) && Right(local.deepLink, 1) neq "/") {
local.deepLink &= "/";
}
}
local.summaryPath = local.docsPath & "SUMMARY.md";

// Get navigation structure
local.docsHelper = new wheels.public.docs.DocsHelper();
local.navigation = local.docsHelper.parseSummary(local.summaryPath);

// Determine which guide to display
local.guidePath = "";
local.guideContent = "";
local.guideTitle = "Wheels Documentation";

if (len(request.wheels.params.path)) {
if(right(request.wheels.params.path, 3) eq '.md'){
local.guidePath = local.docsPath & request.wheels.params.path;
} else {
local.guidePath = local.docsPath & request.wheels.params.path & ".md";
}

// Check if file exists
if (fileExists(expandPath(local.guidePath))) {
local.guideContent = fileRead(expandPath(local.guidePath));
local.guideTitle = request.wheels.params.path;
} else {
local.guideContent = "Guide not found: " & request.wheels.params.path;
}
} else {
// Default content - show introduction
local.readmePath = local.docsPath & "README.md";
if (fileExists(expandPath(local.readmePath))) {
local.guideContent = fileRead(expandPath(local.readmePath));
local.guideTitle = "Introduction";
} else {
local.guideContent = "## Wheels Documentation\n\nSelect a guide from the navigation menu.";
// Sidebar JSON is only present in a monorepo checkout; installed apps won't
// have it. Best-effort — callers that need a structured index can hit
// guides.wheels.dev directly.
local.sections = [];
local.sidebarPath = ExpandPath("/wheels/../../web/sites/guides/src/sidebars/v4-0-0-snapshot.json");
if (FileExists(local.sidebarPath)) {
try {
local.sections = DeserializeJSON(FileRead(local.sidebarPath));
} catch (any e) {
local.sections = [];
}
}

local.htmlContent = local.guideContent;

// Create docs structure similar to API docs
local.guides = {
"navigation" = local.navigation,
"content" = local.htmlContent,
"title" = local.guideTitle,
"path" = request.wheels.params.path
docs = {
"title": "Wheels Guides",
"path": request.wheels.params.path,
"url": local.deepLink,
"external": true,
"source": "https://guides.wheels.dev/",
"sections": local.sections
};

// Make it available to the layout
docs = local.guides;
</cfscript>

<cfif request.wheels.params.format EQ "html">
<cfinclude template="layouts/guides.cfm">
<cfif request.wheels.params.format EQ "json">
<cfcontent type="application/json" reset="true"><cfoutput>#SerializeJSON(docs)#</cfoutput>
<cfelse>
<cfinclude template="layouts/guides-plain.cfm">
</cfif>
<cfhtmlhead text="<meta http-equiv=""refresh"" content=""3;url=#encodeForHTMLAttribute(docs.url)#"">">
<cfoutput>
<!--- cfformat-ignore-start --->
<div class="sixteen wide column">
<div class="ui raised segment">
<h1>Wheels Guides have moved</h1>
<p>
The full Wheels guides now live at
<a href="#encodeForHTMLAttribute(docs.url)#" rel="noopener">#encodeForHTML(docs.url)#</a>.
Redirecting in a moment&hellip;
</p>
<cfif ArrayLen(docs.sections)>
<h2>Jump to a section</h2>
<div class="ui relaxed divided list">
<cfloop array="#docs.sections#" index="section">
<div class="item">
<i class="book icon"></i>
<div class="content">
<a class="header"
href="https://guides.wheels.dev#encodeForHTMLAttribute(section.link)#"
rel="noopener">#encodeForHTML(section.label)#</a>
</div>
</div>
</cfloop>
</div>
</cfif>
<p>
Looking for older docs? See
<a href="https://guides.wheels.dev/v3-0-0/" rel="noopener">v3.0</a> or
<a href="https://guides.wheels.dev/v2-5-0/" rel="noopener">v2.5</a>.
</p>
</div>
</div>
<!--- cfformat-ignore-end --->
</cfoutput>
</cfif>
19 changes: 0 additions & 19 deletions vendor/wheels/public/docs/layouts/guides-plain.cfm

This file was deleted.

Loading