Skip to content

Commit bf45f05

Browse files
B4nanclaude
andcommitted
fix: add visually hidden status code headings for .md export hierarchy
The .md export was mixing content from different response codes (200, 400) together because tab UI doesn't translate to markdown hierarchy. Add sr-only h3 headings per status code so the llms-txt plugin produces proper nesting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4c76590 commit bf45f05

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

patches/docusaurus-theme-openapi-docs+4.7.1.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,3 +481,41 @@ index 37190c6..76766ef 100644
481481
});
482482
}
483483
return react_1.default.createElement(SchemaItem_1.default, {
484+
diff --git a/node_modules/docusaurus-theme-openapi-docs/lib/theme/StatusCodes/index.js b/node_modules/docusaurus-theme-openapi-docs/lib/theme/StatusCodes/index.js
485+
index a0b2d76..ab3e87f 100644
486+
--- a/node_modules/docusaurus-theme-openapi-docs/lib/theme/StatusCodes/index.js
487+
+++ b/node_modules/docusaurus-theme-openapi-docs/lib/theme/StatusCodes/index.js
488+
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
489+
const react_1 = __importDefault(require("react"));
490+
const Translate_1 = require("@docusaurus/Translate");
491+
const ApiTabs_1 = __importDefault(require("@theme/ApiTabs"));
492+
+const Heading_1 = __importDefault(require("@theme/Heading"));
493+
const Details_1 = __importDefault(require("@theme/Details"));
494+
const Markdown_1 = __importDefault(require("@theme/Markdown"));
495+
const ResponseHeaders_1 = __importDefault(require("@theme/ResponseHeaders"));
496+
@@ -35,6 +36,25 @@ const StatusCodes = ({ label, id, responses }) => {
497+
react_1.default.createElement(
498+
TabItem_1.default,
499+
{ key: code, label: code, value: code },
500+
+ // Apify: Visually hidden heading for llms-txt .md export
501+
+ react_1.default.createElement(
502+
+ Heading_1.default,
503+
+ {
504+
+ as: "h3",
505+
+ style: {
506+
+ position: 'absolute',
507+
+ width: '1px',
508+
+ height: '1px',
509+
+ padding: 0,
510+
+ margin: '-1px',
511+
+ overflow: 'hidden',
512+
+ clip: 'rect(0, 0, 0, 0)',
513+
+ whiteSpace: 'nowrap',
514+
+ borderWidth: 0,
515+
+ }
516+
+ },
517+
+ `Status ${code}`
518+
+ ),
519+
react_1.default.createElement(
520+
"div",
521+
null,

0 commit comments

Comments
 (0)