mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Formatting
This commit is contained in:
parent
c383892aae
commit
31518177b3
@ -20,6 +20,7 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import posixpath
|
||||
import re
|
||||
import requests
|
||||
import sys
|
||||
@ -28,10 +29,9 @@ from collections import defaultdict
|
||||
from hashlib import md5
|
||||
from io import BytesIO
|
||||
from mkdocs.commands.build import DuplicateFilter
|
||||
from mkdocs.config.base import Config
|
||||
from mkdocs.config import config_options as opt
|
||||
from mkdocs.config.base import Config
|
||||
from mkdocs.plugins import BasePlugin
|
||||
import posixpath
|
||||
from shutil import copyfile
|
||||
from tempfile import TemporaryFile
|
||||
from zipfile import ZipFile
|
||||
@ -47,7 +47,7 @@ except ImportError:
|
||||
# Class
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Configuration scheme
|
||||
# Social plugin configuration scheme
|
||||
class SocialPluginConfig(Config):
|
||||
enabled = opt.Type(bool, default = True)
|
||||
cache_dir = opt.Type(str, default = ".cache/plugin/social")
|
||||
@ -55,9 +55,11 @@ class SocialPluginConfig(Config):
|
||||
# Options for social cards
|
||||
cards = opt.Type(bool, default = True)
|
||||
cards_dir = opt.Type(str, default = "assets/images/social")
|
||||
cards_color = opt.Type(dict, default = {})
|
||||
cards_color = opt.Type(dict, default = dict())
|
||||
cards_font = opt.Optional(opt.Type(str))
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Social plugin
|
||||
class SocialPlugin(BasePlugin[SocialPluginConfig]):
|
||||
|
||||
|
@ -34,10 +34,11 @@ from mkdocs.plugins import BasePlugin
|
||||
# Class
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Configuration scheme
|
||||
# Tags plugin configuration scheme
|
||||
class TagsPluginConfig(Config):
|
||||
tags_file = opt.Optional(opt.Type(str))
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Tags plugin
|
||||
class TagsPlugin(BasePlugin[TagsPluginConfig]):
|
||||
@ -120,7 +121,6 @@ class TagsPlugin(BasePlugin[TagsPluginConfig]):
|
||||
classes = " ".join(classes)
|
||||
content = [f"## <span class=\"{classes}\">{tag}</span>", ""]
|
||||
for page in pages:
|
||||
|
||||
url = utils.get_relative_url(
|
||||
page.file.src_uri,
|
||||
self.tags_file.src_uri
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import posixpath
|
||||
import re
|
||||
import requests
|
||||
import sys
|
||||
@ -28,10 +29,9 @@ from collections import defaultdict
|
||||
from hashlib import md5
|
||||
from io import BytesIO
|
||||
from mkdocs.commands.build import DuplicateFilter
|
||||
from mkdocs.config.base import Config
|
||||
from mkdocs.config import config_options as opt
|
||||
from mkdocs.config.base import Config
|
||||
from mkdocs.plugins import BasePlugin
|
||||
import posixpath
|
||||
from shutil import copyfile
|
||||
from tempfile import TemporaryFile
|
||||
from zipfile import ZipFile
|
||||
@ -47,7 +47,7 @@ except ImportError:
|
||||
# Class
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Configuration scheme
|
||||
# Social plugin configuration scheme
|
||||
class SocialPluginConfig(Config):
|
||||
enabled = opt.Type(bool, default = True)
|
||||
cache_dir = opt.Type(str, default = ".cache/plugin/social")
|
||||
@ -55,9 +55,11 @@ class SocialPluginConfig(Config):
|
||||
# Options for social cards
|
||||
cards = opt.Type(bool, default = True)
|
||||
cards_dir = opt.Type(str, default = "assets/images/social")
|
||||
cards_color = opt.Type(dict, default = {})
|
||||
cards_color = opt.Type(dict, default = dict())
|
||||
cards_font = opt.Optional(opt.Type(str))
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Social plugin
|
||||
class SocialPlugin(BasePlugin[SocialPluginConfig]):
|
||||
|
||||
|
@ -34,10 +34,11 @@ from mkdocs.plugins import BasePlugin
|
||||
# Class
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Configuration scheme
|
||||
# Tags plugin configuration scheme
|
||||
class TagsPluginConfig(Config):
|
||||
tags_file = opt.Optional(opt.Type(str))
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Tags plugin
|
||||
class TagsPlugin(BasePlugin[TagsPluginConfig]):
|
||||
@ -120,7 +121,6 @@ class TagsPlugin(BasePlugin[TagsPluginConfig]):
|
||||
classes = " ".join(classes)
|
||||
content = [f"## <span class=\"{classes}\">{tag}</span>", ""]
|
||||
for page in pages:
|
||||
|
||||
url = utils.get_relative_url(
|
||||
page.file.src_uri,
|
||||
self.tags_file.src_uri
|
||||
|
Loading…
Reference in New Issue
Block a user