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

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

Open
Bohem1 opened this issue May 7, 2017 · 18 comments
Open

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

Bohem1 opened this issue May 7, 2017 · 18 comments

Comments

@Bohem1
Copy link

Bohem1 commented May 7, 2017

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
Copy link

Stephanevg commented May 7, 2017 via email

@iainbrighton
Copy link
Owner

iainbrighton commented May 8, 2017

@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
Copy link

irwins commented May 8, 2017

I was just looking through your PScribo HTML code. OutMD.ps1 & OutMD.Internal.ps1 is a start... 😀

@iainbrighton
Copy link
Owner

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
Copy link

irwins commented May 8, 2017

Markdown cheets For a quick reference! 😉

@irwins
Copy link

irwins commented May 8, 2017

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

@Stephanevg
Copy link

@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
Copy link

irwins commented May 9, 2017

@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
Copy link
Owner

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
Copy link

Stephanevg commented May 9, 2017 via email

@Bohem1
Copy link
Author

Bohem1 commented May 10, 2017

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

@it-praktyk
Copy link
Contributor

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

@ryandcoates
Copy link

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
Copy link
Contributor

@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
Copy link

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
Copy link
Owner

@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
Copy link

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
Copy link

kilasuit commented Jun 3, 2019

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

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

No branches or pull requests

7 participants