sandbox.bio 推出了一个工具,允许开发者在网站和博客文章中嵌入实时 Linux 终端 [1]。开发者可通过添加脚本标签的方式集成该终端,支持多项定制选项 [1]。
该工具提供了灵活的配置能力 [1]。通过 data-cwd 属性可指定工作目录,data-config 属性允许加载远程配置 URL [1]。用户还可在配置文件中通过 files 数组预加载指定文件,将远程文件 URL 映射到终端内的本地路径 [1]。
针对常见平台的集成已得到优化 [1]。在 GitHub Pages 中,Markdown 文档中的 bash 代码块会自动获得「Run」按钮;HTML 网站中 class 属性为 language-bash 的 div 元素也能同样获得该按钮 [1]。
sandbox.bio has launched a tool that enables developers to embed a live Linux terminal directly into websites and blog articles[1]. The integration is straightforward—developers simply add a script tag to their page to activate the functionality[1].
The platform offers several customization options to tailor the embedded terminal to specific needs[1]. Users can specify a working directory using the data-cwd attribute and configure remote settings through the data-config attribute, which accepts a URL pointing to configuration files[1]. Additionally, files can be preloaded into the terminal environment by specifying file URLs and their corresponding local paths within the configuration[1].
For GitHub Pages users, the tool provides seamless integration with Markdown documentation[1]. Bash code blocks marked with triple backticks automatically display a "Run" button, allowing readers to execute code snippets directly[1]. Similarly, HTML-based websites can enable this feature by applying the language-bash class to div elements[1].