MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / breadcrumbs

Function breadcrumbs

scripts/describe.py:269–296  ·  view source on GitHub ↗

Create the breadcrumb trail to this page of documentation. Args: path: string, Dot separated name of the resource. root_discovery: Deserialized discovery document. Returns: HTML with links to each of the parent resources of this resource.

(path, root_discovery)

Source from the content-addressed store, hash-verified

267
268
269def breadcrumbs(path, root_discovery):
270 """Create the breadcrumb trail to this page of documentation.
271
272 Args:
273 path: string, Dot separated name of the resource.
274 root_discovery: Deserialized discovery document.
275
276 Returns:
277 HTML with links to each of the parent resources of this resource.
278 """
279 parts = path.split(".")
280
281 crumbs = []
282 accumulated = []
283
284 for i, p in enumerate(parts):
285 prefix = ".".join(accumulated)
286 # The first time through prefix will be [], so we avoid adding in a
287 # superfluous '.' to prefix.
288 if prefix:
289 prefix += "."
290 display = p
291 if i == 0:
292 display = root_discovery.get("title", display)
293 crumbs.append('<a href="{}.html">{}</a>'.format(prefix + p, display))
294 accumulated.append(p)
295
296 return " . ".join(crumbs)
297
298
299def document_collection(resource, path, root_discovery, discovery, css=CSS):

Callers 1

document_collectionFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…