MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / getGuestImageHtml

Function getGuestImageHtml

src/liveShare/shareSession.ts:216–243  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

214// Purely used in order to decode a base64 string into
215// an image format, bypassing saving a file onto the guest's system
216function getGuestImageHtml(content: string) {
217 return `
218<!doctype HTML>
219<html>
220<head>
221 <meta charset="utf-8" />
222 <meta name="viewport" content="width=device-width, initial-scale=1">
223 <style type="text/css">
224 body {
225 color: black;
226 background-color: var(--vscode-editor-background);
227 }
228 img {
229 position: absolute;
230 top:0;
231 bottom: 0;
232 left: 0;
233 right: 0;
234 margin: auto;
235 }
236 </style>
237</head>
238<body>
239 <img src = "data:image/png;base64, ${String(content)}">
240</body>
241</html>
242`;
243}
244
245export async function shareServer(url: URL, name: string): Promise<vscode.Disposable> {
246 return liveSession.shareServer({

Callers 1

updateGuestPlotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected