KiteWind / templates /stlite /stlite-template.html
gstaff's picture
Add requirements support, query param, copy link, and automatic tab selection for stlite.
3b6c4d9
raw history blame
No virus
1.46 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>stlite app</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@stlite/mountable@0.39.0/build/stlite.css"/>
</head>
<body>
<!-- This app was created with KiteWind Chat-assisted Web App Creator (https://huggingface.co/spaces/gstaff/KiteWind) -->
<div id="root"></div>
<script src="https://cdn.jsdelivr.net/npm/@stlite/mountable@0.42.3/build/stlite.js"></script>
<script>
const streamlitConfig = "[server]\\nrunOnSave = true";
const code = \`STARTING_CODE\`;
// Mount options defined here: https://github.com/whitphx/stlite/blob/main/packages/mountable/src/options.ts#L7
const appController = stlite.mount({
requirements: [STARTING_REQUIREMENTS], // Packages to install
entrypoint: "streamlit_app.py", // The target file of the streamlit run command
files: {
".streamlit/config.toml": streamlitConfig,
"streamlit_app.py": code,
},
}, document.getElementById("root"));
// Returned controller functions defined here:
// https://github.com/whitphx/stlite/blob/1739c1cebb469a20e979906ce264f90254d154ba/packages/mountable/src/index.tsx#L55
window.appController = appController;
</script>
</body>
</html>