Skip to content

Commit

Permalink
Drop python 3.7 support and fix broken links in docs (#200)
Browse files Browse the repository at this point in the history
* Update check-docs-for-broken-links.yaml

* Fix social share image link

* Add correct link for mathjax js

* Use site_url while constructing the link for social share image

* Update basic user guide link in docs

* Update check-docs-for-broken-links.yaml

* Use site_url while constructing the link for social share image

* Import only testing module from pandas

* Use site_url while constructing the link for social share image

* Drop python 3.7 support
  • Loading branch information
harishmohanraj authored Jun 26, 2023
1 parent f76238f commit bc21192
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos]
version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/site_overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% elif page and page.title and not page.is_homepage %}
{% set title = title ~ " - " ~ page.title | striptags %}
{% endif %}
{% set image_url = page.canonical_url ~ "" ~ config.extra.social_image %}
{% set image_url = config.site_url ~ ("" if config.site_url.endswith("/") else "/") ~ config.extra.social_image %}
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ title }}" />
<meta property="og:description" content="{{ config.site_description }}" />
Expand Down
2 changes: 1 addition & 1 deletion nbdev_mkdocs/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.2rc0"
__version__ = "0.6.0rc0"
2 changes: 1 addition & 1 deletion nbdev_mkdocs/social_image_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def _update_social_image_in_site_overrides(root_path: str, image_url: str) -> No
The above docstring is autogenerated by docstring-gen library (https://github.com/airtai/docstring-gen)
"""
_replace_str = (
'page.canonical_url ~ "" ~ config.extra.social_image '
'config.site_url ~ ("" if config.site_url.endswith("/") else "/") ~ config.extra.social_image '
if is_local_path(image_url)
else "config.extra.social_image "
)
Expand Down
38 changes: 21 additions & 17 deletions nbs/Social_Image_Generator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpl899db1l/dst_path/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpl899db1l/dst_path/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpl899db1l/dst_path/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpl899db1l/dst_path/mkdocs/docs_overrides/images/social_image.png'\n"
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmp16hxplap/dst_path/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmp16hxplap/dst_path/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmp16hxplap/dst_path/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmp16hxplap/dst_path/mkdocs/docs_overrides/images/social_image.png'\n"
]
}
],
Expand Down Expand Up @@ -496,7 +496,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpzat45v9m/mkdocs/docs_overrides/images/social_image.png'\n"
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmp4601wh7k/mkdocs/docs_overrides/images/social_image.png'\n"
]
}
],
Expand Down Expand Up @@ -784,7 +784,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmprufapjv9/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpl1wm149b/mkdocs/docs_overrides/images/social_image.png'\n",
"https://my-random-domain/sample.png\n",
"overrides/images/social_image.png\n",
"site_name: Test site\n",
Expand Down Expand Up @@ -897,7 +897,7 @@
" The above docstring is autogenerated by docstring-gen library (https://github.com/airtai/docstring-gen)\n",
" \"\"\"\n",
" _replace_str = (\n",
" 'page.canonical_url ~ \"\" ~ config.extra.social_image '\n",
" 'config.site_url ~ (\"\" if config.site_url.endswith(\"/\") else \"/\") ~ config.extra.social_image '\n",
" if is_local_path(image_url)\n",
" else \"config.extra.social_image \"\n",
" )\n",
Expand Down Expand Up @@ -940,7 +940,8 @@
" {% elif page and page.title and not page.is_homepage %}\n",
" {% set title = title ~ \" - \" ~ page.title | striptags %}\n",
" {% endif %}\n",
" {% set image_url = page.canonical_url ~ \"\" ~ config.extra.social_image %}\n",
" {% set trailing_slash = \"\" if config.site_url.endswith(\"/\") else \"/\" %}\n",
" {% set image_url = config.site_url ~ (\"\" if config.site_url.endswith(\"/\") else \"/\") ~ config.extra.social_image %}\n",
" <meta property=\"og:type\" content=\"website\" />\n",
" <meta property=\"og:title\" content=\"{{ title }}\" />\n",
" <meta property=\"og:description\" content=\"{{ config.site_description }}\" />\n",
Expand Down Expand Up @@ -986,7 +987,7 @@
" print(actual)\n",
"\n",
" assert (\n",
" '{% set image_url = page.canonical_url ~ \"\" ~ config.extra.social_image %}'\n",
" '{% set image_url = config.site_url ~ (\"\" if config.site_url.endswith(\"/\") else \"/\") ~ config.extra.social_image %}'\n",
" in actual\n",
" ), actual"
]
Expand All @@ -1010,6 +1011,7 @@
" {% elif page and page.title and not page.is_homepage %}\n",
" {% set title = title ~ \" - \" ~ page.title | striptags %}\n",
" {% endif %}\n",
" {% set trailing_slash = \"\" if config.site_url.endswith(\"/\") else \"/\" %}\n",
" {% set image_url = config.extra.social_image %}\n",
" <meta property=\"og:type\" content=\"website\" />\n",
" <meta property=\"og:title\" content=\"{{ title }}\" />\n",
Expand Down Expand Up @@ -1194,7 +1196,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[31mUnexpected error: path /private/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpyz7hj_pg/invalid_image_path.png does not exists!\u001b[0m\n"
"\u001b[31mUnexpected error: path /private/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmp2o74__rq/invalid_image_path.png does not exists!\u001b[0m\n"
]
},
{
Expand Down Expand Up @@ -1228,7 +1230,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"/private/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpp28ajar0/valid_image_path.png\n"
"/private/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpg8lh6g5l/valid_image_path.png\n"
]
}
],
Expand Down Expand Up @@ -1264,7 +1266,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"/private/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpxmvj_xds/valid_image_path.png\n"
"/private/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpbyzdgiym/valid_image_path.png\n"
]
}
],
Expand Down Expand Up @@ -1304,7 +1306,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"/private/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmp9cv56lho/mkdocs/docs_overrides/images/default_social_logo.png\n"
"/private/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpzozmfb7a/mkdocs/docs_overrides/images/default_social_logo.png\n"
]
}
],
Expand Down Expand Up @@ -1369,7 +1371,7 @@
"output_type": "stream",
"text": [
"************************************************************************************************************************\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpnoir9d8x/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmp1mgox1ev/mkdocs/docs_overrides/images/social_image.png'\n",
"overrides/images/social_image.png\n",
"{% extends \"base.html\" %}\n",
"\n",
Expand All @@ -1380,7 +1382,8 @@
" {% elif page and page.title and not page.is_homepage %}\n",
" {% set title = title ~ \" - \" ~ page.title | striptags %}\n",
" {% endif %}\n",
" {% set image_url = page.canonical_url ~ \"\" ~ config.extra.social_image %}\n",
" {% set trailing_slash = \"\" if config.site_url.endswith(\"/\") else \"/\" %}\n",
" {% set image_url = config.site_url ~ (\"\" if config.site_url.endswith(\"/\") else \"/\") ~ config.extra.social_image %}\n",
" <meta property=\"og:type\" content=\"website\" />\n",
" <meta property=\"og:title\" content=\"{{ title }}\" />\n",
" <meta property=\"og:description\" content=\"{{ config.site_description }}\" />\n",
Expand All @@ -1406,7 +1409,7 @@
"\n",
"\n",
"************************************************************************************************************************\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpc7rob39j/mkdocs/docs_overrides/images/social_image.png'\n",
"Social share image generated and saved at: '/var/folders/6n/3rjds7v52cd83wqkd565db0h0000gn/T/tmpuomv88ni/mkdocs/docs_overrides/images/social_image.png'\n",
"https://github.com/airtai/nbdev-mkdocs/raw/main/mkdocs/docs_overrides/images/default_social_logo.png\n",
"{% extends \"base.html\" %}\n",
"\n",
Expand All @@ -1417,6 +1420,7 @@
" {% elif page and page.title and not page.is_homepage %}\n",
" {% set title = title ~ \" - \" ~ page.title | striptags %}\n",
" {% endif %}\n",
" {% set trailing_slash = \"\" if config.site_url.endswith(\"/\") else \"/\" %}\n",
" {% set image_url = config.extra.social_image %}\n",
" <meta property=\"og:type\" content=\"website\" />\n",
" <meta property=\"og:title\" content=\"{{ title }}\" />\n",
Expand Down Expand Up @@ -1501,7 +1505,7 @@
"\n",
" if generator == \"file\":\n",
" assert (\n",
" '{% set image_url = page.canonical_url ~ \"\" ~ config.extra.social_image %}'\n",
" '{% set image_url = config.site_url ~ (\"\" if config.site_url.endswith(\"/\") else \"/\") ~ config.extra.social_image %}'\n",
" in actual\n",
" ), actual\n",
" elif generator == \"dall_e\":\n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/guides/Advanced_Customization_Options.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"source": [
"## Using Mathematical formulas\n",
"\n",
"[MathJax](https://www.mathjax.org/) is being already set up as described [here](https://squidfunk.github.io/mkdocs-material/reference/mathjax/#mkdocsyml).\n",
"[MathJax](https://www.mathjax.org/) is being already set up as described [here](https://squidfunk.github.io/mkdocs-material/reference/math/#mathjax).\n",
"\n",
"### Using the block syntax\n",
"Blocks must be enclosed in `$$...$$` or `\\[...\\]` on separate lines:\n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
"source": [
"The following quick start guide will walk you through installing and configuring nbdev-mkdocs for an existing nbdev project. It also assumes you've already initialized your project with nbdev and installed all of the required libraries.\n",
"\n",
"For detailed installation instructions and configuration options, please see the <a href=\"https://nbdev-mkdocs.airt.ai/guides/Basic_User_Guide/\">User Guide</a>.\n",
"For detailed installation instructions and configuration options, please see the <a href=\"https://nbdev-mkdocs.airt.ai/latest/guides/Basic_User_Guide/\">User Guide</a>.\n",
"\n",
"### Install\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
### Python library ###
repo = nbdev-mkdocs
lib_name = %(repo)s
version = 0.5.2rc0
min_python = 3.7
version = 0.6.0rc0
min_python = 3.8
license = apache2

### nbdev ###
Expand Down

0 comments on commit bc21192

Please sign in to comment.