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

Remove all HTML tags from code comments #6876

Open
2 tasks
pallymore opened this issue Feb 10, 2025 · 3 comments
Open
2 tasks

Remove all HTML tags from code comments #6876

pallymore opened this issue Feb 10, 2025 · 3 comments
Assignees
Labels
documentation This is a problem with documentation. feature-request New feature or enhancement. May require GitHub community feedback. investigating Issue is being investigated and/or work is in progress to resolve the issue. p3 This is a minor priority issue

Comments

@pallymore
Copy link
Member

Describe the feature

Hi -

It appears for some service clients there are HTML tags being included in the code comments - they make the hover docs very hard to read in editors (e.g. neovim).

Other SDK clients, like aws-sdk-go-v2 does not seem to have these tags - please consider removing them from the SDK client for better developer experience.

Thanks!

Example of this happening in the ECS Client code: https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-ecs/src/models/models_0.ts#L11815

Example go-sdk-v2 code for the same model: https://github.com/aws/aws-sdk-go-v2/blob/main/service/ecs/api_op_RegisterTaskDefinition.go#L51

Example of how this looks in the edtior:

Image

Use Case

I'm always frustrated when the hover docs in my editor shows a bunch of HTML tags, they don't make the documents easy to read, sometimes they make a huge mess with long anchor tags and wrapped formatting, for example: https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-ecs/src/models/models_0.ts#L11861-L11865

Proposed Solution

Compare to how SDK for Golang v2 generates these docs, and properly strip all HTML tags while preserving the formatting in the generated SDK code.

Other Information

n/a

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

3.744.0

Environment details (OS name and version, etc.)

macOS 15.3, Amazon Linux 2

@pallymore pallymore added feature-request New feature or enhancement. May require GitHub community feedback. needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
@zshzbh zshzbh self-assigned this Feb 10, 2025
@zshzbh zshzbh added p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
@zshzbh
Copy link
Contributor

zshzbh commented Feb 10, 2025

I think those html tags are generated for the js documentation.
For Go doc - https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#ECS.RegisterTaskDefinitionRequest It’s more like plain text so using comments would be enough
Image
For JS doc - https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/RegisterTaskDefinitionRequest/ we render beautiful layout using html tags so it has different sections, code, links and etc.

Image

I'm contacting the doc team internally and will keep you updated!

Thanks!

@zshzbh zshzbh added investigating Issue is being investigated and/or work is in progress to resolve the issue. documentation This is a problem with documentation. labels Feb 10, 2025
@pallymore
Copy link
Member Author

Thanks for the quick response.

The issue is HTML tags do not work well in many code editors (at least not out of the box) - looks like there was a similar ticket being reported before: #2920

I'm all for nice looking docs, but they shouldn't come at the cost of degrading developer experience in their editors.

@pallymore
Copy link
Member Author

pallymore commented Feb 18, 2025

a bit more information here - Go SDK is generated from the same models: https://github.com/aws/aws-sdk-go-v2/blob/main/codegen/sdk-codegen/aws-models/ecs.json (with HTML tags in the model file) - but the generated code does not have these tags, while still preserving ideal formatting for the code comments to be consumed in code editors.

maybe this is their secret sauce: https://github.com/aws/aws-sdk-go-v2/blob/54aed732316b5162e5c4382a1f2d3891175d0254/internal/codegen/docstring.go#L153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. feature-request New feature or enhancement. May require GitHub community feedback. investigating Issue is being investigated and/or work is in progress to resolve the issue. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

3 participants
@pallymore @zshzbh and others