PowerShell / PowerShell

PowerShell for every system!
https://microsoft.com/PowerShell
MIT License
44.17k stars 7.15k forks source link

HelpSystem should consume markdown natively #3954

Open SteveL-MSFT opened 7 years ago

SteveL-MSFT commented 7 years ago

HelpSystem currently relies on MAML based help. We have platyPS which converts markdown to MAML. The HelpSystem should understand markdown natively removing the conversion step.

iSazonov commented 6 years ago

If we'll directly read and parse Markdown files we have to rewrite all help subsystem which currently full based on xml/maml. If we'll rewrite the help sybsystem maybe use a lightweight DB engine like MongoDB? In the case we'll parse once with Update-Help and then import help info in a DB.

SteveL-MSFT commented 6 years ago

@iSazonov using a local noSQL DB like MongoDB may make sense. First step is to separate out the HelpSystem.

Once we can consume markdown natively, we can do some interesting stuff with rendering any markdown (not just Help) on the console

iSazonov commented 6 years ago

So do we need to implement a parser and a console renderer?

SteveL-MSFT commented 6 years ago

Would be best if we can use some existing OSS implementation

iSazonov commented 6 years ago

I see many parser implementations (PlatyPS?) but can not find console renderer.

SteveL-MSFT commented 6 years ago

Reusing PlatyPS. We will probably have to write a console renderer.

iSazonov commented 6 years ago

Interesting JavaScript implementation https://github.com/linuxenko/lessmd

vors commented 6 years ago

python implementation https://github.com/axiros/terminal_markdown_viewer

iSazonov commented 6 years ago

We have RFC to move HelpSystem out PowerShell Engine. So we should solve that we implement first.

MaximoTrinidad commented 6 years ago

Just curious!

This is not going to impact Windows PowerShell Help system? As, Windows PowerShell is complete. This is only for PSCore6. Right!!

Also, is this also going to impact the the online Microsoft Doc information?

:)

kvprasoon commented 6 years ago

IMO, this will be for PowerShell Core and PowerShell cmdlet docs are already using markdown .

MaximoTrinidad commented 6 years ago

@kvprasoon, Thanks!

SteveL-MSFT commented 6 years ago

@MaximoTrinidad correct, this change is only for PSCore6 which means for Windows PowerShell we'll continue to use platyPS to convert the markdown to MAML if that help is updated.

vors commented 6 years ago

One thought about smoothing the transition: when we will have HelpSystem in a separate module, we can add part of platyPS there, that can convert platyPS markdown to the tradition help objects on the fly. That way, users can stop shipping maml xmls earlier and package consumers can still get it in the traditional form.

iSazonov commented 6 years ago

In short from discussion with @vors

Perhaps we can not waste time and not separate the current system into a separate module. We can work on the new system right now. The main difficulty is the lack of ported console markdown renderer. We should consider to use https://github.com/rprichard/winpty although this may require a refactoring of the console output code.

SteveL-MSFT commented 6 years ago

Great discussion!

cc @daxian-dbw @adityapatwardhan who has been looking into this

iSazonov commented 6 years ago

Add about using winpty.

iSazonov commented 5 years ago

Since it is assigned to 6.3 I share follow. First, we need decouple HelpSystem to separate dll/module. This opens the way to the development of alternative HelpSystems. Current HelpSystem is fully integrated into Engine. We need design new public API for pluggable HelpSystems. Although at start we could do the separation using internal api and internal visibility. Some internal api from the engine are also used there and it is not clear what to do with it. Most likely we will have to convert Help function to binary cndlet. Also there can be some (1-2) breaking changes.

I could push WIP PR but only if MSFT team is ready to lead the work.

daxian-dbw commented 5 years ago

@iSazonov I think @adityapatwardhan already has code changes for a prototype that separates HelpSystem from the engine.

adityapatwardhan commented 5 years ago

Yes, I do have one. It does not compile completely yet though.

iSazonov commented 5 years ago

I tried to do it three times and understand what the problems are :-)

iSazonov commented 5 years ago

Can you (MSFT team) share current status? 7.0 milestone is best time to decouple the help subsystem and make it pluggable and extendable.

I suggest the plan (see my comment above):

  1. Move Help Sybsystem to separate dll. It requires changing internal API in engine.
  2. Make it pluggable. It is breaking change and it requires new public API. It is very simple API.
  3. Implement new Help module with Markdown support.
vexx32 commented 5 years ago

@stevel-msft mentioned on Twitter that this was something he would like to look at doing for v7.

Not sure what the necessary work volume is for this, though. :)

iSazonov commented 5 years ago

Points 1 and 2 from list above is low volume, point 3 is high volume but can be implemented step by step without removing current Help system..

SteveL-MSFT commented 5 years ago

I think we should separate moving the HelpSystem out of SMA.dll as independent of this enhancement. That would be nice to have, but not critical for PS7. We should definitely have this in PS7 so we don't need MAML. However, we also need to change how we publish updateable help so that we have zips with just markdown, but need to keep MAML publishing for downlevel PS.

iSazonov commented 5 years ago

@SteveL-MSFT Do you mean that you have plans to integrate Markdown to current HelpSystem? I'm afraid it will complicate the module significantly, make it much more difficult to move the module out SMA and further full decouple. I'd prefer that we implement new module with Markdown support. Before it becomes stable, users could continue to use the old module. In my last attempt, I advanced about 80% so that we could really do it.

SteveL-MSFT commented 5 years ago

@iSazonov preference would be to separate out HelpSystem as separate module, if you have a work-in-progress prototype, perhaps you can submit a draft PR and @adityapatwardhan can just work off your branch (or maybe create a new branch in this repo like we did for .NET Core 3.0 port work).

iSazonov commented 5 years ago

@SteveL-MSFT The PR #9841 is created.

kvprasoon commented 2 years ago

@iSazonov Cleanup req here ?

iSazonov commented 2 years ago

@kvprasoon I don't understand your question. Please reword.

kvprasoon commented 2 years ago

I meant, PR created and linked are closed and the issue is still open.

iSazonov commented 2 years ago

:-) Ah. The PR was closed but not merged. MSFT team did not want to continue this work.

kvprasoon commented 2 years ago

ohh. ok

microsoft-github-policy-service[bot] commented 8 months ago

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

microsoft-github-policy-service[bot] commented 8 months ago

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

microsoft-github-policy-service[bot] commented 8 months ago

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

microsoft-github-policy-service[bot] commented 8 months ago

This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

SteveL-MSFT commented 5 months ago

This should include allowing for markdown in comment based help

theJasonHelmick commented 1 month ago

Based open recent work in PlatyPS, it is possible to build an object from the markdown. We currently plan to add markdown support in Help System V2.