Skip to content

Commit

Permalink
Fix MkDocs reference share buttons (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Jan 21, 2024
1 parent 78a2f3f commit 6d146f8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }} # automatically generated
python: true
docstrings: true
markdown: true
prettier: true
spelling: true
links: true
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"]])
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

0 comments on commit 6d146f8

Please sign in to comment.