Skip to content

Commit

Permalink
Docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
torhovland committed Jun 21, 2023
1 parent 39815e2 commit 16f9ad7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This name should be decided amongst the team before the release.

## [Unreleased]
[unreleased]: https://github.com/tweag/topiary/compare/v0.2.2...HEAD
* [#526](https://github.com/tweag/topiary/pull/526) Multi-line comments can be indented properly using the new predicate @multi_line_indent_all.

## [0.2.2] - 2023-06-12
[0.2.1]: https://github.com/tweag/topiary/compare/v0.2.1...v0.2.2
Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,18 +437,6 @@ The matched nodes will have a newline appended or prepended to them.
)
```

### `@single_line_no_indent`

The matched node will be printed alone, on a single line, with no indentation.

#### Example

```scheme
(#language! ocaml)
; line number directives must be alone on their line, and can't be indented
(line_number_directive) @single_line_no_indent
```

### `@append_indent_start` / `@prepend_indent_start`

The matched nodes will trigger indentation before or after them. This
Expand Down Expand Up @@ -607,6 +595,30 @@ match will be ignored.
)
```

### `@multi_line_indent_all`

To be used on comments or other leaf nodes, to indicate that we should indent
all its lines, not just the first.

#### Example

```scheme
(#language! ocaml)
(comment) @multi_line_indent_all
```

### `@single_line_no_indent`

The matched node will be printed alone, on a single line, with no indentation.

#### Example

```scheme
(#language! ocaml)
; line number directives must be alone on their line, and can't be indented
(line_number_directive) @single_line_no_indent
```

### Understanding the different newline captures

| Type | Single-Line Context | Multi-Line Context |
Expand Down

0 comments on commit 16f9ad7

Please sign in to comment.