Skip to content

Commit

Permalink
Update to pydata_sphinx_theme and blog
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipMay committed Dec 7, 2023
1 parent 09f1241 commit e4ce6e0
Show file tree
Hide file tree
Showing 18 changed files with 298 additions and 264 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ help:

format:
mdformat --number .
black source

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.black]
line-length = 99
target-version = ["py310"]
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
sphinx
myst-parser
sphinx-book-theme
pydata-sphinx-theme
myst-nb
mdformat
sphinx-design
sphinx-copybutton
ablog
black[jupyter]
Binary file added source/_static/img/date-encoding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions source/blog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
# Blog

```{toctree}
:glob:
:titlesonly:
:reversed:
blog/*
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ We tell what is done differently with our model or the tokenizer than with other
explain the composition of our text corpus and illustrate the evaluation and
comparison of the language model.

[Slides](../_static/doc/German_Language_Model_Training_and_Evaluation.pdf) and
[Slides](/_static/doc/German_Language_Model_Training_and_Evaluation.pdf) and
[YouTube video](https://www.youtube.com/watch?v=cxgrTd2AQis) are available:
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

Some data, such as strings, must be encoded to be used in machine learning models. Here we explore the different options for encoding date fields.

:::{figure} /\_static/img/date-encoding.png
:width: 550px

Date encoding
:::

The general options to encode the time dimension like the birth date of a customer or the production time of a product are:

1. separate encoding of year, month and maybe also day and weekday
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

Today I published a new Wikipedia-based German text corpus. It is to be used for NLP machine learning tasks.

:::{figure} ../\_static/img/wikipedia.png
:width: 50 %
:::{figure} /\_static/img/wikipedia.png
:width: 550px

Wikipedia
:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This week I published a project to show how to combine
LightGBM and Optuna efficiently to train good models.
The purpose of this work is to be able to be reused as a template for new projects.

:::{figure} ../\_static/img/lightgbm-optuna.png
:width: 50 %
:::{figure} /\_static/img/lightgbm-optuna.png
:width: 550px

LightGBM & Optuna
:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ my colleague [Michal Harakal](https://www.harakal.de/) and I noticed that in man
sentence of the input text.
Instead, it should generate an independent summary of the whole text.

:::{figure} ../\_static/img/text-unsplash.jpg
:width: 50 %
:::{figure} /\_static/img/text-unsplash.jpg
:width: 550px

Photo by [Sandy Millar](https://unsplash.com/@sandym10?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash) on [Unsplash](https://unsplash.com/photos/a-close-up-of-a-book-with-some-type-of-text-Kl4LNdg6on4?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash)
:::
Expand Down
File renamed without changes.
File renamed without changes.
63 changes: 46 additions & 17 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

project = "May.la"
html_title = "May.la"
copyright = "2023, Philip May"
copyright = "2020 - 2023, Philip May"
author = "Philip May"

# -- General configuration ---------------------------------------------------
Expand All @@ -22,7 +22,7 @@
"ablog", # https://ablog.readthedocs.io/
]

templates_path = ['_templates']
templates_path = ["_templates"]
exclude_patterns = []

# implicit link header targets
Expand All @@ -32,25 +32,45 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

# https://github.com/executablebooks/sphinx-book-theme
# https://sphinx-book-theme.readthedocs.io/
html_theme = 'sphinx_book_theme'
# https://pydata-sphinx-theme.readthedocs.io/
html_theme = "pydata_sphinx_theme"

html_sidebars = {
"index": ["sidebar-nav-bs"],
"blog": [
"ablog/postcard.html",
"ablog/recentposts.html",
"ablog/tagcloud.html",
"ablog/categories.html",
"ablog/archives.html",
],
"blog/**": [
"ablog/postcard.html",
"ablog/recentposts.html",
"ablog/tagcloud.html",
"ablog/categories.html",
"ablog/archives.html",
],
}

#
html_theme_options = {
# "home_page_in_toc": True,
# "github_url": "https://github.com/PhilipMay/may-la-myst",
"repository_url": "https://github.com/PhilipMay/may-la-myst",
"repository_branch": "main",
"path_to_docs": "source",
"use_repository_button": True,
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/header-links.html#navigation-bar-dropdown-links
"header_links_before_dropdown": 6,
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html#hide-the-previous-and-next-buttons
"show_prev_next": False,
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/search.html#configure-the-search-bar-text
"search_bar_text": "Search this site...",
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html#add-an-edit-button
"use_edit_page_button": True,
"use_issues_button": True,
# "announcement": "<b>v2.0.0</b> is now out! See the Changelog for details",
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html#footer
"footer_start": ["copyright"],
"footer_end": [],
}

html_static_path = ['_static']
html_static_path = ["_static"]

html_extra_path = ['_extra']
html_extra_path = ["_extra"]

# https://myst-nb.readthedocs.io/en/latest/computation/execute.html
nb_execution_mode = "off"
Expand All @@ -74,7 +94,16 @@

# Blog config https://ablog.readthedocs.io/en/stable/manual/ablog-configuration-options.html
blog_authors = {
'PhilipMay': ('Philip May', 'http://may.la'),
"PhilipMay": ("Philip May", "http://may.la"),
}

blog_default_author='PhilipMay'
# https://ablog.readthedocs.io/en/stable/manual/ablog-configuration-options.html#confval-blog_default_author
blog_default_author = "PhilipMay"

# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html#github
html_context = {
"github_user": "PhilipMay",
"github_repo": "may-la-myst",
"github_version": "main",
"doc_path": "source",
}
Loading

0 comments on commit e4ce6e0

Please sign in to comment.