-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Labels
Description
Description
Part of Azure/azure-sdk-tools#12851.
Add an --md flag to azpysdk apistub. When passed, the command will additionally run Export-APIViewMarkdown.ps1 on the generated JSON token file to produce api.md.
azpysdk apistub . --mdPotential Implementation
Changes to eng/tools/azure-sdk-tools/azpysdk/apistub.py:
- Add
--mdflag (action="store_true", defaultFalse) in theregister()method. - After successfully writing the JSON token file, if
--mdis set, invoke viasubprocess:Ifsubprocess.run( ["pwsh", "eng/common/scripts/Export-APIViewMarkdown.ps1", "-TokenJsonPath", <json_file>, "-OutputPath", <out_dir>], check=True )
pwshis not available, fail with a clear error. - Place
api.mdin the same output directory as the token file (under<dest-dir>/<package-name>/if--dest-diris provided).
Deliverables
azpysdk apistubsupports a new--mdto create anapi.mdfile, which is output to the same directory as the APIView token file.- If
pwshis not available, the utility fails gracefully with a clear error message.
Reactions are currently unavailable