Skip to content

Commit 123ac38

Browse files
committed
docs syntax highlighting improvements
1 parent 659c30a commit 123ac38

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

docs/01-get-started/03-golang-hello-world.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ func helloWorldActivity(ctx context.Context, name string) (string, error) {
153153

154154
Don't forget to register the workflow and activity to the worker.
155155

156-
```Go
156+
```go
157157
func init() {
158158
workflow.Register(helloWorldWorkflow)
159159
activity.Register(helloWorldActivity)
160160
}
161161
```
162162

163163
Import the `context` module if it was not automatically added.
164-
```Go
164+
```go
165165
import (
166166
"context"
167167
)
@@ -176,7 +176,7 @@ cadence --domain test-domain workflow start --et 60 --tl test-worker --workflow_
176176
```
177177

178178
You should see logs in your worker terminal like
179-
```bash
179+
```log
180180
2023-07-16T11:30:02.717-0700 INFO cadence-worker/code.go:104 Workflow completed. {"Domain": "test-domain", "TaskList": "test-worker", "WorkerID": "11294@uber-C02F18EQMD6R@test-worker@5829c68e-ace0-472f-b5f3-6ccfc7903dd5", "WorkflowType": "main.helloWorldWorkflow", "WorkflowID": "8acbda3c-d240-4f27-8388-97c866b8bfb5", "RunID": "4b91341f-056f-4f0b-ab64-83bcc3a53e5a", "Result": "Hello World!"}
181181
```
182182

docs/03-concepts/04-queries.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Cadence team is currently working on implementing _update_ feature that would be
1919
The Cadence client libraries expose some predefined :query:queries: out of the box. Currently the only supported built-in :query: is _stack_trace_. This :query: returns stacks of all :workflow: owned threads. This is a great way to troubleshoot any :workflow: in production.
2020

2121
Example
22-
```
23-
$cadence --do samples-domain wf query -w <workflowID> -qt __stack_trace
22+
<!-- TODO: enable wordWrap on this codeblock, at the moment its not yet supported. https://github.com/facebook/docusaurus/issues/7875 -->
23+
```sh wordWrap=true
24+
cadence --do samples-domain wf query -w <workflowID> -qt __stack_trace
25+
2426
"coroutine 1 [blocked on selector-1.Select]:\nmain.sampleSignalCounterWorkflow(0x1a99ae8, 0xc00009d700, 0x0, 0x0, 0x0)\n\t/Users/qlong/indeed/cadence-samples/cmd/samples/recipes/signalcounter/signal_counter_workflow.go:38 +0x1be\nreflect.Value.call(0x1852ac0, 0x19cb608, 0x13, 0x1979180, 0x4, 0xc00045aa80, 0x2, 0x2, 0x2, 0x18, ...)\n\t/usr/local/Cellar/go/1.16.3/libexec/src/reflect/value.go:476 +0x8e7\nreflect.Value.Call(0x1852ac0, 0x19cb608, 0x13, 0xc00045aa80, 0x2, 0x2, 0x1, 0x2, 0xc00045a720)\n\t/usr/local/Cellar/go/1.16.3/libexec/src/reflect/value.go:337 +0xb9\ngo.uber.org/cadence/internal.(*workflowEnvironmentInterceptor).ExecuteWorkflow(0xc00045a720, 0x1a99ae8, 0xc00009d700, 0xc0001ca820, 0x20, 0xc00007fad0, 0x1, 0x1, 0x1, 0x1, ...)\n\t/Users/qlong/go/pkg/mod/go.uber.org/[email protected]/internal/workflow.go:372 +0x2cb\ngo.uber.org/cadence/internal.(*workflowExecutor).Execute(0xc000098d80, 0x1a99ae8, 0xc00009d700, 0xc0001b127e, 0x2, 0x2, 0xc00044cb01, 0xc000070101, 0xc000073738, 0x1729f25, ...)\n\t/Users/qlong/go/pkg/mod/go.uber.org/[email protected]/internal/internal_worker.go:699 +0x28d\ngo.uber.org/cadence/internal.(*syncWorkflowDefinition).Execute.func1(0x1a99ce0, 0xc00045a9f0)\n\t/Users/qlong/go/pkg/mod/go.uber.org/[email protected]/internal/internal_workflow.go:466 +0x106"
2527
```

docs/03-concepts/10-http-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To enable “start workflow” HTTP API, add `http` section to Cadence RPC confi
2525
services:
2626
frontend:
2727
rpc:
28-
<...>
28+
# ...
2929
http:
3030
port: 8800
3131
procedures:

docs/04-java-client/14-exception-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Exceptions thrown by a workflow are received by a workflow client wrapped into `
1616
In this [example](https://github.com/cadence-workflow/cadence-java-samples/blob/master/src/main/java/com/uber/cadence/samples/hello/HelloException.java) a Workflow Client executes a workflow which executes a child workflow which
1717
executes an activity which throws an IOException. The resulting exception stack trace is:
1818

19-
```
19+
```log
2020
com.uber.cadence.client.WorkflowFailureException: WorkflowType="GreetingWorkflow::getGreeting", WorkflowID="38b9ce7a-e370-4cd8-a9f3-35e7295f7b3d", RunID="37ceb58c-9271-4fca-b5aa-ba06c5495214
2121
at com.uber.cadence.internal.dispatcher.UntypedWorkflowStubImpl.getResult(UntypedWorkflowStubImpl.java:139)
2222
at com.uber.cadence.internal.dispatcher.UntypedWorkflowStubImpl.getResult(UntypedWorkflowStubImpl.java:111)

docs/04-java-client/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The following are important links for the Cadence Java client:
1717

1818
Add *cadence-client* as a dependency to your *pom.xml*:
1919

20-
```
20+
```xml
2121
<dependency>
2222
<groupId>com.uber.cadence</groupId>
2323
<artifactId>cadence-client</artifactId>
@@ -27,15 +27,15 @@ Add *cadence-client* as a dependency to your *pom.xml*:
2727

2828
or to *build.gradle*:
2929

30-
```
30+
```gradle
3131
dependencies {
3232
implementation group: 'com.uber.cadence', name: 'cadence-client', version: 'LATEST.RELEASE.VERSION'
3333
}
3434
```
3535

3636
If you are using [gradle 6.9 or older](https://docs.gradle.org/current/userguide/upgrading_version_6.html#sec:configuration_removal), you can use `compile group`
3737

38-
```
38+
```gradle
3939
dependencies {
4040
compile group: 'com.uber.cadence', name: 'cadence-client', version: 'LATEST.RELEASE.VERSION'
4141
}

docs/05-go-client/18-workflow-replay-shadowing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ replayer.RegisterWorkflow(myWorkflowFunc2, workflow.RegisterOptions{
5252

5353
Replayer can read workflow history from a local json file or fetch it directly from the Cadence server. If you would like to use the first method, you can use the following CLI command, otherwise you can skip to the next step.
5454

55-
```
55+
```bash
5656
cadence --do <domain> workflow show --wid <workflowID> --rid <runID> --of <output file name>
5757
```
5858

docs/06-cli/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ The Cadence :CLI: is a command-line tool you can use to perform various :task:ta
1313
## Using the CLI
1414

1515
### Homebrew
16-
```
16+
```bash
1717
brew install cadence-workflow
1818
```
1919

2020
After the installation is done, you can use CLI:
21-
```
21+
```bash
2222
cadence --help
2323
```
2424
This will always install the latest version. Follow [this instructions](https://github.com/cadence-workflow/cadence/discussions/4457) if you need to install older versions of Cadence CLI.
@@ -49,7 +49,7 @@ docker run -it --rm ubercadence/cli:master --address host.docker.internal:7933 -
4949
NOTE: Be sure to update your image when you want to try new features: `docker pull ubercadence/cli:master `
5050

5151
NOTE: If you are running docker-compose Cadence server, you can also logon to the container to execute CLI:
52-
```
52+
```bash
5353
docker exec -it docker_cadence_1 /bin/bash
5454

5555
# cadence --address $(hostname -i):7933 --do samples domain register
@@ -68,8 +68,8 @@ Alternatively, you can build the CLI image, see [instructions](https://github.co
6868
## Documentation
6969
CLI are documented by `--help` or `-h` in ANY tab of all levels:
7070

71-
```
72-
$cadence --help
71+
```sh-session
72+
$ cadence --help
7373
NAME:
7474
cadence - A command-line tool for cadence users
7575

@@ -95,8 +95,8 @@ GLOBAL OPTIONS:
9595
--version, -v print the version
9696
```
9797
And
98-
```
99-
$cadence workflow -h
98+
```sh-session
99+
$ cadence workflow -h
100100
NAME:
101101
cadence workflow - Operate cadence workflow
102102

@@ -132,8 +132,8 @@ OPTIONS:
132132
--help, -h show help
133133
```
134134

135-
```
136-
$cadence wf signal -h
135+
```sh-session
136+
$ cadence wf signal -h
137137
NAME:
138138
cadence workflow signal - signal a workflow execution
139139

0 commit comments

Comments
 (0)