Skip to content

Commit d367267

Browse files
authored
docs: remove headings from method doc (#30965)
### Issue # (if applicable) The documentation for [Stack#exportValue](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html#exportwbrvalueexportedvalue-options) contains an “Example” section formatted as an H2 with two H3 sub-sections, whereas the method signature uses an H3. When generating documentation for CDK libraries inheriting from Stack, and jsii duplicates this “Example” section for each stack in the application in the API.md, this formatting issue causes a disruption in the heading hierarchy. This is particularly problematic on constructs.dev, where H3 headings are listed in the sidebar. Examples can be seen at: - https://constructs.dev/packages/@condensetech/cdk-constructs/v/0.1.2?lang=typescript - https://constructs.dev/packages/@cloudcomponents/cdk-temp-stack/v/2.4.0?lang=typescript - https://constructs.dev/packages/@gammarers/aws-lambda-function-invoke-error-notification-stack/v/1.0.49?lang=typescript ### Reason for this change By removing any heading from the method doc, there's no risk of altering the generated markdown hierarchy ### Description of changes I've removed the headings from the method documentation ### Description of how you validated changes N/A ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a737e40 commit d367267

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/aws-cdk-lib/core/lib/stack.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,6 @@ export class Stack extends Construct implements ITaggable {
11711171
* remove the reference from the consuming stack. After that, you can remove
11721172
* the resource and the manual export.
11731173
*
1174-
* ## Example
1175-
*
11761174
* Here is how the process works. Let's say there are two stacks,
11771175
* `producerStack` and `consumerStack`, and `producerStack` has a bucket
11781176
* called `bucket`, which is referenced by `consumerStack` (perhaps because
@@ -1183,7 +1181,7 @@ export class Stack extends Construct implements ITaggable {
11831181
*
11841182
* Instead, the process takes two deployments:
11851183
*
1186-
* ### Deployment 1: break the relationship
1184+
* **Deployment 1: break the relationship**:
11871185
*
11881186
* - Make sure `consumerStack` no longer references `bucket.bucketName` (maybe the consumer
11891187
* stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just
@@ -1193,7 +1191,7 @@ export class Stack extends Construct implements ITaggable {
11931191
* between the two stacks is being broken.
11941192
* - Deploy (this will effectively only change the `consumerStack`, but it's safe to deploy both).
11951193
*
1196-
* ### Deployment 2: remove the bucket resource
1194+
* **Deployment 2: remove the bucket resource**:
11971195
*
11981196
* - You are now free to remove the `bucket` resource from `producerStack`.
11991197
* - Don't forget to remove the `exportValue()` call as well.

0 commit comments

Comments
 (0)