Skip to content

Integration with VS Code Notebooks #411

Open

Description

@ThomasNieto

Describe "Functionality"

I just read the PS blog on PowerShell VS Code notebook public preview and the first thing I thought where this might be useful was in PSKoans.

Its able to take ps1 scripts with comments formatted in markdown and display that in a notebook view. The code is then in a panel and is able to run in the same view like in a Jupyter notebook.

Context "Private or Public? What are the use cases? Parameters? Options?"

This can give additional formatting and "UI" around each Koan for people who just want to see the instructions and code snippet they're working on instead of the whole script.

Context "Additional Information"

Activity

  1. vexx32 commented on Aug 1, 2020

    @vexx32
    Collaborator

    Hmm, that could prove interesting. I'll have to have a look at how the koans render in the Notebook mode. All the examples given in the blog post are pretty tame, no indication of how a comment inside a scriptblock is rendered...

    Perhaps it's worth asking @TylerLeonhardt and possibly others whether a Pester test could be rendered in a specific way that might help us out. 😉

  2. TylerLeonhardt commented on Aug 1, 2020

    @TylerLeonhardt

    Pester tests are a weird one because they have huge blocks of code.

    Markdown cells in the mix of that would break those up.... Unless the describe blocks are small... But I don't think that's true for PSKoans, right?

  3. vexx32 commented on Aug 1, 2020

    @vexx32
    Collaborator

    Yeah, not really, no... the general format is:

    <#
        Introductory paragraph(s).
    #>
    Describe 'Thing' {
    
        Context 'Part 1' {
            <#
                Detail sentence/paragraph(s)
            #>
            ...
        }
    
        Context 'Part 2' {
            <#
                Detail sentence/paragraph(s)
            #>
            ...
        }
    }

    Many of the It blocks have comments, too.

    I was wondering if it's possible to define a custom view for the notebook mode? Such that, for example, for PSKoans it could render Describe / Context / It as various heading levels, and then comments more or less where they're at in the code (as Markdown), with the code for each It block being a discrete code block or something.

  4. TylerLeonhardt commented on Aug 1, 2020

    @TylerLeonhardt

    Yeah this would need a substantial change to Notebook Mode...

    With that said, maybe there is an opportunity to implement a Notebook UI in https://github.com/TylerLeonhardt/vscode-powershell-test-adapter

    Where the play button would run the test/tests inside the code block.

  5. TylerLeonhardt commented on Aug 1, 2020

    @TylerLeonhardt

    I don't really have time to work on that, but such an experience could be realized that way

  6. vexx32 commented on Aug 1, 2020

    @vexx32
    Collaborator

    Appreciate the pointers! 💖 It'll be something to look into when I get some time 🙂

  7. github-actions commented on Sep 21, 2026

    @github-actions

    This issue has had no activity for 60 days. It will be closed in 30 days unless there is new activity or a maintainer removes the stale label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions