{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"Outline","type":"basic","slug":"outline","excerpt":"","body":"An outline definition is a declarative file that describes how to recognize symbols in a file that become nodes in the outline tree. Items are recognized by simple regular expressions as outlined below. You can include an outline in a [Cloud9 Bundle](doc:cloud9-bundle) to share on c9.io.\n\nOutline definitions are very powerful and can define a useful outline view with only a handful of regular expressions. Any outline items are also added automatically to the default list of code completions. Still, it is entirely possible to create a custom parser that does all the heavy lifting. See the [language guide](doc:language-plugins) for more information on that.\n[block:image]\n{\n \"images\": [\n {\n \"image\": [\n \"https://files.readme.io/3ME4kLTNGL8z4fetOFPA_2015-04-13_1730.png\",\n \"2015-04-13_1730.png\",\n \"2392\",\n \"1018\",\n \"#64abf7\",\n \"\"\n ]\n }\n ]\n}\n[/block]\n# Creating an Outline Definition\n\nAn outline definition is a simple JSON object with 5 supported properties; `languages`, `extensions`, `guess_fargs`, `extract_docs` and `tags`.\n\n## Languages & Extensions\n\nThese two arrays specify for which languages / extensions the outline document is used.\n\n```\n{\n languages: [\"php\"],\n extensions: [\"php\", \"php3\", \"php4\", \"php5\"]\n}\n```\n\n## Options\n\nThere are two options that can be set to true or false. \n\n- `guess_fargs` sets whether to guess function arguments when showing outline items in code completion.\n- `extract_docs` sets whether to extract documentation when showing outline items in code completion.\n \n## Tags\n\nThe `tags` property is an array of rules that match symbols in the document. Each rule is an object with two fields; `regex` and `kind`. The `kind` determines the icon of the symbol and takes one of the following strings:\n\n- \"package\"\n- \"method\"\n- \"method2\"\n- \"property\"\n- \"property2\"\n- \"import\"\n\nThe `regex` property matches a symbol in a file and builds a tree based on that. Make sure to *only* capture the name of the symbol in the regular expressions. Use `(?:)` if you need to use parenthesis for any other reason.\n\nThe following tag finds a javascript function:\n\n```\n{ regex: /(?:^|\\n)\\s*function\\s+([^ \\(:]+)/g, kind: \"method\" },\n```\n\n## Full Example\n\nHere's a full example of the python outline definition.\n\n```javascript\n{\n languages: [\"py\"],\n extensions: [\"py\"],\n \n guess_fargs: true,\n extract_docs: true,\n \n tags: [\n { regex: /(?:^|\\n)\\s*class\\s+([^ \\(:]+)/g, kind: \"package\" },\n { regex: /(?:^|\\n)\\s*def\\s+(?!_)([^ \\(:]+)/g, kind: \"method\" },\n { regex: /(?:^|\\n)\\s*def\\s+(?!__[^ \\(:]+__)(_[^ \\(]*)/g, kind: \"method2\" },\n { regex: /(?:^|\\n)\\s*def\\s+(__[^ \\(:]+__)/g, kind: \"property\" },\n {\n regex: new RegExp(\n \"(?:^|\\\\n)\\\\s*import\\\\s+([^ \\\\(]+)\"\n ),\n kind: \"import\"\n }\n ]\n}\n```\n\n# Adding an Outline to a Bundle\n\nA bundle can contain one or more outline definitions. Each outline definitions *must* be placed in the `outline` directory. \n\nSuppose your outline definition is called `python.outline`. Your file structure will look something like this:\n\n```\n└─ your.plugin\n ├─ outline\n | └─ python.outline\n ├─ package.json\n └─ README.md\n```","updates":[],"order":6,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"551df5f4a77fec1700f6f29a","githubsync":"","version":{"version":"0.1","version_clean":"0.1.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["54d5635632d98b0d00384afc","54d5635632d98b0d00384afd","54d5635632d98b0d00384afe","54d5635632d98b0d00384aff","54d5635632d98b0d00384b00","54d5635632d98b0d00384b01","54d5635632d98b0d00384b02","54d652097e05890d006f153e","54dd1315ca1e5219007e9daa","54e21e2b22de1c230094b147","54e68e62a43fe13500db3879","54fa1d3fe7a0ba2f00306309","551c453a23a1ee190034d19a","551df586e52a0b23000c62b6","551f39be6886f8230055f02a","55a6720751457325000e4d97"],"_id":"54d5635532d98b0d00384afb","project":"54d53c7b23010a0d001aca0c","__v":10,"createdAt":"2015-02-07T00:59:01.934Z","forked_from":"54d53c7c23010a0d001aca0f","releaseDate":"2015-02-07T00:59:01.934Z"},"createdAt":"2015-04-03T02:07:48.489Z","parentDoc":null,"project":"54d53c7b23010a0d001aca0c","user":"54cfa8e1a8a4fd0d00b7fd1d","__v":30,"category":{"sync":{"isSync":false,"url":""},"pages":["551df5bfa77fec1700f6f296","551df5c9fa7f722d00db21f0","551df5dfa77fec1700f6f298","551df5eca7e98017009e3ede","551df5f4a77fec1700f6f29a","551df5fdfa7f722d00db21f3","551df609a7e98017009e3ee0","551f3c0450a0fc210057968e","552836448962f339009a67ab"],"title":"Cloud9 Bundle","slug":"cloud9-bundle","order":3,"from_sync":false,"reference":false,"_id":"551df586e52a0b23000c62b6","__v":9,"createdAt":"2015-04-03T02:05:58.352Z","project":"54d53c7b23010a0d001aca0c","version":"54d5635532d98b0d00384afb"}}