MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / slugify

Function slugify

docs/website/scripts/split_courses.py:17–21  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

15
16
17def slugify(s: str) -> str:
18 s = s.lower().strip()
19 s = re.sub(r"[^a-z0-9]+", "-", s)
20 s = re.sub(r"-+", "-", s).strip("-")
21 return s or "lesson"
22
23
24def split_frontmatter(text: str) -> Tuple[str, str]:

Callers 1

write_lessonsFunction · 0.85

Calls 3

lowerMethod · 0.65
stripMethod · 0.45
subMethod · 0.45

Tested by

no test coverage detected