MCPcopy Create free account
hub / github.com/tinyplex/tinybase / getHtml

Function getHtml

site/ui/ExecutableProject.tsx:82–110  ·  view source on GitHub ↗
(
  title: string,
  html: string,
  entryFileName: string,
)

Source from the content-addressed store, hash-verified

80 );
81
82const getHtml = (
83 title: string,
84 html: string,
85 entryFileName: string,
86): string => {
87 html = html.replace(IMPORT_MAP_SCRIPT_REGEX, '').trim();
88 const headScripts = html.match(SCRIPTS_REGEX)?.join('\n')?.trim() ?? '';
89 const body = html.replace(SCRIPTS_REGEX, '').trim();
90 return prettier
91 .format(
92 `
93<!doctype html>
94<html lang="en">
95 <head>
96 <meta charset="utf-8" />
97 <meta name="viewport" content="width=device-width, initial-scale=1" />
98 <title>${title}</title>
99 ${headScripts}
100 </head>
101 <body>
102 ${body}
103 <script type="module" src="/${entryFileName}"></script>
104 </body>
105</html>
106 `,
107 {parser: 'html'},
108 )
109 .trim();
110};
111
112const getPackageJson = (
113 title: string,

Callers 1

ExecutableProjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…