MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / _prefix_version_entry

Function _prefix_version_entry

scripts/docs/prefix_version_paths.py:102–113  ·  view source on GitHub ↗

Return a new entry with all page paths under ``locale/`` prefixed with `` /`` (no ``versions/`` wrapper, since the slug becomes the URL segment). Adds ``tag: "Latest"`` to the default entry.

(entry: dict, locale: str)

Source from the content-addressed store, hash-verified

100
101
102def _prefix_version_entry(entry: dict, locale: str) -> dict:
103 """Return a new entry with all page paths under ``locale/`` prefixed with
104 ``<version_slug>/`` (no ``versions/`` wrapper, since the slug becomes the
105 URL segment). Adds ``tag: "Latest"`` to the default entry.
106 """
107 version_slug = entry["version"]
108 new_entry = _walk_pages(entry, _make_prefixer(locale, version_slug))
109
110 if new_entry.get("default") and "tag" not in new_entry:
111 new_entry["tag"] = LATEST_TAG
112
113 return new_entry
114
115
116def _build_edge_entry(latest_entry: dict, locale: str) -> dict:

Callers 1

_migrate_language_blockFunction · 0.85

Calls 3

_make_prefixerFunction · 0.85
_walk_pagesFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected