Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update README.md of examples-clang-format #161

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 51 additions & 19 deletions examples/clang-format/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,55 @@
# `clang-format` Example
# `examples-clang-format`

This `clang-format` example is provided to showcase the features included in `clang-format`.
This example demonstrates the features included in `clang-format`.

To see which commands are available, check the `scripts` property in `package.json`.

## Running a Command

For example, to run the `unformatted:cpp:dry-run` command:

- From the root directory (`/`)

```bash
npm run unformatted:cpp:dry-run -w examples/clang-format
```

- From the `examples/clang-format` directory (`/examples/clang-format`)

```bash
cd examples/clang-format

npm run unformatted:cpp:dry-run
```
## Getting Started

You can run the example by choosing one of the following two methods.

### Run from the Root

You can start the example by running the following commands from the root directory:

```sh
npm run formatted:c -w examples/clang-format
# or
npm run formatted:c:dry-run -w examples/clang-format
# or
npm run formatted:cpp -w examples/clang-format
# or
npm run formatted:cpp:dry-run -w examples/clang-format
# or
npm run unformatted:c -w examples/clang-format
# or
npm run unformatted:c:dry-run -w examples/clang-format
# or
npm run unformatted:cpp -w examples/clang-format
# or
npm run unformatted:cpp:dry-run -w examples/clang-format
```

### Navigate to the Directory and Run

Navigate to the `examples/clang-format` directory and then run the following commands to start the example:

```sh
cd examples/clang-format

npm run formatted:c
# or
npm run formatted:c:dry-run
# or
npm run formatted:cpp
# or
npm run formatted:cpp:dry-run
# or
npm run unformatted:c
# or
npm run unformatted:c:dry-run
# or
npm run unformatted:cpp
# or
npm run unformatted:cpp:dry-run
```