Skip to content

Commit

Permalink
fix: correctly render comments on api description
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-cristino committed Dec 17, 2024
1 parent dcd7a50 commit 1dcc16f
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,34 @@ To add new endpoints you should add new zencode contracts in the directory.
tags: []
};

const openapiCss = `
<style>
.HttpOperation__Description h1:before {
content: "#";
}
.HttpOperation__Description h1 {
font-size: 16px;
margin: 0 0;
font-style: italic;
color: #444;
font-weight: 100;
}
</style>
`;

export const openapiTemplate = `
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>noˑcodeˑroom documentation</title>
<script src="https://unpkg.com/@stoplight/elements/web-components.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@stoplight/elements/styles.min.css">
</head>
<body>
<elements-api layout="sidebar" router="hash" apiDescriptionUrl="${config.basepath}/oas.json" />
</body>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>noˑcodeˑroom documentation</title>
<script src="https://unpkg.com/@stoplight/elements/web-components.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@stoplight/elements/styles.min.css">
${openapiCss}
</head>
<body>
<elements-api layout="sidebar" router="hash" apiDescriptionUrl="${config.basepath}/oas.json" />
</body>
</html>
`;

0 comments on commit 1dcc16f

Please sign in to comment.