File: command-line.md

package info (click to toggle)
php-league-commonmark 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,260 kB
  • sloc: php: 20,378; xml: 1,988; ruby: 45; makefile: 21; javascript: 15
file content (53 lines) | stat: -rw-r--r-- 1,261 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
layout: default
title: Command Line
redirect_from: /command-line/
---

# Command Line

**This functionality has been deprecated in version 1.4 and will be removed in 2.0.**

Markdown can be converted at the command line using the `./bin/commonmark` script.

## Usage

```bash
./bin/commonmark [OPTIONS] [FILE]
```

- `-h`, `--help`: Shows help and usage information
- `--enable-em`: Disable `<em>` parsing by setting to `0`; enable with `1` (default: `1`)
- `--enable-strong`: Disable `<strong>` parsing by setting to `0`; enable with `1` (default: `1`)
- `--use-asterisk`: Disable parsing of `*` for emphasis by setting to `0`; enable with `1` (default: `1`)
- `--use-underscore`: Disable parsing of `_` for emphasis by setting to `0`; enable with `1` (default: `1`)

If no file is given, input will be read from STDIN.

Output will be written to STDOUT.

## Examples

### Converting a file named document.md

```bash
./bin/commonmark document.md
```

### Converting a file and saving its output

```bash
./bin/commonmark document.md > output.html
```

### Converting from STDIN

```bash
echo -e '# Hello World!' | ./bin/commonmark
```

### Converting from STDIN and saving the output

```bash
echo -e '# Hello World!' | ./bin/commonmark > output.html
```