Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fcb6006
Add llms.txt, llms-all.txt, and per-component markdown endpoints for …
SohamJuneja Apr 6, 2026
534d7f7
Add LLM and IntelliJ mention to bottom of home page
janfaracik Apr 7, 2026
5672dcb
Update IntelliJ logo
janfaracik Apr 7, 2026
c28a823
Move section, add Updated tag to IntelliJ plugin
janfaracik Apr 7, 2026
9502738
Fix test
janfaracik Apr 7, 2026
8f72c64
Remove per-component .md endpoints
SohamJuneja Apr 7, 2026
dbea30b
Fix snippet loading and restore per-component .md endpoints
SohamJuneja Apr 8, 2026
e81267c
Fix snippet loading for webapp-only resources
SohamJuneja Apr 14, 2026
8e8ac67
Fix Spotless formatting in LlmContentTest
SohamJuneja Apr 14, 2026
082658c
include dos-and-don'ts and inline code snippets in component markdown…
SohamJuneja Apr 16, 2026
063bfb3
Fix OS_OPEN_STREAM: close InputStreamReader in loadProperties
SohamJuneja Apr 16, 2026
3407c05
Clean up LlmContent.java
SohamJuneja Apr 18, 2026
1aaa2a6
Add static markdown files
SohamJuneja Apr 19, 2026
77fa7fb
Fix import in Home.java
SohamJuneja Apr 19, 2026
c013fb2
Fix import in Home.java
SohamJuneja Apr 19, 2026
7a4b85b
Merge branch 'master' into llms-txt-support
janfaracik Apr 25, 2026
8fb04e3
WIP: Use Jelly components for Markdown output
janfaracik Apr 25, 2026
dd6f4c0
Refine buttons page
janfaracik Apr 25, 2026
64381ac
Add support for category and since
janfaracik Apr 25, 2026
ca1bcaf
Add rudimentary support for dos/donts
janfaracik Apr 25, 2026
ea482ac
Support markdown for colors
janfaracik Apr 25, 2026
7bb1bbc
Refine
janfaracik Apr 25, 2026
2e594ca
Support important points
janfaracik Apr 25, 2026
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
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 62 additions & 1 deletion src/main/java/io/jenkins/plugins/designlibrary/Home.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
import hudson.Extension;
import hudson.PluginWrapper;
import hudson.model.RootAction;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URL;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
import jenkins.model.Jenkins;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;

/**
* Entry point to all the UI samples.
Expand Down Expand Up @@ -45,15 +50,71 @@
* Dynamically retrieves the appropriate UI sample based on the current URL
*/
public UISample getDynamic(String name) {
String normalizedName = name != null && name.endsWith(".mdx") ? name.substring(0, name.length() - 4) : name;
for (UISample ui : getAll()) {
String urlName = ui.getUrlName();
if (urlName != null && urlName.equals(name)) {
if (urlName != null && urlName.equals(normalizedName)) {
return ui;
}
}
return null;
}

/**
* Serves LLM-friendly content as plain text markdown.
*
* <ul>
* <li>{@code llms.txt} - index of all components with links to individual pages</li>
* <li>{@code llms-all.txt} - all component documentation in a single file</li>
* <li>{@code {component}.md} - documentation for a single component</li>
* </ul>

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check Warning

Potential missing permission check in Home#doDynamic

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing POST/RequirePOST annotation Warning

Potential CSRF vulnerability: If Home#doDynamic connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
*/
public void doDynamic(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException {
String restOfPath = req.getRestOfPath();
if (restOfPath.startsWith("/")) {
restOfPath = restOfPath.substring(1);
}

String content = resolveLlmContent(restOfPath, req);
if (content != null) {
rsp.setContentType("text/plain;charset=UTF-8");
try (PrintWriter w = rsp.getWriter()) {
w.write(content);
}
return;
}

rsp.sendError(404);
}

private String resolveLlmContent(String name, StaplerRequest2 req) {
String baseUrl = req.getContextPath() + "/" + getUrlName() + "/";

if ("llms.txt".equals(name)) {
return LlmContent.generateIndex(baseUrl);
}

URL resourceBase = getPluginResourceBase();

if ("llms-all.txt".equals(name)) {
return LlmContent.generateAll(resourceBase);
}
if (name.endsWith(".md")) {
String componentName = name.substring(0, name.length() - 3);
for (UISample sample : getAll()) {
if (componentName.equals(sample.getUrlName())) {
return LlmContent.generateComponentMarkdown(sample, resourceBase);
}
}
}
return null;
}

private URL getPluginResourceBase() {
PluginWrapper plugin = Jenkins.get().getPluginManager().getPlugin("design-library");
return plugin != null ? plugin.baseResourceURL : null;
}

public String getPluginVersion() {
Jenkins jenkins = Jenkins.get();
PluginWrapper plugin = jenkins.getPluginManager().getPlugin("design-library");
Expand Down
Loading
Loading