-
Notifications
You must be signed in to change notification settings - Fork 213
[v2] Examples Update #2125
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
[v2] Examples Update #2125
Conversation
src/CloudCommunications/beta/examples/Get-MgBetaUserOnlineMeeting.md
Outdated
Show resolved
Hide resolved
…ing wrong examples
…urns a wrong example to an existing file with correct examples
…m/microsoftgraph/msgraph-sdk-powershell into WeeklyExamplesUpdate/202307061205
| #Replace everything with boiler plate code | ||
| $DefaultBoilerPlate = "### Example 1: {{ Add title here }}`r`n``````powershell`r`n PS C:\> {{ Add code here }}`r`n`n{{ Add output here }}`r`n```````n`n{{ Add description here }}`r`n`n### Example 2: {{ Add title here }}`r`n``````powershell`r`n PS C:\> {{ Add code here }}`r`n`n{{ Add output here }}`r`n```````n`n{{ Add description here }}`r`n`n" | ||
| Add-Content -Path $ExampleFile -Value $DefaultBoilerPlate.Trim() | ||
| $DefaultBoilerPlate = "### Example 1: {{ Add title here }}`r`n``````powershell`r`n PS C:\> {{ Add code here }}`r`n`n{{ Add output here }}`r`n```````n`n{{ Add description here }}`r`n`n### Example 2: {{ Add title here }}`r`n``````powershell`r`n PS C:\> {{ Add code here }}`r`n`n{{ Add output here }}`r`n```````n`n{{ Add description here }}`r`n`n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this logic of removing example placeholders isn't working as per this change in your PR - https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/80dcb83c163b428f266fe8988d0851771fc90b38/src/Calendar/beta/examples/New-MgBetaUserEventExtension.md.
You can for example consider a generic implementation like:
- Trim whitespaces from both ends of the string content (md file with placeholder text).
- Find and replace instances where the string content starts with
Example .*: {{ Add title here }}and ends in{{ Add description here }}.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The objective of that particular block is not to remove the boiler plate code. It instead sets it as a content to the md file incase the file contains nothing that matches the command name and also if whatever the content we are getting from the api reference does not match the command name. It therefore corrects any historical errors in regards to files that have examples not related to the command names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timayabi2020, what's the effect of leaving the example blank instead? We shouldn't be showing boiler plate text when an example doesn't exist in the cmdlet reference docs. Are you removing the boiler plate text in the SDK docs repro by any chance? If not, please create an issue to track this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I am removing them. However, I will create another issue to transfer that functionality from the reference docs pipeline to this example import script
Co-authored-by: Peter Ombwa <peombwa@microsoft.com>
This pull request was automatically created by Azure Pipelines. Important Check for unexpected deletions or changes in this PR.