Skip to content
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

Cleans up the Examples in the repository, and adds them to the Documentation #1333

Merged
merged 34 commits into from
Sep 2, 2024

Conversation

mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Jun 13, 2024

Changes:

  • Listener moved to localhost and port 8081 when possible,
  • Import-Module generate an exception if fails
  • Cleanup
  • Tested
  • Each Sample code include a .SYNOPSIS and .DESCRIPTION
  • New autogenerate document page with all sample code under /docs/Getting-Started
  • Pode.Build.ps1 automatically generate the sample code summary page
  • New Pester test to check that any sample code includes .SYNOPSIS and .DESCRIPTION and .NOTE

Header Example

<#
.SYNOPSIS
    A sample PowerShell script to set up a Pode server and integrate with Redis for caching.
.DESCRIPTION
    This script sets up a Pode server listening on port 8081 with Redis integration for caching.
    It checks for the existence of the `redis-cli` command and sets up a Pode server with routes
    that demonstrate caching with Redis.
.NOTES
    Author: Pode Team
    License: MIT License
#>

Changes:
Listener moved to localhost and port 8081 when possible
Import-Module generate an exception if fails
cleanup and executed
@mdaneri mdaneri mentioned this pull request Jul 1, 2024
@Badgerati Badgerati added this to the 2.11.0 milestone Jul 9, 2024
@Badgerati Badgerati changed the title Updated examples Cleans up the Examples in the repository Jul 9, 2024
@mdaneri
Copy link
Contributor Author

mdaneri commented Jul 10, 2024

I still need to do with this.
I plan to make a change in Pode.build.ps1 to automatically create an MD document with any example with a brief description + a test to check if any example has the correct header for the build to generate the page.
The Webhook sample is an example of what I mean

@Badgerati
Copy link
Owner

Aah I see, in a similar way to how the Function MDs are made with PlatyPS?

Couple of ideas, apologies if these are already planned! Would it be worth adding the following headers?

  • .LINK, with a URL back to the example in GitHub
  • .EXAMPLE, with how to invoke the script; which for most will likely just be some form of ./<file-name>.ps1

@mdaneri
Copy link
Contributor Author

mdaneri commented Jul 11, 2024

.LINK is available on the summary page
.EXAMPLE do you think is really needed?

examples/Casching.ps1 Outdated Show resolved Hide resolved
examples/Web-Signal.ps1 Outdated Show resolved Hide resolved
examples/sse.ps1 Outdated Show resolved Hide resolved
pode.build.ps1 Show resolved Hide resolved
tests/unit/_.Tests.ps1 Show resolved Hide resolved
examples/TcpServer-MultiEndpoint.ps1 Outdated Show resolved Hide resolved
examples/Rest-Api.ps1 Outdated Show resolved Hide resolved
examples/Nunit-RestApi.ps1 Outdated Show resolved Hide resolved
examples/Web-Pages.ps1 Outdated Show resolved Hide resolved
examples/Web-PagesDocker.ps1 Show resolved Hide resolved
@Badgerati Badgerati changed the title Cleans up the Examples in the repository Cleans up the Examples in the repository, and adds them to the Documentation Sep 2, 2024
@Badgerati Badgerati merged commit 40f9eaa into Badgerati:develop Sep 2, 2024
12 of 14 checks passed
@mdaneri mdaneri deleted the review_examples branch September 2, 2024 19:02
@Badgerati Badgerati mentioned this pull request Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants