PageSourceSearch

https://docs.runme.dev/assets/js/72250bc7.b5de2a4c.js

js runme.dev collected 2026-10-02 16:46:01 UTC 33,154 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkrunme_dev=globalThis.webpackChunkrunme_dev||[]).push([[139],{31508(e,n,i){i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>r,metadata:()=>t,toc:()=>a});const t=JSON.parse('{"id":"configuration/cell-level","title":"Cell-level Options","description":"Cell-level options allow you to configure the commands and their behvaior in your Markdown file by cell.","source":"@site/docs/configuration/cell-level.md","sourceDirName":"configuration","slug":"/configuration/cell-level","permalink":"/configuration/cell-level","draft":false,"unlisted":false,"editUrl":"https://github.com/runmedev/docs.runme.dev/edit/main/docs/configuration/cell-level.md","tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2,"title":"Cell-level Options"},"sidebar":"tutorialSidebar","previous":{"title":"Document-level Options","permalink":"/configuration/document-level"},"next":{"title":"CLI Reference","permalink":"/configuration/cli-reference"}}');var s=i(74848),l=i(28453);const r={sidebar_position:2,title:"Cell-level Options"},o="Cell-level Options",c={},a=[{value:"Some of the specific commands you may want to configure",id:"some-of-the-specific-commands-you-may-want-to-configure",level:2},{value:"Run a cell",id:"run-a-cell",level:2},{value:"Cell configuration keys",id:"cell-configuration-keys",level:2},{value:"Configuration UX",id:"configuration-ux",level:3},{value:"Configure using Markdown",id:"configure-using-markdown",level:2},{value:"Running code in Notebook cells",id:"running-code-in-notebook-cells",level:3},{value:"Long-running processes",id:"long-running-processes",level:3},{value:"Cell CWD (current working directory)",id:"cell-cwd-current-working-directory",level:3},{value:"Interactive vs non-interactive cells",id:"interactive-vs-non-interactive-cells",level:3},{value:"Environment variables",id:"environment-variables",level:3},{value:"Terminal visibility post-execution",id:"terminal-visibility-post-execution",level:3},{value:"Human-friendly output / mimeType configuration",id:"human-friendly-output--mimetype-configuration",level:3},{value:"Background Task",id:"background-task",level:3},{value:"Terminal Row",id:"terminal-row",level:3},{value:"How To Set Up Terminal Row",id:"how-to-set-up-terminal-row",level:4},{value:"Unnamed vs Named cells",id:"unnamed-vs-named-cells",level:3},{value:"Exclude Cell from Run All",id:"exclude-cell-from-run-all",level:3},{value:"Environment Variable Prompts",id:"environment-variable-prompts",level:2}];function d(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components},{Infobox:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Infobox",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"cell-level-options",children:"Cell-level Options"})}),"\n",(0,s.jsx)(n.p,{children:"Cell-level options allow you to configure the commands and their behvaior in your Markdown file by cell."}),"\n",(0,s.jsx)(n.h2,{id:"some-of-the-specific-commands-you-may-want-to-configure",children:"Some of the specific commands you may want to configure"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"File-watchers for compilers & bundlers should run as background tasks."}),"\n",(0,s.jsx)(n.li,{children:"Executors for Interactive and Non-interactive programs & scripts."}),"\n",(0,s.jsx)(n.li,{children:"Human-centric output: JSON, text, images, etc."}),"\n",(0,s.jsx)(n.li,{children:"Terminal visibility when no errors occur."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"run-a-cell",children:"Run a cell"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Navigate to the specific cell you wish to run."}),"\n",(0,s.jsxs)(n.li,{children:["Click the ",(0,s.jsx)(n.strong,{children:"Run"})," icon on the left side of the code block."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"cell-level",src:i(1224).A+"",width:"1902",height:"574"})}),"\n",(0,s.jsx)(n.p,{children:"This action will run your command and return an executed output, you can configure how your cell should run using the configuration options."}),"\n",(0,s.jsx)(n.h2,{id:"cell-configuration-keys",children:"Cell configuration keys"}),"\n",(0,s.jsx)(n.p,{children:"Cell level options gives users the flexibility to modify the behavior of each executable cell."}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Configuration"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Default value"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"background"}),(0,s.jsx)(n.td,{children:"Indicates if the cell should be runned as a background process"}),(0,s.jsx)(n.td,{children:"false"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"closeTerminalOnSuccess"}),(0,s.jsx)(n.td,{children:"Hide Terminal after cell successful execution"}),(0,s.jsx)(n.td,{children:"true"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tag / category"}),(0,s.jsx)(n.td,{children:"Execute code cells matching a tag or category (deprecated)"}),(0,s.jsx)(n.td,{children:"[empty]"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"cwd"}),(0,s.jsx)(n.td,{children:"Modify current working directory for cell execution"}),(0,s.jsx)(n.td,{children:"[empty]"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"excludeFromRunAll"}),(0,s.jsx)(n.td,{children:'Prevent executing this cell during the "Run All" operation'}),(0,s.jsx)(n.td,{children:"false"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"interactive"}),(0,s.jsx)(n.td,{children:"Indicates if run should allow interactive input"}),(0,s.jsx)(n.td,{children:"false"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"interpreter"}),(0,s.jsx)(n.td,{children:"The program or command line inserted into shebang (aka #!) line"}),(0,s.jsx)(n.td,{children:"[inferred from languageId]"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"mimeType"}),(0,s.jsx)(n.td,{children:"If set skips auto-detection and uses specific media (MIME) type"}),(0,s.jsx)(n.td,{children:"[empty]"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"name"}),(0,s.jsx)(n.td,{children:"Cell\u2019s canonical name useful for referencing the cell via CLI"}),(0,s.jsx)(n.td,{children:"[auto-generated]"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"ignore"}),(0,s.jsx)(n.td,{children:"Ingore code block from CLI and notebook transformation into a runnable cell"}),(0,s.jsx)(n.td,{children:"false"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"transform"}),(0,s.jsxs)(n.td,{children:["Transform code block into a runnable cell (notebook) and include as task in CLI (inverse of ignore; most relevant for ",(0,s.jsx)(n.code,{children:"mermaid"}),")"]}),(0,s.jsx)(n.td,{children:"true"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"terminalRows"}),(0,s.jsx)(n.td,{children:"Number of rows to display in the notebook terminal"}),(0,s.jsx)(n.td,{children:"[auto-set]"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"promptEnv"}),(0,s.jsx)(n.td,{children:"Prompt user to set exported environment vars"}),(0,s.jsx)(n.td,{children:"auto"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"skipPrompts"}),(0,s.jsxs)(n.td,{children:["Bypasses interactive ",(0,s.jsx)(n.a,{href:"/configuration/cell-level",children:"prompts"})," that require inputting environment vars or authentication confirmations."]}),(0,s.jsx)(n.td,{children:"false"})]})]})]}),"\n",(0,s.jsx)(t,{type:"sidenote",title:"SkipPrompts",children:(0,s.jsxs)(n.p,{children:["This feature can be used to prevent ",(0,s.jsx)(n.a,{href:"/configuration/document-level",children:"prompting"}
1)," when exporting an environment variable. By configuring the ",(0,s.jsx)(n.a,{href:"/configuration/cell-level",children:"cell options"})," appropriately, you can streamline your workflow and make your environment setup more efficient."]})}),"\n",(0,s.jsx)(n.h3,{id:"configuration-ux",children:"Configuration UX"}),"\n",(0,s.jsxs)(n.p,{children:["To modify the cell execution behavior of any cell you choose, click ",(0,s.jsx)(n.strong,{children:"Configure"})," on the respective cell."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"configure ",src:i(43887).A+"",width:"1868",height:"210"})}),"\n",(0,s.jsx)(n.p,{children:"A new view will open, allowing you to select \u201cgeneral\u201d or \u201cadvanced\u201d cell configuration."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"general-page",src:i(28929).A+"",width:"1858",height:"758"})}),"\n",(0,s.jsx)(n.h2,{id:"configure-using-markdown",children:"Configure using Markdown"}),"\n",(0,s.jsxs)(n.p,{children:["If you feel more comfortable editing the Markdown file directly, you can do it using the following configuration options ",(0,s.jsx)(n.a,{href:"/configuration/cell-level#cell-configuration-keys",children:"schema"}),":"]}),"\n",(0,s.jsx)(n.p,{children:"Consider this example:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",metastring:'{"id":"01HFPW3ES2Y7TXV064BKC5WS41"}',children:'```sh {"id":"01HPM33PJFH2Q9R5S123X0HCSC","interactive":"false"}\necho "hello world"\n```\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The above example uses the ",(0,s.jsx)(n.code,{children:"echo"})," command to display the text ",(0,s.jsx)(n.strong,{children:(0,s.jsx)(n.em,{children:"hello world"})})," on the terminal. The context ",(0,s.jsx)(n.code,{children:'{"interactive":"false","name":"echo-hello-world"}'})," indicates that the command is intended for non-interactive execution and has been labeled accordingly."]}),"\n",(0,s.jsx)(n.p,{children:"Another example (HTML-attributes notation):"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPM6HZEJKM8PPG6T38RABV9A"}',children:"```sh { interactive=true name=example mimeType=text/plain closeTerminalOnSuccess=false background=false }\necho hello world\n"})}),"\n",(0,s.jsx)(n.p,{children:"To edit the Markdown syntax of your cell in Runme, click on the button indicated in the image below"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"double view",src:i(78656).A+"",width:"1960",height:"224"})}),"\n",(0,s.jsx)(n.p,{children:"Your VS Code view will split into two. One side has Notebook view, and the other has the raw Markdown view. On the Markdown view, locate the cell you want to configure and make the necessary configuration edit."}),"\n",(0,s.jsx)(t,{type:"sidenote",children:(0,s.jsxs)(n.p,{children:["Take a look at more ",(0,s.jsx)(n.a,{href:"https://github.com/runmedev/vscode-runme/tree/main/examples",children:"examples"})," available inside the VS Code extension repo for a reference on how to apply these code block attributes in different use cases!"]})}),"\n",(0,s.jsx)(n.h3,{id:"running-code-in-notebook-cells",children:"Running code in Notebook cells"}),"\n",(0,s.jsxs)(n.p,{children:["Runme has a ",(0,s.jsx)(n.a,{href:"/usage/shebang",children:"Shebang feature"})," which allows users to specify each cell's programming language inside the Markdown file."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"interpreter",src:i(9019).A+"",width:"1896",height:"1132"})}),"\n",(0,s.jsx)(n.p,{children:"The image above shows that our first code block is in Python, and the next is bash."}),"\n",(0,s.jsxs)(n.p,{children:["If possible, always specify the language\xa0according to ",(0,s.jsx)(n.a,{href:"https://www.markdownguide.org/extended-syntax/#syntax-highlighting",children:"Markdown standards"}),"\xa0as illustrated below:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HFPW3ES2Y7TXV064BVXNCD12"}',children:'  ```sh {"id":"01HPMBVRXTRHSD52YVAX4K648P"}\necho "language identifier in fenced code block"\n'})}),"\n",(0,s.jsxs)(t,{type:"warning",children:[(0,s.jsxs)(n.p,{children:["Out of the box, Runme will leverage the ",(0,s.jsx)(n.a,{href:"https://github.com/yoeo/guesslang",children:"Guesslang"})," ML/AI model with a bias towards Shell to detect the languages for unidentified code blocks."]}),(0,s.jsx)(n.p,{children:"While this works well in a lot of cases, the accuracy is not perfect."})]}),"\n",(0,s.jsx)(n.h3,{id:"long-running-processes",children:"Long-running processes"}),"\n",(0,s.jsxs)(n.p,{children:["It is common to use file-watcher-enabled compilers/bundlers (e.g., ",(0,s.jsx)(n.code,{children:"npm start dev"}),",\xa0",(0,s.jsx)(n.code,{children:"watchexec"}),", etc.) in the background during development.\nFor any cell containing an instance of these commands, tick the background cell setting. This will prevent execution from permanently blocking the Notebook UX."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"background running task",src:i(31387).A+"",width:"2782",height:"762"})}
1),"\n",(0,s.jsx)(n.p,{children:'Once ticked notice the "Background Task" label shows up in the cell status bar!'}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," ",(0,s.jsx)(n.code,{children:"false"})]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Example"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPMBTYXA7N4M4EQHY79A806H"}',children:'```sh {"background":"true","id":"01HPMBT8BF57MJ36JYDKAMZG1K"}\nnpm run watch\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"background",src:i(309).A+"",width:"1876",height:"180"})}),"\n",(0,s.jsx)(n.h3,{id:"cell-cwd-current-working-directory",children:"Cell CWD (current working directory)"}),"\n",(0,s.jsx)(n.p,{children:"In most cases, you should set the current working directory at the document level; however, you can also set it per cell."}),"\n",(0,s.jsxs)(n.p,{children:["Click on ",(0,s.jsx)(n.code,{children:"configure"})," to change the current work directory ",(0,s.jsx)(n.code,{children:"cwd"}),":"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"checking directory",src:i(60390).A+"",width:"1337",height:"344"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPPF1PRAK846NR2H1CW86XVQ"}',children:'\n```sh { cwd=.. "id":"01HP475WXX5PVV658023KQJFRE"}\nnpm run watch #relative path\n\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPPF1PRAWK6WV432SB6KVF6G"}',children:'\n```sh {"cwd":"/tmp","id":"01HPQ8F2307NFJR3WV1EJRJ0B8"}\necho "absolute path" > dummy_file\n'})}),"\n",(0,s.jsx)(t,{type:"warning",children:(0,s.jsxs)(n.p,{children:["Please note that if both\xa0",(0,s.jsx)(n.code,{children:"cwd"}),"\xa0is set for doc-level and cell, they don't overwrite. They combine. For example,\xa0",(0,s.jsx)(n.code,{children:"cwd: /tmp/dummy"}),"\xa0(doc) and\xa0",(0,s.jsx)(n.code,{children:"cwd: .."}),"\xa0(cell) will result in\xa0",(0,s.jsx)(n.code,{children:"/tmp"}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"interactive-vs-non-interactive-cells",children:"Interactive vs non-interactive cells"}),"\n",(0,s.jsxs)(n.p,{children:["If a cell's commands do not require any input from the user it might be a good fit to include the cell's output inside the Notebook. This is useful if the resulting output could be useful as input in a downstream cell. This is what ",(0,s.jsx)(n.code,{children:"interactive=false"})," is for, and it defaults to ",(0,s.jsx)(n.em,{children:"true"}),"."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"interatcive-mode",src:i(96400).A+"",width:"1806",height:"598"})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"interactive execution in vs code",src:i(29027).A+"",width:"1218",height:"511"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," ",(0,s.jsx)(n.code,{children:"true"})]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Example"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPM7GDWT2TW3BTCRYJT3BFFW","interactive":"false"}',children:"openssl rand -base64 32\n"})}),"\n",(0,s.jsx)(n.h3,{id:"environment-variables",children:"Environment variables"}),"\n",(0,s.jsx)(n.p,{children:"If a cell has exported variables, the user will be prompted to set these variables. This can be useful to have a parameterized cell while not needing to manually modify the cell. Following modes are available:"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Mode"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"auto [default]"}),(0,s.jsx)(n.td,{children:"Prompt when environment variable has no value (e.g. loaded from .env)."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"always / yes"}),(0,s.jsx)(n.td,{children:"Always prompt allow for environment variable. Use existing value as placeholder if present."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"never / no"}),(0,s.jsx)(n.td,{children:"Never prompt for any environment variables. Evaluate expression and values as is or leave them empty."})]})]})]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"How to Set PromptEnv"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Click on ",(0,s.jsx)(n.code,{children:"configure \u2699\ufe0f"}
1)," in your code cell"]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.code,{children:"promptEnv"})," to set the mode you want the cell to run in"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"promptenv",src:i(73341).A+"",width:"1328",height:"336"})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Example"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPM880GBF2Y1SGKA92YF4WDZ","promptEnv":"true"}',children:'export SLEEP_SECS="0"\nsleep $SLEEP_SECS\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"prompt user in vscode",src:i(39967).A+"",width:"2310",height:"448"})}),"\n",(0,s.jsx)(n.p,{children:"There are two prompt modes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Using a placeholder"}),"\n",(0,s.jsx)(n.li,{children:"Prompting the user with a message"}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Here's the difference:"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Using a Placeholder"})}),"\n",(0,s.jsx)(n.p,{children:"Quotes or double-qoutes will prompt the use the confirm the placeholder value. This is convient when a valid default value is known ahead of time."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HRABZTNC8946E927BGMKQ1A0"}',children:'export PROJECT_ID="your-project-7f412a"\ncli make-call --project-id $PROJECT_ID describe\n'})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Using a Prompt Message"})}),"\n",(0,s.jsx)(n.p,{children:"When you don't know the default value, you can instead use a prompt message to ask the user for the value. The key difference here is that the message does not act as a value placeholder."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HRABZTNCZ2ZZBPDXDW3AQFGQ"}',children:"export PROJECT_ID=Enter a valid project ID\ncli make-call --project-id $PROJECT_ID describe\n"})}),"\n",(0,s.jsx)(n.h3,{id:"terminal-visibility-post-execution",children:"Terminal visibility post-execution"}),"\n",(0,s.jsxs)(n.p,{children:["A cell's execution terminal is auto-hidden unless it fails. This default behavior can be overwritten if keeping the terminal open is in the interest of the Runme notebook reader. Just untick ",(0,s.jsx)(n.code,{children:"closeTerminalOnSuccess"})," (",(0,s.jsx)(n.code,{children:"false"}),")."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," ",(0,s.jsx)(n.code,{children:"true"})]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Example"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPM835XP8SBJV14YGHQEEE3B"}',children:'  ```sh {"closeTerminalOnSuccess":"false","id":"01HPM7MC8MAJB2QCRVPVCN1FTT"}\ndocker ps | grep runme/demo:latest\n'})}),"\n",(0,s.jsx)(n.h3,{id:"human-friendly-output--mimetype-configuration",children:"Human-friendly output / mimeType configuration"}),"\n",(0,s.jsx)(n.p,{children:"Not all cells\u2019 output is plain text. For example, you can have JSON, text, images, etc, all in your Markdown file."}),"\n",(0,s.jsx)(n.p,{children:"You can configure to any of your choice in the cell configuration setting."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"mimeType",src:i(89676).A+"",width:"1286",height:"844"})}),"\n",(0,s.jsxs)(n.p,{children:["Using the\xa0optional ",(0,s.jsx)(n.strong,{children:"mimeType"}),"\xa0specifier, you can specify the expected output type. Runme Notebooks have a variety of renderers that will display them as human-friendly. The MIME type defaults to\xa0",(0,s.jsx)(n.em,{children:"text/plain"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["When the ",(0,s.jsx)(n.strong,{children:"interactive"})," setting is turned off, and the ",(0,s.jsx)(n.strong,{children:"mimeType"})," value is empty, Runme attempt to auto-detect the MIME Type. This is useful for automatically displaying a cell's output according to the renderers available in your VS Code installation. If you specify a specific MIME Type, it will be used instead of auto-detection."]}),"\n",(0,s.jsxs)(n.p,{children:["Runme has a ",(0,s.jsx)(n.code,{children:"mimeType"})," feature that enables you to render images, CSV-based tables, and other supported content type right inside your Markdown file. Runme supports a wide range of Media types such as ",(0,s.jsx)(n.code,{children:"text/x-json"}),", ",(0,s.jsx)(n.code,{children:"text/x-javascript"}),", ",(0,s.jsx)(n.code,{children:"text/x-html"}),", ",(0,s.jsx)(n.code,{children:"image/png"}),", ",(0,s.jsx)(n.code,{children:"image/svg+xml"})," and ",(0,s.jsx)(n.code,{children:"text/csv"}),"."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Human-centric output",src:i(79474).A+"",width:"1219",height:"340"})}),"\n",(0,s.jsxs)(n.p,{children:["See in the ",(0,s.jsx)(n.a,{href:"/configuration/mime",children:"reference page"})," for the list of supported MIME types!"]}
1),"\n",(0,s.jsx)(n.h3,{id:"background-task",children:"Background Task"}),"\n",(0,s.jsx)(n.p,{children:"If you cannot wait for your code or command to finish execution and you want to run something else simultaneously, the background mode in Runme is the way to go."}),"\n",(0,s.jsxs)(n.p,{children:["Runme has a ",(0,s.jsx)(n.strong,{children:"background"})," mode that enables you to run tasks in the background. To do this, you have to activate the background mode."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"runme-background",src:i(23602).A+"",width:"1778",height:"770"})}),"\n",(0,s.jsx)(n.h3,{id:"terminal-row",children:"Terminal Row"}),"\n",(0,s.jsx)(n.p,{children:"The number of rows an output should be rendered is defined by a setting known as Terminal row. Set the number of rows with which your output should be displayed under a cell, 10 rows is the default."}),"\n",(0,s.jsx)(n.h4,{id:"how-to-set-up-terminal-row",children:"How To Set Up Terminal Row"}),"\n",(0,s.jsx)(n.p,{children:"The terminal row is a Runme VS Code feature. Therefore, you can set up using your code editor. If you haven\u2019t installed Runme on your VS Code yet, see our installation guide to install Runme in your VS Code editor."}),"\n",(0,s.jsx)(n.p,{children:"To set up the terminal row on your code editor, follow the steps below:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["In your ",(0,s.jsx)(n.code,{children:".md"})," file, click on the \u201cConfigure\u201d button at the bottom left of the file."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"terminalrow-1",src:i(79548).A+"",width:"1600",height:"435"})}),"\n",(0,s.jsx)(n.p,{children:"We have provided a list of configuration settings to upgrade your experience using the Runme extension. You can configure how your Markdown is executed on your code editor using these settings."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Navigate to \u201cAdvanced\u201d > ",(0,s.jsx)(n.code,{children:"terminalrow"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"terminalrow-2",src:i(68279).A+"",width:"1600",height:"522"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Lastly, set the number of rows you wish your output to be rendered in."}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"unnamed-vs-named-cells",children:"Unnamed vs Named cells"}),"\n",(0,s.jsx)(n.p,{children:"On Runme cells are unnamed by default. However, you can name a cell directly in your notebook. This will enable you to easily identify the cell using the provided cell name. On the cell you wish to name, simply click on the \u201cAdd Name\u201d button on the cell."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"add name",src:i(52069).A+"",width:"2408",height:"260"})}),"\n",(0,s.jsx)(n.p,{children:"You will be directed to enter a preferred name for the cell."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"cell-name",src:i(31186).A+"",width:"2270",height:"548"})}),"\n",(0,s.jsx)(n.p,{children:"Where a cell is not named, a generated name is provided for each cell. We recommend you DO NOT name a cell when using the CLI mode, you can use the VS Code extension to name the file in the configuration settings."}),"\n",(0,s.jsx)(n.p,{children:"These examples showcase improved ways you can use Runme in your documentation to enhance your workflow and overall documentation process."}),"\n",(0,s.jsxs)(n.p,{children:["If you feel more comfortable editing the Markdown file directly, you can do it by using the following configuration options ",(0,s.jsx)(n.a,{href:"/configuration/cell-level",children:"schema"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",metastring:'{"id":"01HFPW3ES2Y7TXV064BKC5WS41"}',children:'```sh {"id":"01HPM33PJFH2Q9R5S123X0HCSC","interactive":"false"}\necho "hello world"\n```\n'})}),"\n",(0,s.jsxs)(n.p,{children:['The above example uses the echo command to display the text "hello world" on the terminal. The context ',(0,s.jsx)(n.code,{children:'{"interactive":"false","name":"echo-hello-world"}'})," indicates that the command is intended for non-interactive execution and has been labeled accordingly."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPM6HZEJKM8PPG6T38RABV9A"}',children:'\nTry out the previous command\n\n```sh {"id":"01HPMBXN8PNCMJ87Y1BGQ1NKN3"}\necho hello world\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The entire ",(0,s.jsx)(n.a,{href:"/configuration/cell-level",children:"configuration schema"}),": as an example"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPPF1PRA4XA9SXB45Y5VX5W0"}',children:'\n```sh {"background":"false","closeTerminalOnSuccess":"false","id":"01HPM33PJFH2Q9R5SNAQX0HCSC","interactive":"true","name":"example"}\necho "hello world"\n'})}),"\n",(0,s.jsx)(t,{type:"sidenote",children:(0,s.jsxs)(n.p,{children:["Take a look at more ",(0,s.jsx)(n.a,{href:"https://github.com/runmedev/vscode-runme/tree/main/examples",children:"examples"})," available inside the VS Code extension repo for a reference on how to apply these code block attributes in different use cases!"]})}),"\n",(0,s.jsx)(n.h3,{id:"exclude-cell-from-run-all",children:"Exclude Cell from Run All"}),"\n",(0,s.jsxs)(n.p,{children:["Every VS Code notebook allows users to run all available cells. This can be useful if you define a complete runbook in your Markdown file, allowing developers to click the ",(0,s.jsx)(n.strong,{children:"Run All"})," button to get set up and running."]}),"\n",(0,s.jsxs)(n.p,{children:["However, sometimes certain cells should be excluded from this workflow. You can configure this behavior b
1y clicking the ",(0,s.jsx)(n.code,{children:"excludeFromRunAll"})," option."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," ",(0,s.jsx)(n.code,{children:"false"})]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Example"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",metastring:'{"id":"01HPM81V77G7ASW1F4BTFBX13C"}',children:' ```sh {"excludeFromRunAll":"true","id":"01HPM7NRQYMD5T06M4KS6S2DWG"}\n # Do something optional here\n'})}),"\n",(0,s.jsx)(n.h2,{id:"environment-variable-prompts",children:"Environment Variable Prompts"}),"\n",(0,s.jsx)(n.p,{children:"Runme simplifies the use of environment variables in your notebooks by allowing dynamic settings within each cell block of your notebook. It provides interactive prompts in each cell, tailored to your users' needs. This ensures a smooth and user-friendly experience when incorporating real-time user interaction."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"How to Enable PromptEnv"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Click on ",(0,s.jsx)(n.code,{children:"configure \u2699\ufe0f"})," in your code cell"]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.code,{children:"promptEnv"})," to set the condition you want the cell to run in"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"promptenv",src:i(73341).A+"",width:"1328",height:"336"})}),"\n",(0,s.jsxs)(n.p,{children:["For instance, in the image below, we configure the ",(0,s.jsx)(n.code,{children:"SLEEP_SECS"})," environment variable to 10 seconds with a single click on the run cell button. This feature is useful when your runbooks need user-specific values."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ouput",src:i(48256).A+"",width:"960",height:"186"})}),"\n",(0,s.jsxs)(n.p,{children:["This feature allows users to input values directly within the notebook environment, making task execution more efficient. Improve your workflow with the increased flexibility provided by ",(0,s.jsx)(n.code,{children:"promptEnv"})," feature."]})]})}function h(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},31387(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/backgroundrunme-de927356e3e68604d253ca4ef57da364.png"},52069(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/add-naming-4a174341f44e08a6464ba7e4c8c9465a.png"},309(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/background-task-a15283aaaaf0c3f2855feec7557c26da.png"},1224(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/cell-level-npm-install-f704db268e55395e5e988f4baeca895b.png"},31186(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/cell-naming-6c25e6ee18b027e1d58175e46e4db0de.png"},43887(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/configure-cell-level-69d3ee03aaaa821d8fb61f5a4999c380.png"},78656(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/example-cell-51ef0d57166d273ecdbeb928949750a1.png"},28929(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/npm-install-configure-f1dba886d20dd56713621935903640fc.png"},9019(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/shebang-cell-level-262bb4fd9c90f61ab09ddfb3b0de48cb.png"},48256(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/promptenv-output-3412f61104e54cc779e0c704e232e15a.png"},73341(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/promptsenv-1905593578e71faf63d5cc0f1c48309b.png"},79474(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/human-centric-output-b9290d4818822a18e4e45700efa7592a.png"},29027(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/interactive-execution-46d0d65215954b7ac770448a5394051d.png"},89676(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/mimetype-fd89564e6d34c36c4d84df6b6ee80bdf.png"},39967(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/promptenv-runme-51f1b2d87c873ce22e9c04c8e57adb13.png"},23602(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/runme-background-c3e800335f11480e1355871667057fdd.png"},60390(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/runme-cwd-aaada8f48d04993735c3dfc62e1a928d.png"},96400(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/runme-interactive-ffda3de201191fa9d548dcbc0d7667b6.png"},79548(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/terminalrow-1-9cce03c0e6cf07d485d77e2131fe359e.png"},68279(e,n,i){i.d(n,{A:()=>t});const t=i.p+"assets/images/terminalrow-2-052c7909114962505a9e3038cf4236e5.png"},28453(e,n,i){i.d(n,{R:()=>r,x:()=>o});var t=i(96540);const s={},l=t.createContext(s);function r(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.