"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([["2470"],{243:function(e,t,s){s.r(t),s.d(t,{asciidocConfig:()=>d,default:()=>p,frontMatter:()=>a,assets:()=>c,metadata:()=>o,toc:()=>u,contentTitle:()=>l});var o=JSON.parse('{"id":"languages/asciidoc","title":"AsciiDoc","description":"AsciiDoc is a plain text markup language for writing technical content. It\u2019s packed with semantic elements and equipped with features to modularize and reuse content. AsciiDoc content can be composed using a text editor, managed in a version control system, and published to multiple output formats.","source":"@site/docs/languages/asciidoc.mdx","sourceDirName":"languages","slug":"/languages/asciidoc","permalink":"/docs/languages/asciidoc","draft":false,"unlisted":false,"editUrl":"https://github.com/live-codes/livecodes/tree/develop/docs/docs/languages/asciidoc.mdx","tags":[],"version":"current","frontMatter":{},"sidebar":"docsSidebar","previous":{"title":"art-template","permalink":"/docs/languages/art-template"},"next":{"title":"AssemblyScript","permalink":"/docs/languages/assemblyscript"}}'),i=s("5893"),n=s("65"),r=s("3365");let a={},l="AsciiDoc",c={},d={markup:{language:"asciidoc",content:`= AsciiDoc Demo
== Features
* Simple
* Clean
* Dev-friendly
`}},u=[{value:"Usage",id:"usage",level:2},{value:"Demo",id:"demo",level:3},{value:"Language Info",id:"language-info",level:2},{value:"Name",id:"name",level:3},{value:"Extensions",id:"extensions",level:3},{value:"Editor",id:"editor",level:2},{value:"Compiler",id:"compiler",level:2},{value:"Version",id:"version",level:3},{value:"Code Formatting",id:"code-formatting",level:2},{value:"Custom Settings",id:"custom-settings",level:2},{value:"Limitations",id:"limitations",level:2},{value:"Links",id:"links",level:2}];function h(e){let t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,n.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"asciidoc",children:"AsciiDoc"})}),"\n","\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"https://asciidoc.org",children:"AsciiDoc"})," is a plain text markup language for writing technical content. It\u2019s packed with semantic elements and equipped with features to modularize and reuse content. AsciiDoc content can be composed using a text editor, managed in a version control system, and published to multiple output formats."]}),"\n",(0,i.jsxs)(t.p,{children:["In LiveCodes, AsciiDoc is compiled to HTML using ",(0,i.jsx)(t.a,{href:"https://asciidoctor.org/",children:"Asciidoctor"}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.h3,{id:"demo",children:"Demo"}),"\n","\n",(0,i.jsx)(r.Z,{config:d,height:"70vh"}),"\n",(0,i.jsx)(t.h2,{id:"language-info",children:"Language Info"}),"\n",(0,i.jsx)(t.h3,{id:"name",children:"Name"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.code,{children:"asciidoc"})}),"\n",(0,i.jsx)(t.h3,{id:"extensions",children:"Extensions"}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"adoc"}),", ",(0,i.jsx)(t.code,{children:"asc"})]}),"\n",(0,i.jsx)(t.h2,{id:"editor",children:"Editor"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.code,{children:"markup"})}),"\n",(0,i.jsx)(t.h2,{id:"compiler",children:"Compiler"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://docs.asciidoctor.org/asciidoctor.js/latest/",children:"Asciidoctor.js"})}),"\n",(0,i.jsx)(t.h3,{id:"version",children:"Version"}),"\n",(0,i.jsxs)(t.p,{children:["Asciidoctor.js: ",(0,i.jsx)(t.code,{children:"v2.2.8"})]}),"\n",(0,i.jsx)(t.h2,{id:"code-formatting",children:"Code Formatting"}),"\n",(0,i.jsx)(t.p,{children:"Not supported."}),"\n",(0,i.jsx)(t.h2,{id:"custom-settings",children:"Custom Settings"}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"/docs/advanced/custom-settings",children:"Custom settings"})," added to the property ",(0,i.jsx)(t.code,{children:"asciidoc"})," are passed as a JSON object to the ",(0,i.jsx)(t.a,{href:"https://docs.asciidoctor.org/asciidoctor.js/latest/setup/quick-tour/#your-first-conversion",children:(0,i.jsx)(t.code,{children:"convert()"})})," function during compile.\nPlease check the ",(0,i.jsx)(t.a,{href:"https://docs.asciidoctor.org/asciidoctor.js/latest/processor/convert-options/",children:"documentation"})," and ",(0,i.jsx)(t.a,{href:"https://docs.asciidoctor.org/asciidoc/latest/attributes/document-attributes-ref/",children:"document attributes"})," for full reference."]}),"\n",(0,i.jsx)(t.p,{children:"Please note that custom settings should be valid JSON (i.e. functions are not allowed)."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-json",children:'{\n "asciidoc": {\n "attributes": {\n "source-highlighter": "highlight.js",\n "icons": "font"\n }\n }\n}\n'})}),"\n",(0,i.jsx)(t.h2,{id:"limitations",children:"Limitations"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Some advanced extensions may not work (e.g. diagrams)"}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"links",children:"Links"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://asciidoc.org",children:"AsciiDoc"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://asciidoctor.org/",children:"Asciidoctor"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://docs.asciidoctor.org/asciidoctor.js/latest/",children:"AsciiDoctor.js"})}),"\n"]})]})}function p(e={}){let{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},3365:function(e,t,s){s.d(t,{Z:()=>f});var o=s("5893"),i=s("4200"),n=s("7294"),r=s("8294");function a(e){let t=(0,n.useRef)(null),[s,i]=(0,n.useState)(e.className||""),[a,l]=(0,n.useState)(e.style||{}),[c,d]=(0,n.useState)(e.height),[u,h]=(0,n.useState)(),[p,m]=(0,n.useState)(JSON.stringify(e.config||"")),[g,f]=(0,n.useState)("");return(0,n.useEffect)(()=>{if(!t.current)return;let{className:s,style:o,height:n,sdkReady:a,config:c,...v}=e;if(i(s||""),l(o||{}),d(n),u&&g===JSON.stringify(v)){if(p===JSON.stringify(c))return;m(JSON.stringify(c)),"string"==typeof c?fetch(c).then(e=>e.json()).then(e=>{u?.setConfig(e)}):c&&u.setConfig(c)}else f(JSON.stringify(v)),u?.destroy(),(0,r.T)(t.current,{config:c,...v}).then(e=>{h(e),"function"==typeof a&&a(e)})},[e]),(0,n.useEffect)(()=>()=>{u?.destroy()},[]),(0,o.jsx)("div",{ref:t,className:s,style:a,"data-height":c})}var l=s("1858"),c=s("3262"),d=s("1705"),u=s("7645"),h=s("8168"),p=s("8228"),m=s("5050");function g(e){let[t,s]=(0,n.useState)(e.js),[i,r]=(0,n.useState)(e.ts),[a,l]=(0,n.useState)(e.react),[g,f]=(0,n.useState)(e.vue),[v,y]=(0,n.useState)(e.svelte),j="3.7rem",[x,b]=(0,n.useState)(!0),[w,S]=(0,n.useState)(j),C=(0,n.useRef)(null),E=()=>{setTimeout(()=>{S(`calc(${C.current.offsetHeight}px + ${j})`)},5),setTimeout(()=>{S(`calc(${C.current.offsetHeight}px + ${j})`)},255)};return(0,n.useEffect)(()=>{if(c.Z.canUseDOM){let e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"js";try{return window.prettier?.format(e,{parser:"html"===t?"html":"babel",plugins:window.prettierPlugins})}catch{return e}};s(e(t,"js")),r(e(i,"ts")),l(e(a,"jsx")),f(e(g,"html")),y(e(v,"html"))}},[]),(0,o.jsxs)("details",{className:`alert alert--info ${m.Z.details} ${p.Z.details}`,"data-collapsed":x,style:{height:x?j:w,overflow:"hidden",willChange:"height",transition:`height ${x?"250ms":"265ms"} ease-in-out 0s`,margin:"1em 0"},children:[(0,o.jsx)("summary",{onClick:()=>{b(!x),E()},children:"show code"}),(0,o.jsx)("div",{ref:C,style:{display:"block",overflow:"hidden"},children:(0,o.jsx)("div",{className:m.Z.collapsibleContent,children:(0,o.jsxs)(h.Z,{groupId:"sdk-code",children:[(0,o.jsx)(u.Z,{value:"js",label:"JS",attributes:{onMouseDown:E},children:(0,o.jsx)(d.Z,{language:"js",children:t})}),(0,o.jsx)(u.Z,{value:"ts",label:"TS",attributes:{onMouseDown:E},children:(0,o.jsx)(d.Z,{language:"ts",children:i})}),(0,o.jsx)(u.Z,{value:"react",label:"React",attributes:{onMouseDown:E},children:(0,o.jsx)(d.Z,{language:"jsx",children:a})}),(0,o.jsx)(u.Z,{value:"vue",label:"Vue",attributes:{onMouseDown:E},children:(0,o.jsx)(d.Z,{language:"html",children:g})}),(0,o.jsx)(u.Z,{value:"svelte",label:"Svelte",attributes:{onMouseDown:E},children:(0,o.jsx)(d.Z,{language:"html",children:v})})]})})})]})}function f(e){let{className:t,style:s,showCode:n,height:r,...c}=e,{colorMode:d}=(0,i.I)(),u=e=>JSON.stringify(e,null,2),h=`
import { createPlayground } from 'livecodes';
const options = ${u(c)};
createPlayground('#container', options);
`.trimStart(),p=`
import { createPlayground, type EmbedOptions } from 'livecodes';
const options: EmbedOptions = ${u(c)};
createPlayground('#container', options);
`.trimStart(),m=`
import LiveCodes from 'livecodes/react';
export default function App() {
const options = ${u(c)};
return (