fixes/updates. use pydata theme. use drawio extension in devcontainer

This commit is contained in:
len0rd 2023-05-27 23:41:55 -04:00
parent 67fd3d91af
commit 4285425051
6 changed files with 45 additions and 38 deletions

View file

@ -0,0 +1,7 @@
{
"build": {
"context": "../",
"dockerfile": "../Dockerfile"
},
"forwardPorts": [8090]
}

View file

@ -1,25 +1,29 @@
FROM node:14-alpine
FROM python:3.11-bullseye
# Create app directory
WORKDIR /usr/src/app
ADD pip-requirements.txt /tmp/pip-requirements.txt
RUN pip install -r /tmp/pip-requirements.txt \
&& rm /tmp/pip-requirements.txt
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install
RUN apk add --no-cache python3 bash \
&& ln -sf python3 /usr/bin/python
# install drawio for doc diagram gen
ENV DRAWIO_VERSION "21.1.2"
RUN apt update \
&& apt install -yq --no-install-recommends \
xvfb \
wget \
libnotify4 \
libgbm1 \
libasound2 \
libxss1 \
libsecret-1-0 \
&& wget https://github.com/jgraph/drawio-desktop/releases/download/v${DRAWIO_VERSION}/drawio-amd64-${DRAWIO_VERSION}.deb \
&& apt install -y ./drawio-amd64-${DRAWIO_VERSION}.deb \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf drawio-amd64-${DRAWIO_VERSION}.deb
ENV XVFB_DISPLAY ":42"
# Bundle app source
COPY . .
RUN python3 -m ensurepip \
&& pip3 install --no-cache --upgrade pip setuptools \
&& pip3 install -r pip-requirements.txt
# COPY . .
# RUN ablog build
EXPOSE 8090
CMD [ "npm", "start" ]
CMD [ "ablog", "serve", "-p", "8090" ]

View file

@ -1,6 +1,6 @@
<mxfile host="65bd71144e">
<diagram id="SKV8PHPIui5c4Fc6kAOh" name="Page-1">
<mxGraphModel dx="889" dy="665" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<mxGraphModel dx="623" dy="291" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>

24
conf.py
View file

@ -10,6 +10,7 @@ extensions = [
"ablog",
"sphinx.ext.intersphinx",
"sphinx_design",
"sphinxcontrib.drawio",
]
html_static_path = ["_static"]
@ -26,34 +27,29 @@ fontawesome_included = True
html_baseurl = blog_baseurl
html_title = blog_title
html_theme = "sphinx_book_theme"
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"repository_url": "https://github.com/len0rd/",
"search_bar_text": "search ...",
"show_prev_next": False,
"navbar_center": [],
"use_fullscreen_button": False,
"use_repository_button": True,
# "footer_items": ["copyright", "sphinx-version", x"last-updated"],
}
html_favicon = "assets/img/favicon.ico"
html_sidebars = {
"*": [
"sitename.html",
"search-field.html",
"recentposts.html",
"archives.html",
"ablog/recentposts.html",
"ablog/archives.html",
],
"posts/**": [
"sitename.html",
"search-field.html",
"postcard.html",
"recentposts.html",
"archives.html",
"ablog/postcard.html",
"ablog/recentposts.html",
"ablog/archives.html",
],
}
html_context = {"html_title": html_title}
pygments_style = "sas"
drawio_headless = True
drawio_no_sandbox = True

View file

@ -1,6 +1,6 @@
sphinx
ablog
sphinx-design
pydata_sphinx_theme
sphinxcontrib-youtube
sphinx-book-theme
pydata-sphinx-theme
sphinxcontrib-drawio

View file

@ -84,7 +84,7 @@ Making unit-testable code in embedded development can be challenging. There is a
What does that look like? Something like this:
.. image:: ../assets/img/writeup/embedded_dev_primer/hal_concept.svg
.. drawio-image:: ../assets/diagrams/hal_concept.drawio
Notice all SOC/MCU-specific code is encapsulated down in a single library which we abstract out with an interface layer immediately.
@ -107,7 +107,7 @@ What are "board-specifics"? This is the term I use to describe the configuration
Here's an extension of the earlier diagram with these concepts added:
.. image:: ../assets/img/writeup/embedded_dev_primer/hal_concept_with_board.svg
.. drawio-image:: ../assets/diagrams/hal_concept_with_board.drawio
Benefits: