【发布时间】:2021-01-29 21:09:10
【问题描述】:
我正在尝试学习如何在 Google Apps 脚本中将一系列静态 svg 文件作为网络应用提供。我想提供的文件可以在我有代码的 IcoMoon 上找到。我不知道如何将它们作为 Web 应用程序的一部分应用。这是我迄今为止尝试过的代码:
function doGet() {
return createHtmlOutputFromFile('KI_SVG_Test');
getContent()
}
<style>
.icon {
display: inline-block;
width: 1em;
height: 1em;
stroke-width: 0;
stroke: currentColor;
fill: currentColor;
}
<style>
<!DOCTYPE html>
<html>
<head>
<!--1-->
<link rel="stylesheet" href="https://i.icomoon.io/public/e29d02ae9a/KernskyIntergraph/style-svg.css">
<!--2-->
<script defer src="https://i.icomoon.io/public/e29d02ae9a/KernskyIntergraph/svgxuse.js"></script>
<!--3-->
<svg class="icon icon-E000-uldf-f"><use xlink:href="#icon-E000-uldf-f"></use></svg>
</head>
<body>
<symbol id="icon-E000-uldf-f" viewBox="0 0 32 32">
<path d="M-25.942-16.073c0 0 0 0 0 0zM8.65 20.977c0 0 0 10.737 0 10.737s2.685 0 2.685 0c0 0 0-10.737 0-10.737s-2.685 0-2.685 0zM8.65 29.030c0 0 0 2.685 0 2.685s16.105 0 16.105 0c0 0 0-2.685 0-2.685s-16.105 0-16.105 0zM22.072 20.977c0 0 0 10.737 0 10.737s2.685 0 2.685 0c0 0 0-10.737 0-10.737s-2.685 0-2.685 0z"></path>
</symbol>
</body>
</html>
谁能告诉我如何在 GAS 中将单个 svg 文件作为 Web 应用程序提供服务?
【问题讨论】:
标签: javascript html css svg google-apps-script