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

[Feature Request] Subfolders #129

Open
homotechsual opened this issue Jul 12, 2022 · 12 comments
Open

[Feature Request] Subfolders #129

homotechsual opened this issue Jul 12, 2022 · 12 comments

Comments

@homotechsual
Copy link

I have a few complex PS modules with 20-60 cmdlets, for the sake of clarity and discoverability we tend to group these by verb. Since discovering this module (phenomenal work btw!) I've added the ability to group cmdlets by verb in the resulting documentation as well as reflecting appropriately in the resulting sidebar with category pages. Would this be a useful addition to PR?

@homotechsual
Copy link
Author

From this:

image

To this:

image

@bravo-kernel
Copy link
Contributor

bravo-kernel commented Jul 13, 2022

Never thought about this but that is so smart, simply love it. Feel free to PR a switch parameter.

Bonus points if you can throw in a unit test to make sure that the "default" sidebar behavior does not break.

@bravo-kernel
Copy link
Contributor

@fflaten @nohwnd

@fflaten
Copy link
Contributor

fflaten commented Jul 13, 2022

@bravo-kernel Thanks for the tip. Personally don't think it's relevant for Pester due to DSL-type functions, but I fully support as optional feature for other modules 👏

@homotechsual Did you use a 2 or greater cmdlet threshold per group? Does it make sense to make it configurable in the feature? Personally I'd probably group all to please my OCD 😄

@homotechsual
Copy link
Author

I had it configurable in my "quick and dirty" setup and would probably keep it as such.

@homotechsual
Copy link
Author

homotechsual commented Jul 13, 2022

I'm currently trying to work out how much work it might be to have it a bit more open ended to allow for grouping by something other than "verb".

I've been thinking about the benefits potentially of grouping by "entity" but I'm not sure how I can easily "parse" that. I suppose the simplest option might be to group the same way as the source tree so that's my current exploration angle.

image

@homotechsual
Copy link
Author

The above is probably a pipe dream as we don't really have that information but it's fun to think about :-)

@bravo-kernel
Copy link
Contributor

@homotechsual if you want to give this a shot it would be great. Making the default non-discriminatory (and thus not 2+) would be my preference as suggested by @fflaten. Once the basics are in we can take it from there.

-GroupByVerb ?

@bravo-kernel
Copy link
Contributor

bravo-kernel commented Jul 13, 2022

@fflaten I have never seen or touched a DSL-type function but those would be AfterAll, AfterEach, BeforeEach, Should, etc correct?

-GroupByPascalCase but... I now see it indeed makes no sense. 👍

@fflaten
Copy link
Contributor

fflaten commented Jul 13, 2022

@fflaten I have never seen or touched a DSL-type function but those would be AfterAll, AfterEach, BeforeEach, Should, etc correct?

Yeah, domain-specific language. Basically specialized keywords unique to Pester, like the main building blocks It, Describe and Context.

@fflaten
Copy link
Contributor

fflaten commented Jun 20, 2024

A few suggestions, though it might belong in a separate issue and/or follow-up PR:

  • Could we allow custom groups? E.g. a dictionary with group title = regex-pattern? Ex. @{ 'Retrieve data' = '^Get-.*'; 'Update data' = '^Set-.*' } while unmatched files stays in the root
  • Can files stay flat? Subfolders change URLs which breaks links
    • Or include option to set slug: ../filename etc. to override the URL back to commands root

Scenario: Might consider this for Pester v6 to group many Should-* commands, while keeping the rest in the original flat structure. Don't want to break existing URLs.

If this is too edge case I'm fine with post-processing the sidebar-file, but worth suggesting while this has an active PR 🙂

@bravo-kernel
Copy link
Contributor

@fflaten feel free to implement this (as a separate PR). Not being lazy but the feature is still very valid but think it will require some (more) advanced PowerShell skills to get it done right.

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

No branches or pull requests

3 participants