mischback / mischback.de Goto Github PK
View Code? Open in Web Editor NEWMy personal website
Home Page: https://mischback.de
License: MIT License
My personal website
Home Page: https://mischback.de
License: MIT License
Icons should be applied as eye candy to content boxes, navigation, etc.
To maintain scalability, the icons should be provided as SVGs. They may be created using Inkscape
, but will require (manual) optimization.
aside
box)aside
box (tubhrq))aside
box)
aside
box; main body of tags
documents)icons.svg
) containing the icons as SVG symbols
and inlining them using JavaScriptuse
can be applied to an external resource from the DOM; NOT POSSIBLE from within the CSS!use
)use
in combination with Sphinx's pathto()
function
style.css
html5validator
can also be used to check CSS filesThe content will be ordered using big categories, like Development, Knives, Misc. For additional ordering / more specific sorting, blog-style tags may be used.
There is a corresponding question on SO; the highest rated answer mentions Sphinx
's built-in index
directive.
Sphinx
's documentation has a guide on developing a recipe extension which also incorporates a custom index. This may be a really great resource, if the built-in index
is not sufficient out of the box.
Have the (generated) website placed in a container (e.g. Docker) and let it be analyzed by a robot / spider.
Check every document and track the following information:
#targets
)#targets
)Implementation in Python, most-likely multithreaded with a configurable number of worker threads beside the main management thread.
scss
css
libsass-python
(the actual compilation)stylelint
, run through pre-commit
(linting)
While this is highly related to #28, it's more about the general look'n'feel, e.g. how borders and shadows are applied.
Original Implementation #14 / #18
Just collecting this here, will be converted into actual issues when moving to dedicated repository.
KeyError
handling to CTTag.rm_doc()
(L291)rgb()
/ rgba()
instead of #rrggbb
Things to consider for the deployment (might be relevant for the webserver configuration)
.build/404/index.html
as custom 404 handler/favicon.ico
to the actual location in _static/icons/
See https://www.errbufferoverfl.me/now/ and more specifically https://nownownow.com/about
This is a follow up to #30.
font-display: swap;
MonaSans
:
Verdana
(availability Win/Mac > 99%)MonaSans
settings
font-family: "Mona-Sans.woff2"
font-size: 18px
line-height: 1.5
font-weight: 400;
Verdana
settings
font-size: 16px
line-height: 1.7
font-family: Verdana
Turn #5 into an article.
tox
4.0 was released and is not backwards compatible.
However, updating tox
introduces errors in CI, see https://github.com/Mischback/mischback.de/actions/runs/3726415701/jobs/6319849632
Eventually this has to be done, but will require a little more effort.
See 44ac2d5
note
and important
may be assumed. Additionally I want to provide a tldr
admonition for short summaries.
theme/mischback/_src/style/components/admonitions.scss
)/home/[CATEGORY]
::before
element to insert $ pwd
--> moved to #122#
A
rating? --> #28)<link rel= ...
in the layout's <head>
.ico
really required for a 2024 project with a rather moder audience?<title>
must be set to an actual title, depending on the documentl10n
enginel10n
engine)l10n
engine, but may aswell be provided as dedicated documents)rst
or md
source files without limiting authoringjQuery
)This is issue is meant to collect everything that is not handled immediately.
tag_index.html
should provide the available tags as a tag cloud
::before
element to insert $ pwd
mailsrv
config, has some more Python-related stuffpre-commit
hooksThis will still need more research!
Ok, so the DSGVO / GDPR considers even the users' IP address personal data, which means, that storing and processing this data is regulated (strictly).
On the other hand, protecting my own server, e.g. fail2ban
, works by analyzing the log files and requires the real IP addresses to work properly.
As of now, this issue is just used to collect resources on SEO.
By default, sphinx
does include a _sources
directory in the build. This is not required / desired.
Little overview article regarding my Keychron V4, including the performed hardware mods.
/misc/keyboards/...
?/misc/keyboards/qmk/...
The category overview pages should provide a spotlight, a box with images linking to selected articles.
index.rst
document
.build
As of now, the project uses python-libsass
, but libsass
is considered deprecated and will not longer receive updates.
Actually I encountered a bug during theme development: while using rgba(0, 0, 0, 0.95)
, python-libsass
generates "black"
, which is - obviously - wrong. A manual test with dart-sass
is successful.
sass
through NodeJS (NPM package)Currently, Sphinx
's configuration file conf.py
acts like one of the project's extensions.
While this works reasonably well for small use-cases (see #5), it is not the desired result.
Sphinx
's most basic tutorial places the (custom) extension in a folder _ext
in the source directory.
From my understanding, the _ext
directory may be placed anywhere. It has to be added to Python's PATH
. See the section on extending sys.path
.
Namespacing might be an issue, so make sure that the project's dedicated extensions don't conflict with other existing extensions (or other packages).
[REPO_ROOT]/extensions/mischback
[REPO_ROOT]/extensions
to Python path
conf.py
:
import sys
# add the project-specific extensions directory to Python's path
sys.path.append(join(REPO_ROOT, "extensions"))
[REPO_ROOT]/extensions/mischback/sphinx_jinja2_debug.py
:
def activate_jinja2_debug_ext(app):
"""Activate Jinja2 debug extension.
This function is intended to be connected to ``Sphinx``'s
``builder-inited`` event (see
https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx-core-events)
and will then navigate from the app to the ``jinja.Environment`` and call
its ``add_extension()`` method.
"""
if hasattr(app.builder, "templates"):
app.builder.templates.environment.add_extension("jinja2.ext.debug")
def setup(app):
"""Register the extension with Sphinx.
This function is required by ``Sphinx``'s extension interface, see
https://www.sphinx-doc.org/en/master/development/tutorials/helloworld.html#writing-the-extension
for reference.
It connects this plugins (only) function with the ``"builder-inited"`` event, see
https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx-core-events
for reference.
"""
app.connect("builder-inited", activate_jinja2_debug_ext)
conf.py
:
extensions = [
# ...
"mischback.sphinx_jinja2_debug",
]
setup()
function return the (desired) dictionary (see dry-coding here)For theme development it is not strictly required but would be nice to determine, what is placed in the rendering context.
Jinja2
>= 3.0.0 does provide the jinja2.ext.debug
extension, which does provide a {% debug %}
tag for this purpose.
However, that Jinja2
extension is not activated by Sphinx
(which is good and expected).
The extension might be activated by calling add_extension("jinja2.ext.debug")
on the Jinja Environment
object (Reference).
Tracking this object down is not as simple as expected, but probably it can be achieved this way:
# in file conf.py
def activate_jinja2_debug_ext(app):
"""Activate Jinja2 debug extension.
Prototype of this function is based on
https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx-core-events
FIXME: If this works, make sure to add documentation, using the references
from the research. Quite a ride through ``sphinx`` source code!
"""
app.builder.templates.environment.add_extension("jinja2.ext.debug")
def setup(app):
# Connect a custom handler to the ``builder-inited`` event.
#
# https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx-core-events
app.connect("builder-inited", activate_jinja2_debug_ext)
# sphinx.application
# ``_init_builder()`` suggests, there is an attribute ``builder`` on the ``app`` object
# see ``create_builder()``, which calls ``sphinx.registry.create_builder()``;
# both of these functions return a ``Builder`` instance
# sphinx.builders (in ``create_template_bridge()``)
Builder.templates = BuiltinTemplateLoader()
# sphinx.jinja2glue
BuiltinTemplateLoader.environment = SandboxedEnvironment() # this is from jinja2.sandbox
sphinx
, included in sphinx-contrib
pre-commit
doc8
, just using both of themsitemap.xml
sitemap.rst
as root_doc
.htaccess
filesphinx
build processFonts are one of the crucial assets of the website.
They have direct impact on the layout / theme (obviously) and the overall usability of the website. Furthermore, search engines reward fast loading times, tiny to none layout shifts, ...
As of now, the project uses three different fonts:
sans-serif
, variable font)serif
, just used for quotes)monospaced
, for source code)All of them do include a rather huge set of glyphs, most likely a lot of them will be completely unused. Subsetting removes glyphs from the font, making the required filesize smaller.
Follow up to #30, related to #55
woff2
This issue tracks the initial implementation of fonts.
Be Vietnam Pro
on Googlefonts)caniuse
: Basically all modern browsers already support the feature!vale
setup in its CI workflowWhile working on #31 one (unresolved) issue was, that the images are not actually part of the repository and thus, can not be considered/checked/processed during CI.
There are some possible solutions:
git
, it's not desired, as it may lead to a bloated repository, as every updated version of an image would result in an additional blob
, effectively doubling the size, making the repo growgit-lfs
git-lfs
stores only references to the binary files in the repository and stores the actual files elsewhere. This is kind of desired, but may require an external git-lfs server, because GitHub has quite strict rules about storage capacity and bandwidth. This external git-lfs server may need massive storage capacity, as it will hold all versions of any binary asset.git-lfs
JSON
file in the repository. During CI, download the files from a (known) source, compare the file hashes and create a full build.Articles tend to be quite long, so the primary navigation (in the page's header) is most likely not visible. On the other hand, the user might find that the article is not living up to their expectations, so they want to re-navigate while they are in the middle of the page, so the secondary navigation (in the page's footer) is not (yet) available, either.
aside
and can always be visible.style.css
I have built my personal vim
colorscheme, which works pretty well as of now.
Wouldn't it be great to have this colorscheme available for source code listings on the website.
The articles should have an aside box
providing related articles.
This information should be provided as file-wide meta data. This may require another custom extension.
Originally prettier
was used to beautify HTML build artifacts. While implementing #7 in #20 this proved to raise several issues.
prettier
is used to beautify the HTML after generating it from Sphinx/Jinja2prettier
is highly opinionated and is meant to not be configurable (see prettier/prettier#5246)prettier
for the given task, current favourite would be html-tidy
, which is available with Python bindingsprettier
for formatting SCSS/TypeScript source code during pre-commit
As an alternative to prettier
tidy-html5 might be used. It has Python bindings provided by uTidyLib.
utidylib
's bindings in a Sphinx extension, hooked to the build-finished
eventutidylib
does not install the required tidy
package / binary / libraryAdd a custom Sphinx extension to provide custom template tags / filters for Jinja2 templates.
"YYYY-mm-dd"
) and format it according to a format stringThere are some legal requirements, even for a personal website (sigh)...
While working on the category overviews, an existing image was included for testing. However, on running Sphinx, only one instance of the image was picked up by the extension, the other got marked as No responsive image sources, creating non-responsive image for ...
.
The problem might be in ResponsiveImageCollector.collect_source()
. The ref_path
or the conversion into a Path
object results in a non-existing path (below the document's own path).
To reproduce:
verbose
loggingResponsive image source not found: [PATH]
I want stroke text, which is no part of Sphinx
by default!
<span>
element (and the corresponding styling) intead of the (desired) (semantic) elements (<s>
/ <del>
)Though I have already created a tool to generate the required image variants to make responsive images work (ImP), this might not be sufficient / desired for this project.
conf.py
or pyproject.toml
)Create an actual build pipeline:
theme/mischback/_src/style/style.scss
into theme/mischback/static/style.css
sphinx build
to generate the HTML output (in .build
); this step will place the stylesheet in .build/_static/style.css
PostCSS
against .build/_static/style.css
purgecss
autoprefixer
cssnano
PostHTML
to perform the actual cache bustingwidth
is determined by a maximum readable line length, depending on the font-size, probably specified in rem
width
will generally be 100%
, might add some horizontal margins
width
at 100%
, but keep the boxes (vertically stacked)Django
projectspyproject.toml
(see documentation)djlint
Font selection was a real issue while coming up with a design, and finally three major fonts were selected and are - as of now - provided as web fonts.
Everything is working fine, but...
As an alternative, system font stacks may be used. The major drawback is loosing some control of the actual design, as the available fonts may deviate heavily between different users/devices.
Mona Lisa
Crimson Pro
Crimson Pro
quotation mark
in tubhrq is not the desired lookA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.