Skip to content

Instantly share code, notes, and snippets.

@gkellogg
Created May 15, 2012 22:54
Show Gist options
  • Save gkellogg/2705783 to your computer and use it in GitHub Desktop.
Save gkellogg/2705783 to your computer and use it in GitHub Desktop.
Yard JSON-LD example
{
"@context": {
"children": {"@id": "yard:children", "@type": "@id"},
"children": {"@id": "yard:children", "@type": "@id"},
"docstring": "yard:docstring",
"explicit": "yard:explicit",
"files": {"@id": "yard:files", "@type": "@id"},
"group": "yard:group",
"groups": "yard:groups",
"name": "yard:name",
"parameters": {"@id": "yard:parameters", "@type": "@id"},
"path": "@id",
"scope": "yard:scope",
"signature": "yard:signature",
"source": "yard:source",
"source_type": "yard:source_type",
"source_type": "yard:source_type",
"type": "@type",
"visibility": "yard:visibility",
"yard": "http://foo/yard/"
}
}
{
"@context": {
"children": {"@id": "yard:children", "@type": "@id"},
"children": {"@id": "yard:children", "@type": "@id"},
"docstring": "yard:docstring",
"explicit": "yard:explicit",
"files": {"@id": "yard:files", "@type": "@id"},
"group": "yard:group",
"groups": "yard:groups",
"name": "yard:name",
"parameters": {"@id": "yard:parameters", "@type": "@id"},
"path": "@id",
"scope": "yard:scope",
"signature": "yard:signature",
"source": "yard:source",
"source_type": "yard:source_type",
"source_type": "yard:source_type",
"type": "@type",
"visibility": "yard:visibility",
"yard": "http://foo/yard/"
},
"children": {
"@type": {},
"children": {
"@type": {}
}
}
}
{
"@context": {
"children": {"@id": "yard:children", "@type": "@id"},
"children": {"@id": "yard:children", "@type": "@id"},
"docstring": "yard:docstring",
"explicit": "yard:explicit",
"files": {"@id": "yard:files", "@type": "@id"},
"group": "yard:group",
"groups": "yard:groups",
"name": "yard:name",
"parameters": {"@id": "yard:parameters", "@type": "@id"},
"path": "@id",
"scope": "yard:scope",
"signature": "yard:signature",
"source": "yard:source",
"source_type": "yard:source_type",
"source_type": "yard:source_type",
"type": "@type",
"visibility": "yard:visibility",
"yard": "http://foo/yard/"
},
"@graph": [
{
"attributes": {
"class": {},
"instance": {}
},
"children": [
"YARD",
"#P",
"#log",
"yard.default_attr",
"#__p",
"yard.tag",
"yard.directive",
"yard.tag.transitive",
"File",
"Hash",
"yard.handlers.process",
"Array",
"Module",
"String",
"Insertion",
"SymbolHash",
"macro.expand"
],
"docstring": "",
"groups": [
"Global Convenience Methods"
],
"name": "root",
"path": "",
"source_type": "ruby",
"type": "root",
"visibility": "public"
},
{
"current_file_has_comments": true,
"docstring": "Shortcut for creating a YARD::CodeObjects::Proxy via a path",
"explicit": true,
"files": [
[
"lib/yard/globals.rb",
7
]
],
"group": "Global Convenience Methods",
"name": "P",
"namespace": "",
"parameters": [
[
"namespace",
null
],
[
"name",
"nil"
]
],
"path": "#P",
"scope": "instance",
"signature": "def P(namespace, name = nil)",
"source": "def P(namespace, name = nil)\n namespace, name = nil, namespace if name.nil?\n YARD::Registry.resolve(namespace, name, false, true)\nend",
"source_type": "ruby18",
"type": "method",
"visibility": "public"
},
{
"current_file_has_comments": true,
"docstring": "",
"explicit": true,
"files": [
[
"lib/yard/autoload.rb",
2
]
],
"name": "__p",
"namespace": "",
"parameters": [
[
"path",
null
]
],
"path": "#__p",
"scope": "instance",
"signature": "def __p(path) File.join(YARD::ROOT, 'yard', *path.split('/')) end",
"source": "def __p(path) File.join(YARD::ROOT, 'yard', *path.split('/')) end",
"source_type": "ruby18",
"type": "method",
"visibility": "public"
},
{
"current_file_has_comments": true,
"docstring": "The global {YARD::Logger} instance",
"explicit": true,
"files": [
[
"lib/yard/globals.rb",
16
]
],
"group": "Global Convenience Methods",
"name": "log",
"namespace": "",
"path": "#log",
"scope": "instance",
"signature": "def log",
"source": "def log\n YARD::Logger.instance\nend",
"source_type": "ruby18",
"type": "method",
"visibility": "public"
},
{
"attributes": {
"class": {},
"instance": {}
},
"children": [
"Array#place"
],
"docstring": "",
"files": [
[
"lib/yard/core_ext/array.rb",
1
]
],
"name": "Array",
"namespace": "",
"path": "Array",
"source_type": "ruby",
"superclass": "Object",
"type": "class",
"visibility": "public"
},
{
"current_file_has_comments": true,
"docstring": "Places values before or after another object (by value) in\nan array. This is used in tandem with the before and after\nmethods of the {Insertion} class.",
"dynamic": true,
"explicit": true,
"files": [
[
"lib/yard/core_ext/array.rb",
14
]
],
"name": "place",
"namespace": "Array",
"parameters": [
[
"*values",
null
]
],
"path": "Array#place",
"scope": "instance",
"signature": "def place(*values) Insertion.new(self, values) end",
"source": "def place(*values) Insertion.new(self, values) end",
"source_type": "ruby18",
"type": "method",
"visibility": "public"
},
{
"attributes": {
"class": {},
"instance": {}
},
"children": [
"File::RELATIVE_PARENTDIR",
"File::RELATIVE_SAMEDIR",
"File.relative_path",
"File.cleanpath",
"File.open!",
"File.read_binary"
],
"docstring": "",
"files": [
[
"lib/yard/core_ext/file.rb",
3
]
],
"groups": [
"Manipulating Paths",
"Reading Files"
],
"name": "File",
"namespace": "",
"path": "File",
"source_type": "ruby",
"superclass": "Object",
"type": "class",
"visibility": "public"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment