-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90d7e41
commit 293cd27
Showing
12 changed files
with
6,779 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// eslint-disable-next-line no-unused-vars | ||
import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; | ||
import { includeFile, generateBase64Favicon, renderSpec, stringifySpec, stringifyConfiguration } from '../helpers/all'; | ||
|
||
/** | ||
* @param {{asyncapi: AsyncAPIDocumentInterface, params: any}} param0 | ||
*/ | ||
export function Index({ asyncapi, params }) { | ||
return (`<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
${params.baseHref && `<base href="${params.baseHref}">`} | ||
<title>${asyncapi.info().title()} ${asyncapi.info().version()} documentation</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="icon" type="image/x-icon" href="${generateBase64Favicon(params)}" /> | ||
${params.singleFile && `<style type="text/css"> | ||
${includeFile("template/css/global.min.css")} | ||
${includeFile("template/css/asyncapi.min.css")} | ||
</style>`} | ||
${!params.singleFile && `<link href="css/global.min.css" rel="stylesheet"> | ||
<link href="css/asyncapi.min.css" rel="stylesheet">`} | ||
</head> | ||
<body> | ||
<div id="root">${renderSpec(asyncapi, params)}</div> | ||
${params.singleFile && ` <script type="text/javascript"> | ||
{{ "template/js/asyncapi-ui.min.js" | includeFile | safe }} | ||
</script>`} | ||
${!params.singleFile && `<script src="js/asyncapi-ui.min.js" type="application/javascript"></script>`} | ||
<script> | ||
const schema = ${stringifySpec(asyncapi)}; | ||
const config = ${stringifyConfiguration(params)}; | ||
AsyncApiStandalone.hydrate({ schema, config }, document.getElementById("root")); | ||
</script> | ||
</body> | ||
</html>` | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.