Skip to content

Commit

Permalink
Release merge for v0.2.0 (#1)
Browse files Browse the repository at this point in the history
* Updates for v0.2.0 release
  • Loading branch information
BernieWhite authored Aug 24, 2017
1 parent 080b8bb commit 2e1857f
Show file tree
Hide file tree
Showing 36 changed files with 3,271 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
codecov:
notify:
require_ci_to_pass: no
# dev should be the baseline for reporting
branch: dev

comment:
layout: "reach, diff"
behavior: default

coverage:
range: 50..80
round: down
precision: 0

status:
project:
default:
# Set the overall project code coverage requirement to 70%
target: 80
patch:
default:
# Set the pull request requirement to not regress overall coverage by more than 5%
# and let codecov.io set the goal for the code changed in the patch.
target: auto
threshold: 5
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

/**/.vs/
/**/bin/
/**/obj/
/artifacts/
/build/
/reports/
/**/*.user
/.vscode/settings.json
26 changes: 26 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "test",
"type": "shell",
"command": ".\\scripts\\test.ps1",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": [ "$pester" ]
},
{
"taskName": "build",
"type": "shell",
"command": ".\\scripts\\build.ps1 -Clean -Module PSDocs",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
82 changes: 80 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,90 @@
# PSDocs
This project aims to assist IT pros to generate documentation from PowerShell objects.
A PowerShell module with commands to generate markdown from objects using PowerShell syntax.

| AppVeyor (Windows) | Codecov (Windows) |
| --- | --- |
| [![av-image][]][av-site] | [![cc-image][]][cc-site] |

[av-image]: https://ci.appveyor.com/api/projects/status/pl7tu7ktue388n7s
[av-site]: https://ci.appveyor.com/project/BernieWhite/psdocs
[cc-image]: https://codecov.io/gh/BernieWhite/PSDocs/branch/master/graph/badge.svg
[cc-site]: https://codecov.io/gh/BernieWhite/PSDocs

## Disclaimer
This project is to be considered a **proof-of-concept** and **not a supported Microsoft product**.

## Modules
The following modules are included in this repository.

| Module | Description | Latest version |
| ------ | ----------- | -------------- |
| PSDocs | Generate markdown from PowerShell | [v0.2.0][psg-psdocs] |
| PSDocs.Dsc | Extension for PSDocs to generate markdown from Desired State Configuration | [v0.2.0][psg-psdocsdsc] |

[psg-psdocs]: https://www.powershellgallery.com/packages/PSDocs
[psg-psdocsdsc]: https://www.powershellgallery.com/packages/PSDocs.Dsc

## Getting started

_More to come._
### 1. Prerequsits

- Windows Management Framework (WMF) 5.0 or greater
- .NET Framework 4.6 or greater

### 2. Get PSDocs

- Install from PowerShellGallery.com

```powershell
# Install base PSDocs module
Install-Module -Name 'PSDocs';
```

```powershell
# Optionally install DSC extensions module, which will install PSDocs if not already installed
Install-Module -Name 'PSDocs.Dsc';
```

### 3. Usage

```powershell
# Import PSDocs module
Import-Module -Name PSDocs;
# Define a sample document
document Sample {
Section Introduction {
# Add a comment
"This is a sample file list from $InputObject"
# Generate a table
Get-ChildItem -Path $InputObject | Table -Property Name,PSIsContainer
}
}
# Call the sample document and generate markdown
Invoke-PSDocument -Name Sample -InputObject 'C:\';
```

For an example of the output generated see [Get-ChildItemExample](/docs/examples/Get-child-item-output.md)

## Language reference

### Keywords

- [Document](/docs/keywords/Document.md)
- [Section](/docs/keywords/Section.md)
- [Code](/docs/keywords/Code.md)
- [Note](/docs/keywords/Note.md)
- [Warning](/docs/keywords/Warning.md)
- [Yaml](/docs/keywords/Yaml.md)
- [Table](/docs/keywords/Table.md)

### Commands

- [Invoke-PSDocument](/docs/commands/Invoke-PSDocument.md)
- [Invoke-DscNodeDocument](/docs/commands/Invoke-DscNodeDocument.md)

## Maintainers

Expand Down
5 changes: 5 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 0.1.0.{build}
image: Visual Studio 2017
build: off
test_script:
- ps: .\scripts\test.ps1
30 changes: 30 additions & 0 deletions docs/commands/Invoke-DscNodeDocument.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Invoke-DscNodeDocument

## SYNOPSIS
Calls a document definition.

## SYNTAX

```
Invoke-DscNodeDocument -DocumentName <String> [-Path <String>] [-OutputPath <String>]
```

## EXAMPLES

### EXAMPLE 1

```powershell
Document 'Test' {
Section 'Installed features' {
'The following Windows features have been installed.'
$InputObject.ResourceType.WindowsFeature | Table -Property Name,Ensure;
}
}
Invoke-DscNodeDocument -DocumentName 'Test' -Path '.\nodes' -OutputPath '.\docs';
```

Generates a new markdown document for each node .mof in the path `.\nodes`.
11 changes: 11 additions & 0 deletions docs/commands/Invoke-PSDocument.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Invoke-PSDocument

## SYNOPSIS
Calls a document definition.

## SYNTAX

```
Invoke-PSDocument [-Name] <String> [-InstanceName <String>] [-InputObject <PSObject>] [-ConfigurationData <Object>] [-Path <String>] [-OutputPath <String>] [-Function <System.Collections.Generic.Dictionary<String, ScriptBlock>>]
```
11 changes: 11 additions & 0 deletions docs/examples/Get-child-item-output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

## Introduction
This is a sample file list from C:\\

|Name|PSIsContainer|
| --- | --- |
|PerfLogs|True|
|Program Files|True|
|Program Files (x86)|True|
|Users|True|
|Windows|True|
45 changes: 45 additions & 0 deletions docs/keywords/Code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

# Code

## SYNOPSIS
Creates a formatted code section.

## SYNTAX

```
Code [-Body] <ScriptBlock>
```

## EXAMPLES

### EXAMPLE 1

```powershell
Document 'Test' {
Code {
'Get-Item -Path .\;'
}
}
Invoke-PSDocument -Name 'Test' -InputObject $Null;
```

Generates a new Test.md document containing code.

## PARAMETERS

### -Body
A block of inline code to insert.

```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
38 changes: 38 additions & 0 deletions docs/keywords/Document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

# Document

## SYNOPSIS
Defines a named block that can be called to output documentation.

## SYNTAX

```
Document [-Name] <String>
```

## EXAMPLES

### EXAMPLE 1

```powershell
Document 'Test' {
}
```

## PARAMETERS

### -Name
The name of the document.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
Loading

0 comments on commit 2e1857f

Please sign in to comment.