-
Notifications
You must be signed in to change notification settings - Fork 13
Clipboard #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Clipboard #68
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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") | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Describes isn't even a noun... Don't capitalise anything unless it's at the beginning of a sentence or a proper noun (names of people or places, etc.). |
||
| | 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 | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have MIME types, just refer to those, it's more flexible.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely |
||
|
|
||
| ### Usage | ||
| Set text of Clipboard: | ||
| ```lua | ||
| clipboard = {type="text",content="Hello World"} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This being a global makes my soul scream, but there isn't really an alternative I can think of :/. |
||
| ``` | ||
| Get Text of Clipboard | ||
| ```lua | ||
| if type(clipboard) == "table" then | ||
| if clipboard.type == "text" then | ||
| print(clipboard.content) | ||
| end | ||
| end | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Information" should never be plural, it's just "Share information with other programs". |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nouns shouldn't be capitalised. There's plenty other instances of this in the document, which I won't comment on to avoid clutter.