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

back to rtd theme with centering #34

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions Pipfile-rtd → Pipfile-furo
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,8 +14,7 @@ sphinxcontrib-youtube = "*"
sphinx-sitemap = "*"
sphinx-copybutton = "*"
sphinxext-opengraph = "*"
sphinx-disqus = "*"
"sphinxcontrib.asciinema" = "*"
"sphinxcontrib.asciinema" = "==0.3.8"

[dev-packages]

Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions docs/source/_static-rtd/width.css

This file was deleted.

File renamed without changes.
13 changes: 11 additions & 2 deletions docs/source/_static-rtd/font.css → docs/source/_static/font.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body {
}

pre {
font-family: 'JetBrains Mono', monospace !important;
font-family: 'Reddit Mono', monospace !important;
font-size: smaller !important;
}

Expand All @@ -31,9 +31,11 @@ p, li {
font-size: 1.1rem !important;
}

/*
.rst-content code {
font-size: 85% !important;
}
*/

.rst-content img {
margin: 6px;
Expand All @@ -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%;
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions docs/source/_static/width.css
Original file line number Diff line number Diff line change
@@ -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;
}
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{% extends '!layout.html' %}

{% block extrahead %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter&family=Reddit+Mono&display=swap" rel="stylesheet">
{%- if SPHINXPRODUCTION %}
<!-- Adsense -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4580059638713287"
crossorigin="anonymous"></script>
<!-- Buy me a coffee -->
<script data-name="BMC-Widget" data-cfasync="false" src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js" data-id="ayazar" data-description="Support me on Buy me a coffee!" data-message="" data-color="#FF5F5F" data-position="Right" data-x_margin="18" data-y_margin="18"></script>
{%- endif %}
{% endblock %}

{% block extrabody %}
{% endblock %}

{% block footer %}

<div id="progressBar" class="progress-bar"></div>

<script>
// Listen for scroll events on the window
window.onscroll = function() {
// Call the function to update the progress bar
updateProgressBar();
};

function updateProgressBar() {
// Get the total height of the page
var scrollHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight;
// Get the current scroll position
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
// Calculate the scroll percentage
var scrollPercentage = (scrollTop / scrollHeight) * 100;
// Update the width of the progress bar
document.getElementById("progressBar").style.width = scrollPercentage + "%";
}
</script>

{%- if SPHINXPRODUCTION %}
<!-- Default Statcounter code for ayazar.dev
https://ayazar.dev -->
<script type="text/javascript">
var sc_project=12886228;
var sc_invisible=1;
var sc_security="027dedf0";
</script>
<script type="text/javascript"
src="https://www.statcounter.com/counter/counter.js"
async></script>
<noscript><div class="statcounter"><a title="Web Analytics"
href="https://statcounter.com/" target="_blank"><img
class="statcounter"
src="https://c.statcounter.com/12886228/0/027dedf0/1/"
alt="Web Analytics"
referrerPolicy="no-referrer-when-downgrade"></a></div></noscript>
<!-- End of Statcounter Code -->
{%- endif %}
{% endblock %}
49 changes: 28 additions & 21 deletions docs/source/conf-rtd.py → docs/source/conf-furo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
]

Expand All @@ -65,20 +63,21 @@
# 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,
# so a file named "default.css" will overwrite the builtin "default.css".
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
Expand All @@ -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'
Expand All @@ -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"
48 changes: 20 additions & 28 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
Expand Down Expand Up @@ -63,21 +64,20 @@
# 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,
# so a file named "default.css" will overwrite the builtin "default.css".
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
Expand All @@ -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'
Expand All @@ -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"