-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Porting Razor Template to Language Function (Fixes #620)
- Loading branch information
Showing
9 changed files
with
176 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Language.PowerShellData | ||
----------------------- | ||
|
||
|
||
|
||
|
||
### Synopsis | ||
PSD1 Template Transpiler. | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
### Description | ||
|
||
Allows PipeScript to generate PSD1. | ||
Multiline comments blocks enclosed with {} will be treated as Blocks of PipeScript. | ||
Multiline comments can be preceeded or followed by single-quoted strings, which will be ignored. | ||
* ```''``` | ||
* ```{}``` | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
### Syntax | ||
```PowerShell | ||
Language.PowerShellData [<CommonParameters>] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Language.Python | ||
--------------- | ||
|
||
|
||
|
||
|
||
### Synopsis | ||
Python Language Definition. | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
### Description | ||
|
||
Allows PipeScript to generate Python. | ||
Because Python does not support multiline comment blocks, PipeScript can be written inline inside of multiline string | ||
PipeScript can be included in a Python string that starts and ends with ```{}```, for example ```"""{}"""``` | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
### Examples | ||
> EXAMPLE 1 | ||
```PowerShell | ||
{ | ||
$pythonContent = @' | ||
"""{ | ||
$msg = "Hello World", "Hey There", "Howdy" | Get-Random | ||
@" | ||
print("$msg") | ||
"@ | ||
}""" | ||
'@ | ||
[OutputFile('.\HelloWorld.ps1.py')]$PythonContent | ||
} | ||
.> .\HelloWorld.ps1.py | ||
``` | ||
|
||
|
||
--- | ||
|
||
|
||
### Syntax | ||
```PowerShell | ||
Language.Python [<CommonParameters>] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
Language.R | ||
---------- | ||
|
||
|
||
|
||
|
||
### Synopsis | ||
R Language Definition. | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
### Description | ||
|
||
Allows PipeScript to generate R. | ||
Because R Scripts only allow single-line comments, this is done using a pair of comment markers. | ||
# { or # PipeScript{ begins a PipeScript block | ||
# } or # }PipeScript ends a PipeScript block | ||
~~~r | ||
# { | ||
Uncommented lines between these two points will be ignored | ||
# # Commented lines will become PipeScript / PowerShell. | ||
# param($message = "hello world") | ||
# "puts `"$message`"" | ||
# } | ||
~~~ | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
### Examples | ||
> EXAMPLE 1 | ||
```PowerShell | ||
Invoke-PipeScript { | ||
$rScript = ' | ||
# { | ||
Uncommented lines between these two points will be ignored | ||
# # Commented lines will become PipeScript / PowerShell. | ||
# param($message = "hello world") | ||
# "print(`"$message`")" | ||
# } | ||
' | ||
[OutputFile('.\HelloWorld.ps1.r')]$rScript | ||
} | ||
Invoke-PipeScript .\HelloWorld.ps1.r | ||
``` | ||
|
||
|
||
--- | ||
|
||
|
||
### Syntax | ||
```PowerShell | ||
Language.R [<CommonParameters>] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Language.Racket | ||
--------------- | ||
|
||
|
||
|
||
|
||
### Synopsis | ||
Racket Template Transpiler. | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
### Description | ||
|
||
Allows PipeScript to generate Racket. | ||
Multiline comments blocks enclosed with {} will be treated as Blocks of PipeScript. | ||
Multiline comments can be preceeded or followed by single-quoted strings, which will be ignored. | ||
* ```''``` | ||
* ```{}``` | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
### Syntax | ||
```PowerShell | ||
Language.Racket [<CommonParameters>] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters