如何解决是否需要创建链接以在Plunker或其他站点中打开网站模板?
我想在我的网站上创建一个按钮链接,该链接会以侧边栏打开类似于Visual Studio Code这样的代码文件夹。我找到了Plunker,它看起来很棒。
我有一个简单的网站模板,该模板是典型文件的文件夹,例如index.html和CSS和javascript。我希望人们能够通过单击按钮从模板创建网站,并登录并保存他们的更改,并与他人合作。跟踪更改也很棒。
最终我想在自己的网站中对其进行内部化,但我认为我将从一个已建立的在线工具开始。
万一有涉及Web地图的特殊情况,我使用的是MapBox GL。
有人知道吗?
解决方法
Plunker的嵌入式版本可以接受POST
版的表格,以便您可以使用自定义文件动态设置编辑器。可以找到一个示例here。
或者,我为Plunker创建了一个迷你“ SDK”,以帮助创建这样的动态嵌入,该嵌入在npm上发布,其来源为on GitHub。
<script src="https://cdn.jsdelivr.net/npm/@plnkr/sdk@1.0.0-pre.1/dist/index.js"></script>
<div id="embed"></div>
<script>
const { showDynamicEmbed } = window['@plnkr/sdk'];
// Generate the files for the dynamic plunk. This could easily
// be generated on the fly by your application.
const files = [
{
pathname: 'index.html',content: '<h1>Hello world</h1>',},];
showDynamicEmbed(
{
files,title: 'Hello world example',tags: ['hello','world'],{
deferRun: true,// Don't immediately run the preview
show: ['index.html','preview'],// Open the index file and preview panes
parentEl: document.getElementById('embed'),// Mount the embed in the #embed element
}
);
</script>
,
至少弄清楚了一些东西:
创建一个新页面,或在plunker中创建“ Plunk”,然后保存它,并使用它的链接。 如果人们要使用模板,则可以单击“ fork”按钮,并将其保存到他们的帐户中。仍然没有找到如何查看版本历史的信息。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。