@@ -54,7 +54,8 @@ def replace(match: Match):
54
54
elif type == "plugin" : return _badge_for_plugin (args , page , files )
55
55
elif type == "extension" : return _badge_for_extension (args , page , files )
56
56
elif type == "utility" : return _badge_for_utility (args , page , files )
57
- elif type == "example" : return _badge_for_example (args , page , files )
57
+ elif type == "example" : return _badge_for_example (args , page , files )
58
+ elif type == "demo" : return _badge_for_demo (args , page , files )
58
59
elif type == "default" :
59
60
if args == "none" : return _badge_for_default_none (page , files )
60
61
elif args == "computed" : return _badge_for_default_computed (page , files )
@@ -212,11 +213,21 @@ def _badge_for_example_download(text: str, page: Page, files: Files):
212
213
icon = "material-folder-download"
213
214
href = f"https://mkdocs-material.github.io/examples/{ text } .zip"
214
215
return _badge (
215
- icon = f"[:{ icon } :]({ href } 'Download example')" ,
216
+ icon = f"[:{ icon } :]({ href } 'Download example files ')" ,
216
217
text = f"[`.zip`]({ href } )" ,
217
218
type = "right"
218
219
)
219
220
221
+ # Create badge for demo repository
222
+ def _badge_for_demo (text : str , page : Page , files : Files ):
223
+ icon = "material-github"
224
+ href = f"https://github.com/mkdocs-material/{ text } "
225
+ return _badge (
226
+ icon = f"[:{ icon } :]({ href } 'Demo repository')" ,
227
+ text = text ,
228
+ type = "right"
229
+ )
230
+
220
231
# Create badge for default value
221
232
def _badge_for_default (text : str , page : Page , files : Files ):
222
233
icon = "material-water"
@@ -280,4 +291,4 @@ def _badge_for_experimental(page: Page, files: Files):
280
291
href = _resolve_path ("conventions.md#experimental" , page , files )
281
292
return _badge (
282
293
icon = f"[:{ icon } :]({ href } 'Experimental')"
283
- )
294
+ )
0 commit comments