|
| 1 | + |
| 2 | +PipeScript.Inline |
| 3 | +----------------- |
| 4 | +### Synopsis |
| 5 | +Inline Transpiler |
| 6 | + |
| 7 | +--- |
| 8 | +### Description |
| 9 | + |
| 10 | +The PipeScript Core Inline Transpiler. This makes Source Generators with inline PipeScript work. |
| 11 | + |
| 12 | +Regardless of underlying source language, a source generator works in a fairly straightforward way. |
| 13 | + |
| 14 | +Inline PipeScript will be embedded within the file (usually in comments). |
| 15 | + |
| 16 | +If a Regular Expression can match each section, then the content in each section can be replaced. |
| 17 | + |
| 18 | +--- |
| 19 | +### Parameters |
| 20 | +#### **SourceSection** |
| 21 | + |
| 22 | +A list of source sections |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +|Type |Requried|Postion|PipelineInput | |
| 27 | +|------------------|--------|-------|--------------| |
| 28 | +|```[PSObject[]]```|true |1 |true (ByValue)| |
| 29 | +--- |
| 30 | +#### **SourceText** |
| 31 | + |
| 32 | +A string containing the text contents of the file |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +|Type |Requried|Postion|PipelineInput| |
| 37 | +|--------------|--------|-------|-------------| |
| 38 | +|```[String]```|true |named |false | |
| 39 | +--- |
| 40 | +#### **SourcePattern** |
| 41 | + |
| 42 | +A string containing the pattern used to recognize special sections of source code. |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +|Type |Requried|Postion|PipelineInput| |
| 47 | +|-------------|--------|-------|-------------| |
| 48 | +|```[Regex]```|true |named |false | |
| 49 | +--- |
| 50 | +#### **ReplacePattern** |
| 51 | + |
| 52 | +|Type |Requried|Postion|PipelineInput| |
| 53 | +|-------------|--------|-------|-------------| |
| 54 | +|```[Regex]```|true |named |false | |
| 55 | +--- |
| 56 | +#### **StartPattern** |
| 57 | + |
| 58 | +The Start Pattern. |
| 59 | +This indicates the beginning of what should be considered PipeScript. |
| 60 | +An expression will match everything until -EndPattern |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +|Type |Requried|Postion|PipelineInput| |
| 65 | +|-------------|--------|-------|-------------| |
| 66 | +|```[Regex]```|true |named |false | |
| 67 | +--- |
| 68 | +#### **EndPattern** |
| 69 | + |
| 70 | +The End Pattern |
| 71 | +This indicates the end of what should be considered PipeScript. |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +|Type |Requried|Postion|PipelineInput| |
| 76 | +|-------------|--------|-------|-------------| |
| 77 | +|```[Regex]```|true |named |false | |
| 78 | +--- |
| 79 | +#### **ReplacementEvaluator** |
| 80 | + |
| 81 | +|Type |Requried|Postion|PipelineInput| |
| 82 | +|-------------------|--------|-------|-------------| |
| 83 | +|```[ScriptBlock]```|false |named |false | |
| 84 | +--- |
| 85 | +#### **NoTranspile** |
| 86 | + |
| 87 | +If set, will not transpile script blocks. |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +|Type |Requried|Postion|PipelineInput| |
| 92 | +|--------------|--------|-------|-------------| |
| 93 | +|```[Switch]```|false |named |false | |
| 94 | +--- |
| 95 | +#### **SourceFile** |
| 96 | + |
| 97 | +The path to the source file. |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +|Type |Requried|Postion|PipelineInput| |
| 102 | +|--------------|--------|-------|-------------| |
| 103 | +|```[String]```|false |named |false | |
| 104 | +--- |
| 105 | +#### **Begin** |
| 106 | + |
| 107 | +A Script Block that will be injected before each inline is run. |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | +|Type |Requried|Postion|PipelineInput| |
| 112 | +|-------------------|--------|-------|-------------| |
| 113 | +|```[ScriptBlock]```|false |named |false | |
| 114 | +--- |
| 115 | +#### **ForeachObject** |
| 116 | + |
| 117 | +A Script Block that will be piped to after each output. |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | +|Type |Requried|Postion|PipelineInput| |
| 122 | +|-------------------|--------|-------|-------------| |
| 123 | +|```[ScriptBlock]```|false |named |false | |
| 124 | +--- |
| 125 | +#### **End** |
| 126 | + |
| 127 | +A Script Block that will be injected after each inline script is run. |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | +|Type |Requried|Postion|PipelineInput| |
| 132 | +|-------------------|--------|-------|-------------| |
| 133 | +|```[ScriptBlock]```|false |named |false | |
| 134 | +--- |
| 135 | +### Syntax |
| 136 | +```PowerShell |
| 137 | +PipeScript.Inline [-SourceSection] <PSObject[]> [-NoTranspile] [-SourceFile <String>] [-Begin <ScriptBlock>] [-ForeachObject <ScriptBlock>] [-End <ScriptBlock>] [<CommonParameters>] |
| 138 | +``` |
| 139 | +```PowerShell |
| 140 | +PipeScript.Inline -SourceText <String> -StartPattern <Regex> -EndPattern <Regex> [-ReplacementEvaluator <ScriptBlock>] [-NoTranspile] [-SourceFile <String>] [-Begin <ScriptBlock>] [-ForeachObject <ScriptBlock>] [-End <ScriptBlock>] [<CommonParameters>] |
| 141 | +``` |
| 142 | +```PowerShell |
| 143 | +PipeScript.Inline -SourceText <String> -ReplacePattern <Regex> [-ReplacementEvaluator <ScriptBlock>] [-NoTranspile] [-SourceFile <String>] [-Begin <ScriptBlock>] [-ForeachObject <ScriptBlock>] [-End <ScriptBlock>] [<CommonParameters>] |
| 144 | +``` |
| 145 | +```PowerShell |
| 146 | +PipeScript.Inline -SourceText <String> -SourcePattern <Regex> [-NoTranspile] [-SourceFile <String>] [-Begin <ScriptBlock>] [-ForeachObject <ScriptBlock>] [-End <ScriptBlock>] [<CommonParameters>] |
| 147 | +``` |
| 148 | +--- |
| 149 | + |
| 150 | + |
0 commit comments