Azure / azure-sdk-tools

Tools repository leveraged by the Azure SDK team.
MIT License
111 stars 176 forks source link

Service Level Overview pages should not have parens in the filenames #5433

Open danieljurek opened 1 year ago

danieljurek commented 1 year ago

It looks like the docs site doesn't support including those pages -- https://learn.microsoft.com/en-us/dotnet/api/overview/azure/data-lake-storage-(gen-1)?view=azure-dotnet

danieljurek commented 4 weeks ago

In the case of the above link, the service name has changed and now there are no more parentheses in the name. Files with parentheses in their names in this state (no longer referenced in a metadata CSV file) can be removed.

We should probably remove service-level overviews and package indexes when service names change.

Another example of this same behavior happening today live: https://learn.microsoft.com/en-us/dotnet/api/overview/azure/pool-management-service-(pmaas)?view=azure-dotnet

image

In this case, the [!INCLUDE section is attempting to include a filename with parentheses in the name: https://github.com/Azure/azure-docs-sdk-dotnet/blob/main/api/overview/azure/latest/pool-management-service-(pmaas).md?plain=1#L11C1-L11C64 pool-management-service-(pmaas)-index.md and this fails though the file does exist.

Is this behavior of the docs system by design for files that have parentheses in their filenames?

nickwalkmsft commented 3 weeks ago

@danieljurek Yes, in !INCLUDE links you need to backslash-escape the close paren character, like \).

nickwalkmsft commented 4 hours ago

The content for service-level readmes appears to be generated here:

https://github.com/Azure/azure-sdk-tools/blob/7c98f1b4554f73a9e6b53dca7816fc76c80e17cc/eng/common/scripts/Helpers/Service-Level-Readme-Automation-Helpers.ps1#L14-L15

If $indexTableLink has a ) character in it, it breaks parsing of the !INCLUDE statement on the Docs platform side, and the statement itself ends up in the rendered content instead of the contents of the included file.

The fix is to replace ) with \).