Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MkDocs reference share buttons #36

Merged
merged 2 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions plugin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def insert_content(soup, content_to_insert):
if comments_header := soup.find("h2", id="__comments"):
comments_header.insert_before(content_to_insert)
# Fallback: append the content to the md-typeset div if the comments header is not found
if md_typeset := soup.select_one(".md-typeset"):
if md_typeset := soup.select_one(".md-content__inner"):
md_typeset.append(content_to_insert)

def on_post_page(self, output, page, config):
Expand Down Expand Up @@ -183,9 +183,7 @@ def on_post_page(self, output, page, config):
if self.config["add_authors"]:
if self.config["add_dates"]:
dates_and_authors_div += "<br>"
authors_str = ", ".join(
[f"<a href='{author[1]}'>{author[0]}</a> ({author[2]})" for author in git_info["authors"]]
)
authors_str = ", ".join([f"<a href='{a[1]}'>{a[0]}</a> ({a[2]})" for a in git_info["authors"]])
glenn-jocher marked this conversation as resolved.
Show resolved Hide resolved
dates_and_authors_div += f"Authors: {authors_str}"

dates_and_authors_div += "</div>"
Expand Down
44 changes: 22 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mkdocs-ultralytics-plugin"
version = "0.0.37"
version = "0.0.38"
description = "An MkDocs plugin that provides Ultralytics Docs customizations at https://docs.ultralytics.com."
readme = "README.md"
requires-python = ">=3.8"
Expand All @@ -19,28 +19,28 @@ maintainers = [
{ name = "Glenn Jocher", email = "[email protected]" } # Optional
]
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
] # Optional, for a list of valid classifiers, see https://pypi.org/classifiers/
dependencies = [
'mkdocs>=1.0',
'beautifulsoup4>=4.9.3',
'pyyaml',
'requests>=2.31.0',
"mkdocs>=1.0",
"beautifulsoup4>=4.9.3",
"pyyaml",
"requests>=2.31.0",
]

[project.urls] # Optional
Expand All @@ -49,7 +49,7 @@ dependencies = [
"Source" = "https://github.com/ultralytics/mkdocs/"

[project.entry-points."mkdocs.plugins"]
ultralytics = "plugin:MetaPlugin" # executes the function `MetaPlugin` from this package when 'plugin' is called.
ultralytics = "plugin:MetaPlugin" # executes the function `MetaPlugin` from this package when "plugin" is called.

[project.optional-dependencies] # Optional
dev = ["pytest"]
Expand Down
Loading