---
readOnly: true
---

# Writing Code

Writing `code` in `.lit` files. 
For a general oevrview of markdown syntax see [[Learning Markdown]], this document covers only `code` cells.

## Basic code blocks

    // Just a basic code block
    // No language definition for 
    // Syntax highlighting etc. etc.

## Fenced code blocks

```
a plain text code cell
```

```js
console.log("A javscript cell")
```

```js
return "a String"
```

```js
throw new Error('My Error')
```

## Metadata

```ext#name.tag[attr="value"]
// Fenced code block with extended metadata
```

## Outputs

```js>md.tag
console.log('**Markdown**')
```

```js>md
return `- [x] A list item _${Date.now()}_`
```
```>md
- [x] A list item _1234567_
```