mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-12-18 02:15:56 +01:00
Added first example to documentation
This commit is contained in:
parent
9888723f86
commit
fc45f52336
4
.gitignore
vendored
4
.gitignore
vendored
@ -55,10 +55,6 @@ example.zip
|
||||
# Never ignore .gitkeep files
|
||||
!**/.gitkeep
|
||||
|
||||
# Husky hooks
|
||||
.husky/.gitignore
|
||||
.husky/_
|
||||
|
||||
# macOS internals
|
||||
.DS_Store
|
||||
|
||||
|
@ -31,6 +31,7 @@ For a list of all settings, please consult the [plugin documentation].
|
||||
|
||||
<!-- md:version 8.5.0 -->
|
||||
<!-- md:flag experimental -->
|
||||
<!-- md:download tags-with-icons -->
|
||||
|
||||
Each tag can be associated with an icon, which is then rendered inside the tag.
|
||||
Before assigning icons to tags, associate each tag with a unique identifier,
|
||||
|
@ -54,6 +54,7 @@ def on_page_markdown(
|
||||
elif type == "plugin": return _badge_for_plugin(args, page, files)
|
||||
elif type == "extension": return _badge_for_extension(args, page, files)
|
||||
elif type == "utility": return _badge_for_utility(args, page, files)
|
||||
elif type == "download": return _badge_for_download(args, page, files)
|
||||
elif type == "default":
|
||||
if args == "none": return _badge_for_default_none(page, files)
|
||||
elif args == "computed": return _badge_for_default_computed(page, files)
|
||||
@ -190,6 +191,14 @@ def _badge_for_utility(text: str, page: Page, files: Files):
|
||||
text = text
|
||||
)
|
||||
|
||||
# Create badge for download
|
||||
def _badge_for_download(text: str, page: Page, files: Files):
|
||||
icon = "material-folder-download"
|
||||
href = f"https://mkdocs-material.github.io/examples/{text}/"
|
||||
return _badge(
|
||||
icon = f"[:{icon}:]({href} 'View example and download as .zip')"
|
||||
)
|
||||
|
||||
# Create badge for default value
|
||||
def _badge_for_default(text: str, page: Page, files: Files):
|
||||
icon = "material-water"
|
||||
|
@ -54,6 +54,7 @@ def on_page_markdown(
|
||||
elif type == "plugin": return _badge_for_plugin(args, page, files)
|
||||
elif type == "extension": return _badge_for_extension(args, page, files)
|
||||
elif type == "utility": return _badge_for_utility(args, page, files)
|
||||
elif type == "download": return _badge_for_download(args, page, files)
|
||||
elif type == "default":
|
||||
if args == "none": return _badge_for_default_none(page, files)
|
||||
elif args == "computed": return _badge_for_default_computed(page, files)
|
||||
@ -190,6 +191,14 @@ def _badge_for_utility(text: str, page: Page, files: Files):
|
||||
text = text
|
||||
)
|
||||
|
||||
# Create badge for download
|
||||
def _badge_for_download(text: str, page: Page, files: Files):
|
||||
icon = "material-folder-download"
|
||||
href = f"https://mkdocs-material.github.io/examples/{text}/"
|
||||
return _badge(
|
||||
icon = f"[:{icon}:]({href} 'View example and download as .zip')"
|
||||
)
|
||||
|
||||
# Create badge for default value
|
||||
def _badge_for_default(text: str, page: Page, files: Files):
|
||||
icon = "material-water"
|
||||
|
Loading…
Reference in New Issue
Block a user