Skip to content

Need to improve production of About topics from Markdown #1488

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

Closed
5 tasks done
sdwheeler opened this issue Aug 1, 2017 · 3 comments
Closed
5 tasks done

Need to improve production of About topics from Markdown #1488

sdwheeler opened this issue Aug 1, 2017 · 3 comments
Assignees

Comments

@sdwheeler
Copy link
Collaborator

Issue Details

As a docs writer we need to format About topics in Markdown so that they render in docs.microsoft.com according to our style guides and formatting standards. However, Get-Help needs the about topics to be in plaintext and limited to 80 columns. PlatyPS has a hard time converting markdown tables and other complex structures.

Version(s) of document impacted

  • Impacts 6 document
  • Impacts 5.1 document
  • Impacts 5.0 document
  • Impacts 4.0 document
  • Impacts 3.0 document

Proposed Solution

Pandoc is an open source tool that converts documents to/from many different formats. See http://pandoc.org/ for complete information.

The following simple PowerShell script shows how Pandoc can be used to convert from Markdown to plain text.

dir *.md | %{
  $file = $_.fullname
  $name = $_.basename
  $name
  pandoc -f markdown -t plain+multiline_tables+inline_code_attributes -o "$name.txt" --columns 75 --ascii $file
}

Caveats

  • About topics will still need to be specially formatted for the Pandoc conversion. However, the results will work well for both Docs publishing and plain text output.
    • Pandoc indents fenced code blocks 4-spaces in the plain text output
    • Pandoc indents tables 2-spaces in the plain text output
  • Build automation will need to be changed to use Pandoc to convert About topics while continuing to use PlatyPS for cmdlet help.
  • Pandoc is open source released under GPL. Need to clear this we Legal.
@zjalexander
Copy link
Contributor

Build automation can consume the package from Chocolatey: https://chocolatey.org/packages/pandoc

@zjalexander
Copy link
Contributor

I went through the legal process to use PanDoc as part of our documentation generation.

@sdwheeler
Copy link
Collaborator Author

We have implemented Pandoc.

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

No branches or pull requests

2 participants