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

Fix Get-Help links (in the Pester source files) #8

Closed
bravo-kernel opened this issue Dec 22, 2019 · 9 comments
Closed

Fix Get-Help links (in the Pester source files) #8

bravo-kernel opened this issue Dec 22, 2019 · 9 comments
Assignees
Labels
get-help Issues related to auto-generated Command Reference good first issue Good for newcomers help wanted Extra attention is needed

Comments

@bravo-kernel
Copy link
Collaborator

The auto-generated Command Reference pages use the Get-Help information produced by Pester. PlatyPS is used to make the first conversion to markdown, Alt3.Docusaurus.Powershell then enriches the markdown so it becomes compatible with Docusaurus.

The Pester sources may contain Get-Help .LINK sections which are converted to External Links as shown below:

image

As you can see there are currently two issues, to be fixed in the Pester source file:

  1. the link to the wiki is no longer valid
  2. the second link uses a wiki-specific ref that is no longer valid

Another issue that might occur in the source files is this example taken from https://github.com/pester/Pester/blob/master/Functions/Mock.ps1:

.LINK
Assert-MockCalled
Assert-VerifiableMock
Describe
Context
It
about_Should
about_Mocking

which leads to this funky link in the browser:

image

Should be fixed by creating separate .LINK entities as per the specification. E.g.

.LINK
    Assert-MockCalled

.LINK
    Assert-VerifiableMock

.LINK
    Describe

.LINK
    Context

.LINK
    It

.LINK
    about_Should

.LINK
    about_Mocking
@bravo-kernel bravo-kernel added the get-help Issues related to auto-generated Command Reference label Dec 22, 2019
@bravo-kernel bravo-kernel added the help wanted Extra attention is needed label Jan 4, 2020
@bravo-kernel bravo-kernel added the good first issue Good for newcomers label Jan 18, 2020
@deejaygraham
Copy link
Contributor

I can pick this one up.

@bravo-kernel
Copy link
Collaborator Author

Cool, that would be awesome. Please keep a couple of things in mind.

  • all links in the source should probably be a direct link to the corresponding pester.dev website (e.g. replacce It with the full link (or the website links will not work)
  • we should probably make this a co-op. You make the changes in Pester repository, I use your Pester PR branch to generate a PR in this repository with the auto-generated command reference here.

Does that sound ok to you?

@deejaygraham
Copy link
Contributor

Yes, think so.

@deejaygraham
Copy link
Contributor

Broke the blocks of links into separate chunks yesterday but before I go any further, I want to check about the actual link text. I get that some are using the old url and the wrong page name that can be fixed. I am more wondering about whether each command should have an online link to the docs . For example I think this is correct (with comments afterwards):

Context

...

.LINK
https://pester.dev/docs/commands/Context (change url)

.LINK
Describe (related command, leave as is ?)

.LINK
about_Should (related command, leave as is ?)

@bravo-kernel
Copy link
Collaborator Author

I guess @nohwnd should check your Pester PR, see what he thinks.

@bravo-kernel
Copy link
Collaborator Author

If you are for example suggesting we should leave ‘about_Should’ exactly that text then I wonder what happens inside Docusaurus. Does it produce a valid URL by itself? If not, changing it to full url should be the best solution IMO but that’s personal. I prefer to see full links when running Get-Help but... perhaps other systems/tools expect this format.

Apologies for the long text, was a bit of a long day

@deejaygraham
Copy link
Contributor

No, no problem. I'll make a PR as it is with fixed links etc. but leave the rest alone for now and we can see what opinions come out.

@bravo-kernel
Copy link
Collaborator Author

Aha, I think I understand now. I will generate a PR here using your Pester PR somewhere this Friday or weekend. That way we can reason about/view the outcome. Thanks again!

deejaygraham added a commit to deejaygraham/Pester that referenced this issue Jan 23, 2020
From pester/docs#8

Changed all links from pester/wiki to new pester.dev. Added some extra .LINK entries to online docs where missing on some commands.
@deejaygraham
Copy link
Contributor

pester/Pester#1432

Added a note about what the correct format is for all .LINK entries.

nohwnd pushed a commit to pester/Pester that referenced this issue Jan 24, 2020
* Fix Get-Help links

From pester/docs#8

Changed all links from pester/wiki to new pester.dev. Added some extra .LINK entries to online docs where missing on some commands.

* Full urls in link blocks

Changed all .LINK sections to be full urls.
Removed self-referencing links or replaced with complenting command. Eg. BeforeEach and AfterEach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
get-help Issues related to auto-generated Command Reference good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants