diff --git a/README.md b/README.md index 7380886..f919e80 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Markdown -A PowerShell module that converts a custom DSL into Markdown documents with ease. It empowers you to programmatically generate well-structured -Markdown—featuring headings, collapsible details, code fences, and tables — using intuitive DSL commands. Built for automation and fully -cross-platform, this module challenges the conventional approach to documentation generation. +Markdown is a cross-platform PowerShell module for building Markdown content programmatically. It provides a small set of +composable commands that let you generate well-structured Markdown — headings, paragraphs, collapsible details, fenced code +blocks, and tables — directly from PowerShell, making it a natural fit for automated documentation generation. ## Installation -To install the module from the PowerShell Gallery, run the following commands: +Install the module from the PowerShell Gallery: ```powershell Install-PSResource -Name Markdown @@ -15,322 +15,42 @@ Import-Module -Name Markdown ## Usage -The `Markdown` module introduces a Domain Specific Language (DSL) that simplifies the creation of Markdown files. With straightforward commands, you -can generate headings, details blocks, fenced code blocks, and tables without manually formatting Markdown. +Each command returns a Markdown-formatted string, and they nest inside one another so you can compose a whole document +from PowerShell. -### Heading - -Create Markdown headings by specifying the level, title, and content. - -```powershell -Heading 1 'Title' { - 'Content under the title' -} -``` - -This produces: - -```markdown -# Title - -Content under the title -``` - -Supports nested headings. +### Example: Build a section with a table and code block ```powershell -Heading 1 'Title' { - 'Content under the title' +Set-MarkdownSection -Level 2 -Title 'Running processes' -Content { + 'A snapshot of the current processes:' - Heading 2 'Nested Title' { - 'Content under the nested title' + Set-MarkdownTable -InputScriptBlock { + Get-Process | Select-Object -First 3 Name, Id } -} -``` - -This produces: - -```markdown -# Title - -Content under the title - -## Nested Title - -Content under the nested title -``` - -### Paragraph - -Create a paragraph of text. - -```powershell -Paragraph { - 'This is a paragraph' -} -``` - -This produces: - -```markdown - -This is a paragraph - -``` - -Supports tags for inline formatting. - -```powershell -Paragraph { - 'This is a paragraph with tags' -} -Tags -``` - -This produces: - -```markdown -
- -This is a paragraph with tags - -
-``` - -### Details - -Generate collapsible sections with a summary title. - -```powershell -Details 'More Information' { - 'Detailed content goes here' -} -``` - -This produces: - -```markdown -- -Detailed content goes here - -
-
-
-Detailed content goes here
-
-
-
-Nested content goes here
-
-Nested Information
-
-
-Some string content here
```powershell
-Get-Process
+Get-Command -Module Markdown
+Get-Help -Name Set-MarkdownTable -Examples
```
-
-
-
-Some string content here too
-
-Should be able to call nested details
-
- -This is a paragraph - -
- -This is the end of the section - -```powershell - -Name Age ----- --- -John Doe 30 -Jane Doe 25 - - -``` - -| Name | Age | -| - | - | -| John Doe | 30 | -| Jane Doe | 25 | - -This is the end of the document - -```` - -## Contributing - -Whether you’re a user with valuable feedback or a developer with innovative ideas, your contributions are welcome. Here’s how you can get involved: - -### For Users - -If you encounter unexpected behavior, error messages, or missing functionality, please open an issue in the repository. -Your insights are crucial for refining the module. - -### For Developers - -We welcome contributions that enhance automation, extend functionality, or improve cross-platform compatibility. -Please review the [Contribution Guidelines](CONTRIBUTING.md) before submitting pull requests. Whether you want to tackle an existing -issue or propose a new feature, your ideas are essential for pushing the boundaries of what's possible with PowerShell documentation automation.