iainbrighton / PScribo

PowerShell documentation framework
MIT License
231 stars 35 forks source link

Feature Request: Add support for output in markdown format #36

Open Bohem1 opened 7 years ago

Bohem1 commented 7 years ago

We should build support for markdown output. It should be treated as a first class plugin. Initially maybe support only Github flavor markdown but make it possible to expand so one can choose.

Stephanevg commented 7 years ago

I do have written this part already a bit back. Currently it is an external function for the moment, and I am not really sure how I I can completely integrate in pscribo. Any idea how?

iainbrighton commented 7 years ago

@Stephanevg I need to update the Plugin help to give you guys some guidance. If you already have part of this written, it will obviously help! Is this code hosted anywhere?

@Bohem1 @Stephanevg @irwins To write a plugin you need to write functions that will take an object (Section, Paragraph and Table etc.) are export it to the target format. Therefore, you will need to think about how you're going to render each PScribo component...

irwins commented 7 years ago

I was just looking through your PScribo HTML code. OutMD.ps1 & OutMD.Internal.ps1 is a start... ๐Ÿ˜€

iainbrighton commented 7 years ago

Yeah ๐Ÿ˜œ. It might be easier if you start with the OutText plugin rather than the HTML one (this includes a whole load of style formatting that you probably won't need)?

irwins commented 7 years ago

Markdown cheets For a quick reference! ๐Ÿ˜‰

irwins commented 7 years ago

@iainbrighton Thanks for the tip! Isee what you mean!

Stephanevg commented 7 years ago

@iainbrighton I have pasted it on a gist here -> https://gist.github.com/Stephanevg/f6409e7ab679872d69059943e5316c84

Basically, what this function does, is converting a pscribo document to MArkdown using the different ID's. There is a part I found on the internet somwhere, which I have (very) slightly modified.

Please let me know when (and how) I can integrate this in the plugin from Scribo.

Stรฉphane

irwins commented 7 years ago

@Stephanevg It's a lil more complicatedthan that... ๐Ÿ˜

I've been going through the structure (Gotta love vscode for this). The about_Pluginshelp.txt is a good start. The Matrixs tells you which features are support and which aren't or by means of options...

Plugin support matrix

Functionality Text XML HTML Word CSV MD
Document X X X X X X
GlobalOption X X X X X X
LineBreak X - X X - X
PageBreak 1 - 1 X - -
Paragraph 1 X 1 X 2 X
Section X X X X X X
Style - - X X - X
Table 3 3 X X 2 3
TableStyle - - X X - -
Image - 4 X X - -
  1. Can be implemented as LineBreaks with a plugin-specific option.
  2. Each table is output in its own CSV file.
  3. Table columns widths and styling are not supported.
  4. Image can be embedded as a binary Base64 encoded string.

Plugin-specific options In their own about file?

HTML: NoPageLayoutStyle [bool]: Suppresses the page layout/look-and-feel style

Writing a plugin

I feel like an intern. I'll probably get there but it'll take way longer! ๐Ÿ˜„. For me it's about the collaboration experience and getting hands on experience with Git/GitHub in general...

iainbrighton commented 7 years ago

I probably need to do 2 things to help you here:

  1. Write some "Writing a Plugin documentation"!
  2. Update the option handling code so there no duplication.

In the meantime @Bohem1 , @Stephanevg and @irwins (and for anyone else interested), we could look at hosting a 1 hour Skype/GoToMeeting session to take you though the text plugin and how that works. Is this of interest?

Stephanevg commented 7 years ago

Yeah good idea. Preferably in the evening of the week for me.

Le 9 mai 2017 10:36 PM, "Iain Brighton" notifications@github.com a รฉcrit :

I probably need to do 2 things to help you here:

  1. Write some "Writing a Plugin documentation"!
  2. Update the option handling code so there no duplication.

In the meantime @Bohem1 https://github.com/Bohem1 , @Stephanevg https://github.com/Stephanevg and @irwins https://github.com/irwins (and for anyone else interested), we could look at hosting a 1 hour Skype/GoToMeeting session to take you though the text plugin and how that works. Is this of interest?

โ€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/iainbrighton/PScribo/issues/36#issuecomment-300293445, or mute the thread https://github.com/notifications/unsubscribe-auth/AGAs8QNiE-0687MSwhp06gdwizoojqocks5r4M4ygaJpZM4NTRj4 .

Bohem1 commented 7 years ago

@iainbrighton a skype session is a great idea to. Preferably in the evening.

it-praktyk commented 7 years ago

Please inform me too - I'm interesting in direction of PScribo development because I use it for Format-Pester.

ryandcoates commented 7 years ago

Has anybody considered markdown as an input format? we have started transitioning a lot of our docs to MD to keep in source control but still require word as an end output, I was trying to tackle this pipeline with PScribo but there doesn't seem to be an easy way to take the minor format markup in a markdown file and generate the document object with the same formatting on the output side

it-praktyk commented 7 years ago

@ryandcoates, IMHO PSCribo isn't intended to transform existing markdown files to any other format.

PScribo uses its own DSL (a domain specific language) and mapping markdown format to it will be almost impossible.

What about Pandoc?

ryandcoates commented 7 years ago

That's what I thought might be the case, sometimes I try to be a bit too creative ;)

I did try pandoc originally before someone pointed me to PScribo, it gets the data into word ok but the formatting support is fairly rudimentary, it might be the go to for a while though, I found the DSL for PScribo to be very easy to deal with when working from scratch, a lot of our scripts and tools are already taking the objects and parsing output into markdown and dumping them in source control, perhaps I could go further back in the chain and try and integrate PScribo there instead, sorry if I derailed :)

iainbrighton commented 7 years ago

@ryandcoates I agree with @it-praktyk here. That's not to say that someone couldn't write a MD > PScribo object conversion utility ๐Ÿ˜ƒ. Once the MD plugin is written, you could then replace your existing scripts etc., but I'm not sure how far development has gone..

Stephanevg commented 6 years ago

Hey buddy @iainbrighton ! I have a junior colleague to which I wanted to give this task, so he has some stuff to do on the weekend (who want's to hang out in bars with friends nowadays anyways? ;)). Is that documentation "How to write a plugin" somewhere available now? Perhaps you still have that recodring of that presentation you did, so I have something to get him started with.

kilasuit commented 5 years ago

This would be a great addition to this module if it were to surface.