diff --git a/docs/Language.BASIC.md b/docs/Language.BASIC.md index 3c4163a74..99ca41562 100644 --- a/docs/Language.BASIC.md +++ b/docs/Language.BASIC.md @@ -41,7 +41,7 @@ rem } Invoke-PipeScript { $VBScript = ' rem { -Uncommented lines between these two points will be ignored +rem # Uncommented lines between these two points will be ignored rem # Commented lines will become PipeScript / PowerShell. rem param($message = "hello world") rem "CreateObject(`"WScript.Shell`").Popup(`"$message`")" diff --git a/docs/Language.Batch.md b/docs/Language.Batch.md index ed38563a3..a38b81286 100644 --- a/docs/Language.Batch.md +++ b/docs/Language.Batch.md @@ -19,7 +19,7 @@ Because Batch Scripts only allow single-line comments, this is done using a pair ```batch :: { -Uncommented lines between these two points will be ignored +:: Uncommented lines between these two points will be ignored :: # Commented lines will become PipeScript / PowerShell. :: param($message = 'hello world') :: "echo $message" diff --git a/docs/Language.PowerShellData.md b/docs/Language.PowerShellData.md new file mode 100644 index 000000000..4633a888e --- /dev/null +++ b/docs/Language.PowerShellData.md @@ -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 [] +``` diff --git a/docs/Language.Python.md b/docs/Language.Python.md new file mode 100644 index 000000000..542115ba8 --- /dev/null +++ b/docs/Language.Python.md @@ -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 [] +``` diff --git a/docs/Language.R.md b/docs/Language.R.md new file mode 100644 index 000000000..3305e1ca3 --- /dev/null +++ b/docs/Language.R.md @@ -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 [] +``` diff --git a/docs/Language.Racket.md b/docs/Language.Racket.md new file mode 100644 index 000000000..5e717ad97 --- /dev/null +++ b/docs/Language.Racket.md @@ -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 [] +``` diff --git a/docs/ListOfTranspilers.md b/docs/ListOfTranspilers.md index 29191ed76..fe535ff79 100644 --- a/docs/ListOfTranspilers.md +++ b/docs/ListOfTranspilers.md @@ -39,10 +39,7 @@ These are all of the transpilers currently included in PipeScript: |[PipeScript.TypeConstraint](Transpilers/Core/PipeScript.TypeConstraint.psx.ps1) |Transpiles Type Constraints | |[PipeScript.TypeExpression](Transpilers/Core/PipeScript.TypeExpression.psx.ps1) |The PipeScript TypeExpression Transpiler | |[ProxyCommand](Transpilers/ProxyCommand.psx.ps1) |Creates Proxy Commands | -|[PSD1.Template](Transpilers/Templates/PSD1.Template.psx.ps1) |PSD1 Template Transpiler. | |[Python.Template](Transpilers/Templates/Python.Template.psx.ps1) |Python Template Transpiler. | -|[R.Template](Transpilers/Templates/R.Template.psx.ps1) |R Template Transpiler. | -|[Racket.Template](Transpilers/Templates/Racket.Template.psx.ps1) |Racket Template Transpiler. | |[Razor.Template](Transpilers/Templates/Razor.Template.psx.ps1) |Razor Template Transpiler. | |[RegexLiteral](Transpilers/Syntax/RegexLiteral.psx.ps1) |Regex Literal Transpiler | |[RemoveParameter](Transpilers/Parameters/RemoveParameter.psx.ps1) |Removes Parameters from a ScriptBlock | diff --git a/docs/README.md b/docs/README.md index b4c2c9c34..829162e4e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -50,7 +50,7 @@ Often, programming involves implementing small functional changes within a speci For example, if implementing an interface or subclass, the only things that will change are the class name and method details. -PipeScript can be be embedded within 17 languages. +PipeScript can be be embedded within 14 languages. Embedding PipeScript within any of these languages allows you to generate any of these languages with parameterized scripts, thus removing some of the tedium of programming. diff --git a/docs/SupportedLanguages.md b/docs/SupportedLanguages.md index 161daf523..913c457b0 100644 --- a/docs/SupportedLanguages.md +++ b/docs/SupportedLanguages.md @@ -4,10 +4,7 @@ These are all of the transpilers currently included in PipeScript: |Language |Synopsis |Pattern | |--------------------------------------------------------------------------|--------------------------------|-------------------------| -|[PSD1.Template](Transpilers/Templates/PSD1.Template.psx.ps1) |PSD1 Template Transpiler. |```\.psd1$``` | |[Python.Template](Transpilers/Templates/Python.Template.psx.ps1) |Python Template Transpiler. |```\.py$``` | -|[R.Template](Transpilers/Templates/R.Template.psx.ps1) |R Template Transpiler. |```\.r$``` | -|[Racket.Template](Transpilers/Templates/Racket.Template.psx.ps1) |Racket Template Transpiler. |```\.rkt$``` | |[Razor.Template](Transpilers/Templates/Razor.Template.psx.ps1) |Razor Template Transpiler. |```\.(cshtml\\|razor)$```| |[RSS.Template](Transpilers/Templates/RSS.Template.psx.ps1) |RSS Template Transpiler. |```\.rss$``` | |[Ruby.Template](Transpilers/Templates/Ruby.Template.psx.ps1) |Ruby Template Transpiler. |```\.rb$``` |