如何在我的网站中正确集成 Stack 的编辑器?

How can I properly integrate Stack's editor in my website?

我正在尝试将 Stack's editor 整合到我自己写的博客中。但即使在他们的自述文件中的示例中,它也没有显示编辑器。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title><link rel="stylesheet" href="https://unpkg.com/@Whosebug/stacks/dist/css/stacks.min.css" />
    <script src="https://unpkg.com/@Whosebug/stacks/dist/js/stacks.min.js"></script>
    <script src="//unpkg.com/@highlightjs/cdn-assets@latest/highlight.min.js"></script>
</head>
<body>
<div id="editor-container"></div>
<script>
    new window.stacksEditor.StacksEditor(
        document.querySelector("#editor-container"),
        "*Your* **markdown** here",
        {}
    );
</script>
</body>
</html>

在这里,浏览器的控制台显示,stacksEditor

调整了您的代码。您在脚本标签中遗漏了一些库,从不同的 CDN 添加了它们

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <link rel="stylesheet" href="https://unpkg.com/@Whosebug/stacks/dist/css/stacks.min.css">
  <link rel="stylesheet" href="https://unpkg.com/@Whosebug/stacks-editor/dist/styles.css">

  <script src="https://unpkg.com/@Whosebug/stacks/dist/js/stacks.min.js"></script>
  <script src="https://unpkg.com/@highlightjs/cdn-assets@latest/highlight.min.js"></script>
  <script src="https://unpkg.com/@Whosebug/stacks-editor/dist/app.bundle.js"></script>
</head>

<body>
  <div id="editor-container"></div>
  <script>
    new window.stacksEditor.StacksEditor(
      document.querySelector("#editor-container"),
      "*Your* **markdown** here", {}
    );
  </script>
</body>

</html>