Skip to content

Commit

Permalink
website: add new website
Browse files Browse the repository at this point in the history
Simplify the website build procedure and import it into the the source tree.
The website now has the exact same build procedure and dependencies as
the documentation has anyways.
Maintaining it as part of the repo aligns it with the general elbe development processes.

Signed-off-by: Thomas Weißschuh <[email protected]>
  • Loading branch information
t-8ch committed Jun 27, 2024
1 parent 83d1a5a commit 70ea9a2
Show file tree
Hide file tree
Showing 18 changed files with 878 additions and 0 deletions.
1 change: 1 addition & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build/
Binary file added website/Pres_ELBE_2019_v1.0.pdf
Binary file not shown.
Binary file added website/_static/elbe-wallpaper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions website/_static/elbe-website.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
h1, h2, h3, h4, h5, h6 {
color: #d70751;
}

ul.elbe-website-version-list {
column-width: 5em;
}

div.elbe-website-index-lead {
background-image: url(elbe-wallpaper.jpg);
background-color: #d70751; /* as fallback if the image does not work */
text-align: center;
}

div.elbe-website-index-lead {
padding-top: 20px;
padding-bottom: 20px;
}

div.elbe-website-index-lead h1 {
color: white;
font-size: 210%;
margin-bottom: 20px;
}

div.elbe-website-index-lead h1 > a.headerlink {
display: none;
}

div.elbe-website-index-lead ul {
list-style: none;
margin: 0;
}

div.elbe-website-index-lead ul > li {
display: inline-block;
min-width: 40%;
}

div.elbe-website-index-lead ul > li a {
color: black;
border-bottom: none;
background-color: white;
font-size: 0.87rem;
border-radius: 30px;
transition: background 0.2s,border 0.2s;
font-family: sans-serif;
padding: 8px 20px;
line-height: 5;
}

div.elbe-website-index-lead ul > li a:hover {
color: white;
background-color: black;
}

div.elbe-website-index-tiles {
display: flex;
flex-wrap: wrap;
column-gap: 1em;
}

div.elbe-website-index-tiles h2 {
font-size: 140%;
}

div.elbe-website-index-tiles > section {
min-width: 15em;
flex: 45%;
}
10 changes: 10 additions & 0 deletions website/_templates/news.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{%- extends "layout.html" %}
{% block body %}
{{ body }}

{% if 'author' in meta and 'date' in meta %}
<p>
<small>{{ meta.author }} on {{ meta.date }}</small>
</p>
{% endif %}
{% endblock %}
103 changes: 103 additions & 0 deletions website/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: 0BSD
# SPDX-FileCopyrightText: Linutronix GmbH

import os
import sys
sys.path.insert(0, os.path.abspath('ext'))
sys.path.insert(0, os.path.abspath('..'))

from elbepack.version import elbe_version # noqa: E402

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'elbedocoverview',
'elbefeed',
'sphinx.ext.intersphinx',
]

intersphinx_disabled_reftypes = ['*']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'ELBE Website'
copyright = (u'2024 ELBE by Linutronix GmbH - ELBE is not affiliated with Debian, '
u'Debian is a registered trademark owned by SPI')
author = u'Thomas Weißschuh'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = elbe_version
# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_baseurl = 'https://elbe-rfs.org/'
html_theme = 'alabaster'

html_sidebars = {
'**': ['globaltoc.html'],
}

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
'show_powered_by': False,
'head_font_family': 'sans-serif',
'font_family': 'sans-serif',
'footer_text': '#3E4349',
}

# 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']

html_logo = 'elbe-logo-small.png'
17 changes: 17 additions & 0 deletions website/devel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Development
###########

Source
------

The latest source code is available on
`GitHub <https://github.com/linutronix/elbe>`_.

The project contains a native debianization, so Debian packages for the host PC
can be built with ``dpkg-buildpackage`` or a similar tool.


Bugreports
----------

Please use the `GitHub issue tracker <https://github.com/linutronix/elbe/issues>`_.
17 changes: 17 additions & 0 deletions website/docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Documentation
#############

The documentation for the **latest release** v\ |version| is available here: :doc:`elbe:index`.

Media
=====

A `video recording <https://youtu.be/LLQz38tnElw?list=PLbzoR-pLrL6pRFP6SOywVJWdEHlmQE51q>`_
explaining ELBE at Embedded Linux Conference Europe 2017 in Berlin.

