Snippet Help

From The Foundry MODO SDK wiki
Jump to: navigation, search

Adding A New Snippet

On the wiki's 'Main Page' enter a name for the snippet in the text box to the left of the "Add Code Snippet" button. The Name will become the name of the snippet's page so try not to make it overly verbose.

Add a new Snippet


Left click the "Add Code Snippet", if a snippet already exists with that name the "Edit Snippet:" page will open, otherwise you will be taken to the "Create Snippet" page.

default


Add a summary/description of the snippet and/or an explanation of it's purpose in the "Summary" text area

default


To add source code to the 'Code' text area, click the 'Code' button on the text area's toolbar to reveal the language specific buttons. Clicking the button for the language required will add syntax highlighting tags for that language to the text area. You may also enter the tags by hand if you wish which will allow syntax highlighting for any of the languages supported by the mediawiki Geshi extension.

default


Type or paste the source code between the tags. You may enter multiple separate blocks of code in one or more languages separated by any commentary you feel is necessary which allows the snippet system to be used for tutorials or end to end examples with source code and config fragments as well as short snippets of code.

default


You may also embed Gists or Pastebin pastes into the 'Code' box by clicking on either the 'Gist' or 'Paste' buttons in the 'Code' section of the text area's toolbar and entering the ID for the Gist or Paste between the supplied tags

default

default


At the bottom of the page is the 'Categories' entry field. Tagging a snippet with categories aids in searching. You must add at least one category which should be the name of the primary language (or languages) for the snippet. You can add as may categories as you see fit. Each category entered should be separated by either a comma or by hitting 'Enter' on the keyboard.

default


When done, click the "Save Page" button at the bottom of the page to add the snippet.

default



Editing A Code Snippet

To edit a snippet from the "Main Page" enter the name of an existing code snippet page into the text box to the left of the "Add New Snippet" button and click the button.

To edit a snippet from the snippet's own page click the "Edit with form" tab at the top right of the page.

default




editsnippet