diff --git a/standards/11-clipboard.md b/standards/11-clipboard.md new file mode 100644 index 0000000..435036f --- /dev/null +++ b/standards/11-clipboard.md @@ -0,0 +1,41 @@ +# *COS 11:* Clipboard + +## Quick information +| Information | | +| ----------- | -------------------------------------------------------------------------------------- | +| Version | 1.0.0 | +| Type | Protocol | + +### Technical Details +Clipboard defines a method to share information like text with other programs. + +It is a Table called "clipboard" in the Shell Environment. + +#### The Clipboard Table +It is a Table called "clipboard" in the Shell Environment. + +| Header | Description | +| ----------- | -------------------------------------------------------------------------------------- | +| type | A String, that Describes, what is in the Clipboard (see at Point "Types") | +| content | This is the Content of the Clipboard see "Types" | | + +#### Types +| Type | Content | +| ----------- | -------------------------------------------------------------------------------------- | +| text | Just normal text provided as a String. | +| nfp | A nfp Image provided as String | +| nft | A nft Image provided as String | + +### Usage +Set text of Clipboard: +```lua +clipboard = {type="text",content="Hello World"} +``` +Get Text of Clipboard +```lua +if type(clipboard) == "table" then + if clipboard.type == "text" then + print(clipboard.content) + end +end +``` diff --git a/standards/README.md b/standards/README.md index fb70a9f..2adfbf5 100644 --- a/standards/README.md +++ b/standards/README.md @@ -11,3 +11,4 @@ This document contains a list of all standards. | 6 | [Nitrogen Fingers Text](6-nft.md) | File format | Images with text support | | 7 | [Temporary directory](7-temp-directory.md) | File format | Storing temporary files | | 10 | [TRoR](10-tror.md) | Protocol | Redirecting terminal state and interactions over Rednet. | +| 11 | [Clipboard](11-clipboard.md) | Protocol | Share Informations with other Programs |