:download:`Slides <Pres_ELBE_2019_v1.0.pdf>` of the official ELBE presentation.

Documentation for all released versions
=======================================

.. elbedocoverview::
38 changes: 38 additions & 0 deletions website/download.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Downloads
#########

The current elbe version is |version| .

There are several ways to install a binary version of elbe.

The easiest way is to install the Debian packages via apt.

Debian Binary Packages
======================

The recommended way to use ELBE is running it on a Debian PC.
Linutronix provides a signed repository that can be included in apt.

Debian bookworm or later
------------------------

.. code-block:: bash
su -
apt install elbe-archive-keyring
echo "deb [signed-by=/usr/share/keyrings/elbe-archive-keyring.gpg] http://debian.linutronix.de/elbe bookworm main" >> /etc/apt/sources.list
apt update
apt install elbe
Debian buster or bullseye
-------------------------

.. code-block:: bash
su -
source /etc/os-release
apt install wget
wget -O /usr/share/keyrings/elbe-archive-keyring.gpg http://debian.linutronix.de/elbe/elbe-repo.pub.gpg
echo "deb [signed-by=/usr/share/keyrings/elbe-archive-keyring.gpg] http://debian.linutronix.de/elbe $VERSION_CODENAME main" >> /etc/apt/sources.list
apt update
apt install elbe
Binary file added website/elbe-logo-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 116 additions & 0 deletions website/ext/elbedocoverview.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import os
import pathlib

from docutils import nodes
from docutils.parsers.rst import directives

import packaging.version

from sphinx.errors import ExtensionError
from sphinx.util.docutils import SphinxDirective
from sphinx.util.nodes import nested_parse_with_titles


__here__ = pathlib.Path(__file__).parent


def _versioned_doc_url(version):
return 'https://elbe-rfs.org/docs/sphinx/v{}/index.html'.format(version)


def _docs_directory(config):
docs_directory = config.elbedocoverview_docs_directory
if docs_directory is None:
raise ExtensionError('Missing configuration "elbedocoverview_docs_directory"')

return docs_directory


class _ElbeDocOverview(SphinxDirective):

def run(self):
self.env.note_dependency(__file__)

docs_directory = _docs_directory(self.config)

versions = os.listdir(docs_directory)
versions = filter(lambda v: v.startswith('v'), versions)
versions = map(lambda v: v.removeprefix('v'), versions)
versions = sorted(versions, reverse=True, key=lambda v: packaging.version.Version(v))

items = nodes.bullet_list(classes=['elbe-website-version-list'])

for version in versions:
list_item = nodes.list_item()
par = nodes.paragraph()
contents = f'v{version}'
ref = nodes.reference(contents, contents,
refuri=_versioned_doc_url(version))
par += ref
list_item += par
items += list_item

return [items]


class section_level(nodes.Element):
def get_level(self):
return self['level']


def visit_section_level_node(self, node):
self.section_level += node.get_level()


def depart_section_level_node(self, node):
self.section_level -= node.get_level()


class _ElbeContainerWithTitles(SphinxDirective):
optional_arguments = 1
final_argument_whitespace = True
has_content = True
option_spec = {
'section_level_adjust': int,
}

def run(self):
n = nodes.container(
classes=directives.class_option(self.arguments[0] or ''),
)
nested_parse_with_titles(state=self.state, content=self.content,
content_offset=self.content_offset, node=n)

section_level_adjust = self.options.get('section_level_adjust')
if not section_level_adjust:
return [n]

sl = section_level(level=section_level_adjust)
sl += n
return [sl]


def _config_inited(app, config):
if 'intersphinx_mapping' not in config:
raise ExtensionError('missing intersphinx extension')

docs_directory = _docs_directory(config)

config.intersphinx_mapping['elbe'] = (
f'https://elbe-rfs.org/docs/sphinx/v{config.version}/',
f'{docs_directory}/v{config.version}/objects.inv',
)


def setup(app):
app.add_config_value('elbedocoverview_docs_directory', None, 'env', str)
app.add_directive('elbedocoverview', _ElbeDocOverview)
app.add_directive('elbe-container-with-titles', _ElbeContainerWithTitles)
app.add_node(section_level, html=(visit_section_level_node, depart_section_level_node))
app.connect('config-inited', _config_inited)
app.add_css_file('elbe-website.css')

return {
'parallel_read_safe': True,
'parallel_write_safe': True,
}
Loading

0 comments on commit 70ea9a2

Please sign in to comment.