Skip to content

Conversation

@timayabi2020
Copy link
Contributor

This pull request was automatically created by Azure Pipelines. Important Check for unexpected deletions or changes in this PR.

@timayabi2020 timayabi2020 changed the base branch from features/2.0 to dev July 6, 2023 13:54
@timayabi2020 timayabi2020 requested a review from a team as a code owner July 11, 2023 10:21
#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"
Copy link
Member

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 }}.

Copy link
Contributor Author

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.

Copy link
Member

@peombwa peombwa Jul 12, 2023

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.

Copy link
Contributor Author

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

timayabi2020 and others added 2 commits July 12, 2023 10:57
Co-authored-by: Peter Ombwa <peombwa@microsoft.com>
@peombwa peombwa mentioned this pull request Jul 12, 2023
@timayabi2020 timayabi2020 merged commit cdc4f05 into dev Jul 13, 2023
@peombwa peombwa deleted the WeeklyExamplesUpdate/202307061205 branch July 14, 2023 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants