You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swagger and TypeSpec both have all description string written in Markdown. In Pythonn, docstring are expected to be written in RST. In order to get our doc processor to generate valid documentation, it's important that we convert the MD syntax into RST syntax.
For example, this code in MD:
# Example Title
This is an example paragraph in **Markdown**. You can include _italicized text_ and **bold text**. Here's a link to [Microsoft's website](https://www.microsoft.com).
should be written in SDK in RST as:
Example Title
=============
This is an example paragraph in **reStructuredText**. You can include *italicized text* and **bold text**. Here's a link to `Microsoft's website <https://www.microsoft.com>`_.
We're doing this conversion today using m2r which is a Python library. There are a few problems with it:
It requires dependencies, and those are non trivial to support
It's buggy, and we got issue in the past
It's slow (we don't have the metrics, but I know it's slow :))
Work is to rewrite it in TypeScript. IOW, create a function like:
functionmdToRst(input: string): string{// You can add any processing logic herereturn`Processed string: ${input}`;}
Expectation of that works includes finding the unittests, investigate what exists today in TypeSpec and Swagger (ideally as a bulk, Swagger can be investigate by parsing them as JSON, Typespec can be investigate by generating the Swagger first), plug it in the codegen, and run tests across many SDKs to look for diff.
A few notes:
It's likely necessary to write this manually (I would be surprised the TypeScript world has a tool for that), but if a tool exist it's ok to start with that
It's probably unecessary anyway to support the entire set of MD syntax. Investigation can tell us how much work we need, and maybe a few lines of regexp replace are enough.
There are MD parser in TypeScript, it's likely a good idea to start with that and build a renderer
Estimated cost: 3 weeks
The text was updated successfully, but these errors were encountered:
Swagger and TypeSpec both have all description string written in Markdown. In Pythonn, docstring are expected to be written in RST. In order to get our doc processor to generate valid documentation, it's important that we convert the MD syntax into RST syntax.
For example, this code in MD:
should be written in SDK in RST as:
We're doing this conversion today using
m2r
which is a Python library. There are a few problems with it:Work is to rewrite it in TypeScript. IOW, create a function like:
Expectation of that works includes finding the unittests, investigate what exists today in TypeSpec and Swagger (ideally as a bulk, Swagger can be investigate by parsing them as JSON, Typespec can be investigate by generating the Swagger first), plug it in the codegen, and run tests across many SDKs to look for diff.
A few notes:
Estimated cost: 3 weeks
The text was updated successfully, but these errors were encountered: