pnp / pnpframework

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions
https://pnp.github.io/pnpframework/
MIT License
204 stars 141 forks source link

Add Markdown Template Provider #25

Closed kevmcdonk closed 3 years ago

kevmcdonk commented 3 years ago

I've been looking at a way to get a friendly way of viewing a PnP template as a document of a site. After trying out a few ways of manipulating the XML but feel that getting it out as a TemplateProvider would be a great way and then have pnppowershell allowing .md files as an -Out format.

Before I go too far down that path of that in a fork, would that likely to be accepted as a PR?

I am thinking of having a set of Writers similar to the XmlSerializers that would build up a TextWriter object. That would then be pushed out in the stream for ToFormattedTemplate.

jansenbe commented 3 years ago

Adding @PaoloPia , @erwinvanhunen for awereness

jansenbe commented 3 years ago

@kevmcdonk : sorry for the late reply, but yes we would love to see a PR bringing the template to markdown documentation feature. This can be a super useful feature for customers more easily see what's inside a template and document it.

kevmcdonk commented 3 years ago

Working on it in a branch and you can see an example of how the output is looking at https://github.com/cpsglobal/pnpframework/blob/dev/docs/ProvisioningExportMarkdownSample.md. Site Columns looking good. Content Types and List Instances need work to make them look more like you would see from the settings in SharePoint themselves.

kevmcdonk commented 3 years ago

I've just submitted a PR for this. To be truly useful, it will need updates to PnP PowerShell but I'm keeping them as two different steps for now.

https://github.com/pnp/pnpframework/pull/39

jansenbe commented 3 years ago

Thanks @kevmcdonk , @erwinvanhunen merged your PR here and already started working on an integration in the PnP PS cmdlets. Thanks for this great PR.

kevmcdonk commented 3 years ago

I've got a bit of working code for PnP. Only issue was that it needed the reference to the updated version before I could do a PR. Do you want me to submit it?

jansenbe commented 3 years ago

Don't think that's needed at this point, if so I'll let you know.