livecode-static/docs/assets/js/bfb7ba14.356380a5.js
2025-06-11 22:23:49 +08:00

1 line
9.6 KiB
JavaScript

"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([["7164"],{1225:function(e,t,a){a.r(t),a.d(t,{default:()=>d,frontMatter:()=>c,metadata:()=>r,assets:()=>u,toc:()=>h,contentTitle:()=>o});var r=JSON.parse('{"id":"features/templates","title":"Templates","description":"A new project can be based on any of the provided starter templates or user templates.","source":"@site/docs/features/templates.mdx","sourceDirName":"features","slug":"/features/templates","permalink":"/docs/features/templates","draft":false,"unlisted":false,"editUrl":"https://github.com/live-codes/livecodes/tree/develop/docs/docs/features/templates.mdx","tags":[],"version":"current","frontMatter":{},"sidebar":"docsSidebar","previous":{"title":"Projects","permalink":"/docs/features/projects"},"next":{"title":"CSS","permalink":"/docs/features/css"}}'),l=a("5893"),s=a("65"),n=a("1858");let i=[{name:"blank",title:"Blank Project",thumbnail:"blank.svg"},{name:"javascript",title:"JavaScript Starter",thumbnail:"javascript.svg"},{name:"typescript",title:"TypeScript Starter",thumbnail:"typescript.svg"},{name:"react",title:"React Starter",thumbnail:"react.svg"},{name:"react-native",title:"React Native Starter",thumbnail:"react.svg"},{name:"vue",title:"Vue 3 SFC Starter",thumbnail:"vue.svg"},{name:"vue2",title:"Vue 2 Starter",thumbnail:"vue.svg"},{name:"angular",title:"Angular Starter",thumbnail:"angular.svg"},{name:"preact",title:"Preact Starter",thumbnail:"preact.svg"},{name:"svelte",title:"Svelte Starter",thumbnail:"svelte.svg"},{name:"solid",title:"Solid Starter",thumbnail:"solid.svg"},{name:"lit",title:"Lit Starter",thumbnail:"lit.svg"},{name:"stencil",title:"Stencil Starter",thumbnail:"stencil.png"},{name:"mdx",title:"MDX Starter",thumbnail:"mdx.svg"},{name:"tailwindcss",title:"Tailwind CSS Starter",thumbnail:"tailwindcss.svg"},{name:"shadcn-ui",title:"shadcn/ui Starter",thumbnail:"shadcn-ui.svg"},{name:"daisyui",title:"daisyUI Starter",thumbnail:"daisyui.svg"},{name:"bootstrap",title:"Bootstrap Starter",thumbnail:"bootstrap.svg"},{name:"astro",title:"Astro Starter",thumbnail:"astro.svg"},{name:"riot",title:"Riot.js Starter",thumbnail:"riot.svg"},{name:"malina",title:"Malina.js Starter",thumbnail:"malina.svg"},{name:"jquery",title:"jQuery Starter",thumbnail:"jquery.svg"},{name:"backbone",title:"Backbone Starter",thumbnail:"backbone.svg"},{name:"knockout",title:"Knockout Starter",thumbnail:"knockout.svg"},{name:"jest",title:"Jest Starter",thumbnail:"jest.svg"},{name:"jest-react",title:"Jest/React Starter",thumbnail:"jest.svg"},{name:"coffeescript",title:"CoffeeScript Starter",thumbnail:"coffeescript.svg"},{name:"livescript",title:"LiveScript Starter",thumbnail:"livescript.svg"},{name:"civet",title:"Civet Starter",thumbnail:"civet.png"},{name:"clio",title:"Clio Starter",thumbnail:"clio.png"},{name:"imba",title:"Imba Starter",thumbnail:"imba.svg"},{name:"rescript",title:"ReScript Starter",thumbnail:"rescript.png"},{name:"reason",title:"Reason Starter",thumbnail:"reason.svg"},{name:"ocaml",title:"Ocaml Starter",thumbnail:"ocaml.svg"},{name:"python",title:"Python Starter",thumbnail:"python.svg"},{name:"python-wasm",title:"Python (Wasm) Starter",thumbnail:"python.svg"},{name:"r",title:"R Starter",thumbnail:"r.svg"},{name:"ruby",title:"Ruby Starter",thumbnail:"ruby.svg"},{name:"ruby-wasm",title:"Ruby (Wasm) Starter",thumbnail:"ruby.svg"},{name:"go",title:"Go Starter",thumbnail:"go.svg"},{name:"php",title:"PHP Starter",thumbnail:"php.svg"},{name:"php-wasm",title:"PHP (Wasm) Starter",thumbnail:"php.svg"},{name:"cpp",title:"C++ Starter",thumbnail:"cpp.svg"},{name:"cpp-wasm",title:"C++ (Wasm) Starter",thumbnail:"cpp.svg"},{name:"java",title:"Java Starter",thumbnail:"java.svg"},{name:"csharp-wasm",title:"C# (Wasm)",thumbnail:"csharp.svg"},{name:"perl",title:"Perl Starter",thumbnail:"perl.svg"},{name:"lua",title:"Lua Starter",thumbnail:"lua.svg"},{name:"lua-wasm",title:"Lua (wasm) Starter",thumbnail:"lua.svg"},{name:"teal",title:"Teal Starter",thumbnail:"teal.png"},{name:"fennel",title:"Fennel Starter",thumbnail:"fennel.svg"},{name:"julia",title:"Julia Starter",thumbnail:"julia.svg"},{name:"scheme",title:"Scheme Starter",thumbnail:"scheme.svg"},{name:"commonlisp",title:"Common Lisp Starter",thumbnail:"commonlisp.svg"},{name:"clojurescript",title:"ClojureScript Starter",thumbnail:"cljs.svg"},{name:"gleam",title:"Gleam Starter",thumbnail:"gleam.svg"},{name:"tcl",title:"Tcl Starter",thumbnail:"tcl.svg"},{name:"markdown",title:"Markdown Starter",thumbnail:"markdown.svg"},{name:"assemblyscript",title:"AssemblyScript Starter",thumbnail:"assemblyscript.svg"},{name:"wat",title:"WebAssembly Text Starter",thumbnail:"webassembly.svg"},{name:"sql",title:"SQL Starter",thumbnail:"sqlite.svg"},{name:"postgresql",title:"PostgreSQL Starter",thumbnail:"postgresql.svg"},{name:"prolog",title:"Prolog Starter",thumbnail:"tau-prolog.svg"},{name:"blockly",title:"Blockly Starter",thumbnail:"blockly.svg"},{name:"diagrams",title:"Diagrams Starter",thumbnail:"diagrams.svg"}];function m(){return(0,l.jsx)("ul",{className:"list_XWVl",children:i.map(e=>(0,l.jsx)("li",{children:(0,l.jsxs)("a",{href:n.G+"/?template="+e.name,target:"_blank",children:[(0,l.jsx)("img",{src:n.G+"/livecodes/assets/templates/"+e.thumbnail}),(0,l.jsx)("div",{children:e.title})]})},e.name))})}let c={},o="Templates",u={},h=[{value:"Starter Templates",id:"starter-templates",level:2},{value:"Template List",id:"template-list",level:3},{value:"User Templates",id:"user-templates",level:2},{value:"Related",id:"related",level:2}];function p(e){let t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",ul:"ul",...(0,s.a)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.header,{children:(0,l.jsx)(t.h1,{id:"templates",children:"Templates"})}),"\n","\n",(0,l.jsxs)(t.p,{children:["A new project can be based on any of the provided ",(0,l.jsx)(t.a,{href:"#starter-templates",children:"starter templates"})," or ",(0,l.jsx)(t.a,{href:"#user-templates",children:"user templates"}),"."]}),"\n",(0,l.jsx)(t.p,{children:"A new project (from template) can be started from:"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"Project menu \u2192 New"}),"\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.a,{href:"/docs/features/welcome",children:"Welcome Screen"})," \u2192 New"]}),"\n",(0,l.jsxs)(t.li,{children:["Direct URL: ",(0,l.jsx)(t.a,{href:"https://livecodes.io?new",children:"https://livecodes.io?new"})]}),"\n"]}),"\n",(0,l.jsx)(t.h2,{id:"starter-templates",children:"Starter Templates"}),"\n",(0,l.jsxs)(t.p,{children:["A Large number of starter templates are available. They act as starting points and example usage for the ",(0,l.jsx)(t.a,{href:"/docs/languages/",children:"languages"})," available in LiveCodes."]}),"\n",(0,l.jsx)(t.p,{children:"A direct link for a starter template has the following format:"}),"\n",(0,l.jsxs)(t.p,{children:[(0,l.jsx)(t.code,{children:"?template={template_name}"})," (e.g. ",(0,l.jsx)(t.a,{href:"https://livecodes.io/?template=react",children:"https://livecodes.io/?template=react"}),")"]}),"\n",(0,l.jsxs)(t.p,{children:["The list of template names are documented ",(0,l.jsx)(t.a,{href:"/docs/api/internal/type-aliases/TemplateName",children:"here"}),"."]}),"\n",(0,l.jsx)(t.h3,{id:"template-list",children:"Template List"}),"\n",(0,l.jsx)(t.p,{children:"The following list of starter templates are available:"}),"\n",(0,l.jsx)(m,{}),"\n",(0,l.jsx)(t.h2,{id:"user-templates",children:"User Templates"}),"\n",(0,l.jsx)(t.p,{children:"Any project loaded in LiveCodes can be saved as a user template, to be used later as a starting point for new projects."}),"\n",(0,l.jsx)(t.p,{children:"A project can be saved as a user template from Project menu \u2192 Save as \u2192 Template."}),"\n",(0,l.jsx)(t.p,{children:"It can then be accessed from Project menu \u2192 New ... \u2192 My Templates."}),"\n",(0,l.jsxs)(t.p,{children:["A user template can be set as ",(0,l.jsx)(t.a,{href:"/docs/features/default-template-language",children:"default template"})," to be automatically loaded when loading the app."]}),"\n",(0,l.jsxs)(t.p,{children:["User templates are scoped to the currently ",(0,l.jsx)(t.a,{href:"/docs/features/user-management",children:"logged-in user"}),". They can be ",(0,l.jsx)(t.a,{href:"/docs/features/backup-restore",children:"backed up/restored"})," and ",(0,l.jsx)(t.a,{href:"/docs/features/sync",children:"synced"})," the same as other user data."]}),"\n",(0,l.jsx)(t.h2,{id:"related",children:"Related"}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:(0,l.jsx)(t.a,{href:"/docs/features/default-template-language",children:"Default Template/Language"})}),"\n",(0,l.jsx)(t.li,{children:(0,l.jsx)(t.a,{href:"/docs/features/projects",children:"Project"})}),"\n",(0,l.jsx)(t.li,{children:(0,l.jsx)(t.a,{href:"/docs/features/snippets",children:"Code Snippets"})}),"\n",(0,l.jsx)(t.li,{children:(0,l.jsx)(t.a,{href:"/docs/features/user-management",children:"User management"})}),"\n",(0,l.jsx)(t.li,{children:(0,l.jsx)(t.a,{href:"/docs/features/backup-restore",children:"Backup/Restore"})}),"\n",(0,l.jsx)(t.li,{children:(0,l.jsx)(t.a,{href:"/docs/features/sync",children:"Sync"})}),"\n",(0,l.jsx)(t.li,{children:(0,l.jsx)(t.a,{href:"/docs/languages/",children:"Languages"})}),"\n"]})]})}function d(e={}){let{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(p,{...e})}):p(e)}},65:function(e,t,a){a.d(t,{Z:function(){return i},a:function(){return n}});var r=a(7294);let l={},s=r.createContext(l);function n(e){let t=r.useContext(s);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:n(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]);