From 292018dfec589d575f1e6b22b828a7336f562de3 Mon Sep 17 00:00:00 2001 From: Alper Yazar Date: Fri, 14 Jun 2024 20:05:37 +0300 Subject: [PATCH] back to rtd theme with centering --- Pipfile | 2 +- Pipfile-rtd => Pipfile-furo | 5 +- .../{_static => _static-furo}/custom.css | 0 docs/source/_static-rtd/width.css | 4 -- .../{_static-rtd => _static}/colors.css | 0 docs/source/{_static-rtd => _static}/font.css | 13 +++- .../source/{_static-rtd => _static}/table.css | 0 docs/source/_static/width.css | 9 +++ .../.gitkeep | 0 .../{_templates => _templates-furo}/base.html | 0 .../{_templates => _templates-furo}/page.html | 0 .../sidebar/brand.html | 0 docs/source/_templates/layout.html | 61 +++++++++++++++++++ .../layout.html.old} | 0 docs/source/{conf-rtd.py => conf-furo.py} | 49 ++++++++------- docs/source/conf.py | 48 ++++++--------- 16 files changed, 132 insertions(+), 59 deletions(-) rename Pipfile-rtd => Pipfile-furo (85%) rename docs/source/{_static => _static-furo}/custom.css (100%) delete mode 100644 docs/source/_static-rtd/width.css rename docs/source/{_static-rtd => _static}/colors.css (100%) rename docs/source/{_static-rtd => _static}/font.css (87%) rename docs/source/{_static-rtd => _static}/table.css (100%) create mode 100644 docs/source/_static/width.css rename docs/source/{_templates-rtd => _templates-furo}/.gitkeep (100%) rename docs/source/{_templates => _templates-furo}/base.html (100%) rename docs/source/{_templates => _templates-furo}/page.html (100%) rename docs/source/{_templates => _templates-furo}/sidebar/brand.html (100%) create mode 100644 docs/source/_templates/layout.html rename docs/source/{_templates-rtd/layout.html => _templates/layout.html.old} (100%) rename docs/source/{conf-rtd.py => conf-furo.py} (65%) diff --git a/Pipfile b/Pipfile index 034dd928..32d4e98c 100644 --- a/Pipfile +++ b/Pipfile @@ -5,7 +5,7 @@ name = "pypi" [packages] myst-parser = "*" -furo = "==2024.4.27" +sphinx-rtd-theme = "==2.0.0" Sphinx = "*" # Netlify supports only Python 3.8, so the latest compatible version is sphinx-autobuild = "==2021.3.14" #2024.4.13 gives watchfiles error. See: https://github.com/sphinx-doc/sphinx-autobuild/pull/152 diff --git a/Pipfile-rtd b/Pipfile-furo similarity index 85% rename from Pipfile-rtd rename to Pipfile-furo index f5d64aaa..034dd928 100644 --- a/Pipfile-rtd +++ b/Pipfile-furo @@ -5,7 +5,7 @@ name = "pypi" [packages] myst-parser = "*" -sphinx-rtd-theme = "==2.0.0" +furo = "==2024.4.27" Sphinx = "*" # Netlify supports only Python 3.8, so the latest compatible version is sphinx-autobuild = "==2021.3.14" #2024.4.13 gives watchfiles error. See: https://github.com/sphinx-doc/sphinx-autobuild/pull/152 @@ -14,8 +14,7 @@ sphinxcontrib-youtube = "*" sphinx-sitemap = "*" sphinx-copybutton = "*" sphinxext-opengraph = "*" -sphinx-disqus = "*" -"sphinxcontrib.asciinema" = "*" +"sphinxcontrib.asciinema" = "==0.3.8" [dev-packages] diff --git a/docs/source/_static/custom.css b/docs/source/_static-furo/custom.css similarity index 100% rename from docs/source/_static/custom.css rename to docs/source/_static-furo/custom.css diff --git a/docs/source/_static-rtd/width.css b/docs/source/_static-rtd/width.css deleted file mode 100644 index 707cf8a7..00000000 --- a/docs/source/_static-rtd/width.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Ref: https://stackoverflow.com/a/33626140/1766391 */ -.wy-nav-content { - max-width: 960px !important; -} diff --git a/docs/source/_static-rtd/colors.css b/docs/source/_static/colors.css similarity index 100% rename from docs/source/_static-rtd/colors.css rename to docs/source/_static/colors.css diff --git a/docs/source/_static-rtd/font.css b/docs/source/_static/font.css similarity index 87% rename from docs/source/_static-rtd/font.css rename to docs/source/_static/font.css index 1bf07598..d7d7248e 100644 --- a/docs/source/_static-rtd/font.css +++ b/docs/source/_static/font.css @@ -5,7 +5,7 @@ body { } pre { - font-family: 'JetBrains Mono', monospace !important; + font-family: 'Reddit Mono', monospace !important; font-size: smaller !important; } @@ -31,9 +31,11 @@ p, li { font-size: 1.1rem !important; } +/* .rst-content code { font-size: 85% !important; } +*/ .rst-content img { margin: 6px; @@ -59,11 +61,18 @@ figure.thmbnl img { } /* https://stackoverflow.com/a/52058198/1766391 */ -a[target="_blank"]::after { +article a[href^="http://"]:not([href^="http://ayazar.dev"])::after, +article a[href^="https://"]:not([href^="https://ayazar.dev"])::after{ content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==); margin: 0 3px 0 5px; } +.section p, +.simple li, +section>p { + text-align:justify +} + /* .document h1, .document h2, .document h3, .document h4, .document h5, .document h6 { font-size: 115%; diff --git a/docs/source/_static-rtd/table.css b/docs/source/_static/table.css similarity index 100% rename from docs/source/_static-rtd/table.css rename to docs/source/_static/table.css diff --git a/docs/source/_static/width.css b/docs/source/_static/width.css new file mode 100644 index 00000000..8ab07360 --- /dev/null +++ b/docs/source/_static/width.css @@ -0,0 +1,9 @@ +/* Ref: https://stackoverflow.com/a/33626140/1766391 */ +.wy-nav-content { + max-width: 1024px !important; + margin: auto; +} + +.wy-nav-content-wrap { + background-color: #fcfcfc; +} diff --git a/docs/source/_templates-rtd/.gitkeep b/docs/source/_templates-furo/.gitkeep similarity index 100% rename from docs/source/_templates-rtd/.gitkeep rename to docs/source/_templates-furo/.gitkeep diff --git a/docs/source/_templates/base.html b/docs/source/_templates-furo/base.html similarity index 100% rename from docs/source/_templates/base.html rename to docs/source/_templates-furo/base.html diff --git a/docs/source/_templates/page.html b/docs/source/_templates-furo/page.html similarity index 100% rename from docs/source/_templates/page.html rename to docs/source/_templates-furo/page.html diff --git a/docs/source/_templates/sidebar/brand.html b/docs/source/_templates-furo/sidebar/brand.html similarity index 100% rename from docs/source/_templates/sidebar/brand.html rename to docs/source/_templates-furo/sidebar/brand.html diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html new file mode 100644 index 00000000..905dc0ad --- /dev/null +++ b/docs/source/_templates/layout.html @@ -0,0 +1,61 @@ +{% extends '!layout.html' %} + +{% block extrahead %} + + + +{%- if SPHINXPRODUCTION %} + + + + +{%- endif %} +{% endblock %} + +{% block extrabody %} +{% endblock %} + +{% block footer %} + +
+ + + +{%- if SPHINXPRODUCTION %} + + + + + +{%- endif %} +{% endblock %} diff --git a/docs/source/_templates-rtd/layout.html b/docs/source/_templates/layout.html.old similarity index 100% rename from docs/source/_templates-rtd/layout.html rename to docs/source/_templates/layout.html.old diff --git a/docs/source/conf-rtd.py b/docs/source/conf-furo.py similarity index 65% rename from docs/source/conf-rtd.py rename to docs/source/conf-furo.py index 33b7211f..9eecc57d 100644 --- a/docs/source/conf-rtd.py +++ b/docs/source/conf-furo.py @@ -19,7 +19,7 @@ project = 'Alper Yazar' copyright = '2011-2024, Alper Yazar. Licensed under CC BY-SA 4.0' -html_title = "ayazar.dev" +html_title = "Alper Yazar" author = 'Alper Yazar' # The full version, including alpha/beta/rc tags @@ -33,14 +33,12 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['myst_parser', -'sphinx_rtd_theme', 'sphinx.ext.todo', 'sphinx_last_updated_by_git', 'sphinxcontrib.youtube', 'sphinx_sitemap', 'sphinx_copybutton', 'sphinxext.opengraph', -'sphinx_disqus.disqus', 'sphinxcontrib.asciinema' ] @@ -65,7 +63,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = 'furo' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -73,12 +71,13 @@ html_static_path = ['_static'] # https://stackoverflow.com/a/64106835 -html_css_files = ["colors.css","table.css","font.css","width.css"] +html_css_files = ["custom.css"] # https://stackoverflow.com/a/54665517/1766391 html_favicon = 'favicon.ico' # https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_logo +# https://pradyunsg.me/furo/customisation/logo/#same-logo-for-light-and-dark-mode html_logo = 'logo.png' # https://stackoverflow.com/a/53288958/1766391 @@ -89,20 +88,30 @@ # https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html html_theme_options = { - 'analytics_id': 'G-FHLWHCPSG0', - 'display_version': True, - 'style_external_links': True, - 'prev_next_buttons_location': 'both', - 'navigation_depth': 4, - 'collapse_navigation': False -} - -html_context = { - "display_github" : True, - "github_user": "alperyazar", - "github_repo": "ayazar.dev", - "github_version": "master", - "conf_py_path": "/docs/source/" +# 'announcement': 'Web sitemi tekrar düzenliyorum. Eksik içerikler, çalışmayan bağlantılar olabilir. 😇', + 'source_repository': 'https://github.com/alperyazar/ayazar.dev/', + 'source_branch': 'master', + 'source_directory': 'docs/source/', + "light_css_variables": { + "font-stack": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji", + "font-stack--monospace": "\"Reddit Mono\", \"SFMono-Regular\", Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace", + "color-brand-primary": "#111", + "color-brand-content": "#111", + "color-brand-visited": "#111", + "ayazardev-bold": "#fabfc8", + "ayazardev-em": "#c0eeff", + "ayazardev-article-color": "#111", + "ayazardev-aftera": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);" + }, + "dark_css_variables": { + "color-brand-primary": "#d0d0d0", + "color-brand-content": "#d0d0d0", + "color-brand-visited": "#d0d0d0", + "ayazardev-bold": "#995d6d", + "ayazardev-em": "#266173", + "ayazardev-article-color": "#d0d0d0", + "ayazardev-aftera": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAP0lEQVQY042PSQoAMAgDO+L/v2xPhVITbG7RkIVlUFV1c9oBUOJ8n84xpthjEj8igJhEtovjLVoNs2MUUsUpbMPMLAXUjJjTAAAAAElFTkSuQmCC);" + } } language = 'tr' @@ -120,5 +129,3 @@ "enable": False #disabled. can be enabled after https://github.com/wpilibsuite/sphinxext-opengraph/pull/110 due to emoji } -# https://pypi.org/project/sphinx-disqus/ -disqus_shortname = "ayazardev" diff --git a/docs/source/conf.py b/docs/source/conf.py index 9eecc57d..0ab10ae4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,7 +19,7 @@ project = 'Alper Yazar' copyright = '2011-2024, Alper Yazar. Licensed under CC BY-SA 4.0' -html_title = "Alper Yazar" +html_title = "ayazar.dev" author = 'Alper Yazar' # The full version, including alpha/beta/rc tags @@ -33,6 +33,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['myst_parser', +'sphinx_rtd_theme', 'sphinx.ext.todo', 'sphinx_last_updated_by_git', 'sphinxcontrib.youtube', @@ -63,7 +64,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'furo' +html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -71,13 +72,12 @@ html_static_path = ['_static'] # https://stackoverflow.com/a/64106835 -html_css_files = ["custom.css"] +html_css_files = ["colors.css","table.css","font.css","width.css"] # https://stackoverflow.com/a/54665517/1766391 html_favicon = 'favicon.ico' # https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_logo -# https://pradyunsg.me/furo/customisation/logo/#same-logo-for-light-and-dark-mode html_logo = 'logo.png' # https://stackoverflow.com/a/53288958/1766391 @@ -88,30 +88,20 @@ # https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html html_theme_options = { -# 'announcement': 'Web sitemi tekrar düzenliyorum. Eksik içerikler, çalışmayan bağlantılar olabilir. 😇', - 'source_repository': 'https://github.com/alperyazar/ayazar.dev/', - 'source_branch': 'master', - 'source_directory': 'docs/source/', - "light_css_variables": { - "font-stack": "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji", - "font-stack--monospace": "\"Reddit Mono\", \"SFMono-Regular\", Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace", - "color-brand-primary": "#111", - "color-brand-content": "#111", - "color-brand-visited": "#111", - "ayazardev-bold": "#fabfc8", - "ayazardev-em": "#c0eeff", - "ayazardev-article-color": "#111", - "ayazardev-aftera": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);" - }, - "dark_css_variables": { - "color-brand-primary": "#d0d0d0", - "color-brand-content": "#d0d0d0", - "color-brand-visited": "#d0d0d0", - "ayazardev-bold": "#995d6d", - "ayazardev-em": "#266173", - "ayazardev-article-color": "#d0d0d0", - "ayazardev-aftera": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAP0lEQVQY042PSQoAMAgDO+L/v2xPhVITbG7RkIVlUFV1c9oBUOJ8n84xpthjEj8igJhEtovjLVoNs2MUUsUpbMPMLAXUjJjTAAAAAElFTkSuQmCC);" - } + 'analytics_id': 'G-FHLWHCPSG0', + 'display_version': True, + 'style_external_links': True, + 'prev_next_buttons_location': 'both', + 'navigation_depth': 4, + 'collapse_navigation': False +} + +html_context = { + "display_github" : True, + "github_user": "alperyazar", + "github_repo": "ayazar.dev", + "github_version": "master", + "conf_py_path": "/docs/source/" } language = 'tr' @@ -129,3 +119,5 @@ "enable": False #disabled. can be enabled after https://github.com/wpilibsuite/sphinxext-opengraph/pull/110 due to emoji } +# https://pypi.org/project/sphinx-disqus/ +# disqus_shortname = "ayazardev"