Compare commits

...

11 commits

Author SHA1 Message Date
80ae5e188a style(theme): Enhance section styling and comment out unused variables
All checks were successful
continuous-integration/drone/push Build is passing
Improved the layout and styling of sections to ensure better visual
consistency and maintainability. Commented out unused CSS variables to
prevent potential conflicts and improve clarity.

- Commented out CSS variable definitions for primary, secondary,
  tertiary, and text colors to prevent unintended style overrides.
- Added `position: relative` to section elements to facilitate absolute
  positioning of child elements.
- Removed top margin for the second child elements of various types
  within sections to ensure consistent spacing.
- Positioned `bc-footer` elements absolutely at 80px from the bottom of
  sections to maintain a consistent footer placement.
- Eliminated bottom margin for the last child elements within
  `bc-footer` to ensure a clean and uniform footer appearance.

Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
2025-03-27 10:29:11 +01:00
53c9766297 chore(slides): add commented theme-set option in watch-slides-internal
This change provides a reference for an alternative theme configuration,
improving future customization flexibility.

- Added a commented line for the theme-set option in the
  watch-slides-internal target
- Ensures developers have a quick reference for enabling the 'glenux'
  theme without altering the current setup

Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
2025-03-27 10:17:18 +01:00
8cf80d9c09 chore(dependencies): update caniuse-lite to latest version
Updating the caniuse-lite package to ensure the project benefits from
the latest browser compatibility data, which is crucial for maintaining
up-to-date front-end features.

- Updated caniuse-lite from version 1.0.30001662 to 1.0.30001664
- Changed resolved URL to match the new version
- Updated integrity hash to ensure package authenticity and integrity

Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
2025-03-27 10:16:44 +01:00
d4924377fe refactor(docs): reorganize assets and update styling
Improves the maintainability and clarity of the documentation assets by
restructuring directories and refining CSS rules.

- Rename CSS and JavaScript directories for better asset organization.
- Add CSS rules to hide elements with 'bc-docs-hidden' attribute,
  enhancing document customization.
- Comment out specific content in CSS header to simplify text display.
- Remove outdated UML mindmap file to clean up unused resources.
- Comment out 'md_in_html' extension in mkdocs configuration to
  streamline markdown processing.

Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
2025-03-27 10:16:07 +01:00
6a2abc6235 feat(docker): modularize Docker setup for docs and slides
Introduces distinct Dockerfiles for documentation and slide projects, enhancing modularity and build efficiency. The previous monolithic structure was less flexible and caused longer build times.

- Added `DOCMACHINE_DOCS_ENABLE` and `DOCMACHINE_SLIDES_ENABLE` env variables to toggle features.
- Created `docker/Dockerfile.docs` for documentation builds, including necessary tools and dependencies.
- Created `docker/Dockerfile.slides` for slide builds to streamline setup.
- Updated main Dockerfile to include `python-is-python3` for compatibility, removing redundant symlinks.
- Enhanced LaTeX tools by adding `texlive-xetex` and extra fonts for improved PDF output.
2025-03-27 10:14:38 +01:00
2a607d6f21 refactor(docs): enhance PDF build process and font settings
Improves the PDF generation process by adding verbosity and updating
font configurations, ensuring better compatibility and output quality.

- Add "--verbose" to pandoc command for detailed output during PDF
  generation
- Change monofont from "SauceCodePro Nerd Font" to "Noto Sans Mono" for
  improved font rendering
- Switch PDF engine from "pdflatex" to "xelatex" for better Unicode
  support
- Uncomment fontspec package in LaTeX to enable custom font settings
- Add inputenc package and Unicode character declaration for extended
  character support

Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
2025-03-27 09:59:17 +01:00
a8b755a7c9 chore(makefile): enhance CSS build output readability
Improved the readability of the generated CSS files by expanding their
style format. This change aids in debugging and maintenance by providing
a clearer view of the CSS structure.

* Added `--style=expanded` option to the `npx sass` command in the
  Makefile
* Ensures that the generated CSS is more human-readable, facilitating
  easier troubleshooting and updates

Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
2025-03-18 14:30:04 +01:00
8ad5e1ff47 fix(Makefile): resolve recursive variable expansion issues
Addressed issues with recursive variable expansion in the Makefile to ensure proper variable assignment and prevent potential build errors.

* Changed variable assignments to use ':=' for non-recursive expansion
* Updated all relevant variables to prevent recursive expansion errors
* Ensured consistent and efficient variable handling across the Makefile

Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
2025-03-18 14:19:53 +01:00
0fea694575 chore: update Dockerfile dependencies and improve PDF build process 2024-12-12 09:19:29 +01:00
0249d0e85c feat: add support for pandoc pdf 2024-12-11 22:14:25 +01:00
ff82c631b4 fix: makefile tasks for watch 2024-09-30 18:12:26 +02:00
26 changed files with 467 additions and 123 deletions

2
.gitignore vendored
View file

@ -17,3 +17,5 @@ tmp*
vendor/bundle
*.zip
mkdocs.yml
.aider*
.env

View file

@ -5,7 +5,7 @@ build: theme.css
%.css: %.scss
cd .. \
&& npx sass --no-error-css --no-source-map .marp/$<:.marp/$@ \
&& npx sass --no-error-css --no-source-map --style=expanded .marp/$<:.marp/$@ \
|| ( rm -f .marp/$@ && exit 1 )
.PHONY: build

View file

@ -7,10 +7,12 @@ $tertiaryColor: #241c1c;
$textColor: #111111;
body {
/*
--primary-color: $primaryColor;
--secondary-color: $secondaryColor;
--tertiary-color: $tertiaryColor;
--text-color: $textColor;
*/
}
section {
@ -257,3 +259,28 @@ p img:only-child[alt*="center"] {
margin-right: auto;
}
section {
position: relative;
}
section > h2:nth-child(2),
section > h3:nth-child(2),
section > h4:nth-child(2),
section > h5:nth-child(2),
section > h6:nth-child(2),
section > p:nth-child(2),
section > bc-row:nth-child(2),
section > ul:nth-child(2) > li:first-child > p {
margin-top: 0;
}
section bc-footer {
position: absolute;
bottom: 80px;
}
section bc-footer *:last-child {
margin-bottom: 0;
}

View file

@ -16,53 +16,54 @@ CACHE_DIR=_cache
## Internal directories
CACHE_SLIDES_DIR=$(CACHE_DIR)/slides
CACHE_DOCS_DIR=$(CACHE_DIR)/docs
## Output directories
BUILD_SLIDES_DIR=$(BUILD_DIR)/slides
BUILD_DOCS_DIR=$(BUILD_DIR)/docs
BUILD_IMAGES_DIR=images
BUILD_VERSION=v$(shell date "+%Y%m%d-%H%M")
BUILD_VERSION := v$(shell date "+%Y%m%d-%H%M")
## Ports
DOCS_PORT=5100
SLIDES_PORT=5200
## Find .md slides
SLIDES_MDPP=$(shell find -L $(SLIDES_DIR) -regextype sed \( -name '*.mdpp' ! -regex '.*/_.*' \))
SLIDES_MDPP_MD=$(patsubst $(SLIDES_DIR)/%.mdpp,$(CACHE_SLIDES_DIR)/%.mdpp.md,$(SLIDES_MDPP))
SLIDES_MDPP_MD_PDF=$(patsubst $(CACHE_SLIDES_DIR)/%.mdpp.md,$(BUILD_SLIDES_DIR)/%.pdf,$(SLIDES_MDPP_MD))
SLIDES_MDPP_MD_PPTX=$(patsubst $(CACHE_SLIDES_DIR)/%.mdpp.md,$(BUILD_SLIDES_DIR)/%.pptx,$(SLIDES_MDPP_MD))
SLIDES_MDPP := $(shell find -L $(SLIDES_DIR) -regextype sed \( -name '*.mdpp' ! -regex '.*/_.*' \))
SLIDES_MDPP_MD := $(patsubst $(SLIDES_DIR)/%.mdpp,$(CACHE_SLIDES_DIR)/%.mdpp.md,$(SLIDES_MDPP))
SLIDES_MDPP_MD_PDF := $(patsubst $(CACHE_SLIDES_DIR)/%.mdpp.md,$(BUILD_SLIDES_DIR)/%.pdf,$(SLIDES_MDPP_MD))
SLIDES_MDPP_MD_PPTX := $(patsubst $(CACHE_SLIDES_DIR)/%.mdpp.md,$(BUILD_SLIDES_DIR)/%.pptx,$(SLIDES_MDPP_MD))
SLIDES_MD=$(shell find -L $(SLIDES_DIR) -regextype sed \( -name '*.md' ! -regex '.*/_.*' \)) $(SLIDES_MDPP_MD)
SLIDES_MD_PDF=$(patsubst $(SLIDES_DIR)/%.md,$(BUILD_SLIDES_DIR)/%.pdf,$(SLIDES_MD))
SLIDES_MD_PPTX=$(patsubst $(SLIDES_DIR)/%.md,$(BUILD_SLIDES_DIR)/%.pptx,$(SLIDES_MD))
SLIDES_MD := $(shell find -L $(SLIDES_DIR) -regextype sed \( -name '*.md' ! -regex '.*/_.*' \)) $(SLIDES_MDPP_MD)
SLIDES_MD_PDF := $(patsubst $(SLIDES_DIR)/%.md,$(BUILD_SLIDES_DIR)/%.pdf,$(SLIDES_MD))
SLIDES_MD_PPTX := $(patsubst $(SLIDES_DIR)/%.md,$(BUILD_SLIDES_DIR)/%.pptx,$(SLIDES_MD))
SLIDES_MD_ALL=$(SLIDES_MDPP_MD) $(SLIDES_MD) $(SLIDES_DIR)/autoslide.md
SLIDES_PDF_ALL=$(SLIDES_MDPP_MD_PDF) $(SLIDES_MD_PDF) $(BUILD_SLIDES_DIR)/autoslide.pdf
SLIDES_PPTX_ALL=$(SLIDES_MDPP_MD_PPTX) $(SLIDES_MD_PPTX) $(BUILD_SLIDES_DIR)/autoslide.pptx
SLIDES_MD_ALL := $(SLIDES_MDPP_MD) $(SLIDES_MD) $(SLIDES_DIR)/autoslide.md
SLIDES_PDF_ALL := $(SLIDES_MDPP_MD_PDF) $(SLIDES_MD_PDF) $(BUILD_SLIDES_DIR)/autoslide.pdf
SLIDES_PPTX_ALL := $(SLIDES_MDPP_MD_PPTX) $(SLIDES_MD_PPTX) $(BUILD_SLIDES_DIR)/autoslide.pptx
DOCS_MD=$(shell find -L $(DOCS_DIR) -regextype sed \( -name '*.md' ! -regex '.*/_.*' \))
## Find .uml graphs
DOCS_IMAGES_UML=$(shell find -L $(IMAGES_DIR) -regextype sed \( -name '*.uml' ! -regex '.*/_.*' \))
DOCS_IMAGES_UML_SVG=$(patsubst $(IMAGES_DIR)/%.uml,$(BUILD_IMAGES_DIR)/%.uml.svg,$(DOCS_IMAGES_UML))
DOCS_IMAGES_UML := $(shell find -L $(IMAGES_DIR) -regextype sed \( -name '*.uml' ! -regex '.*/_.*' \))
DOCS_IMAGES_UML_SVG := $(patsubst $(IMAGES_DIR)/%.uml,$(BUILD_IMAGES_DIR)/%.uml.svg,$(DOCS_IMAGES_UML))
## Find .dot graphs
DOCS_IMAGES_DOT=$(shell find -L $(IMAGES_DIR) -regextype sed \( -name '*.dot' ! -regex '.*/_.*' \))
DOCS_IMAGES_DOT_SVG=$(patsubst $(IMAGES_DIR)/%.dot,$(BUILD_IMAGES_DIR)/%.dot.svg,$(DOCS_IMAGES_DOT))
DOCS_IMAGES_DOT := $(shell find -L $(IMAGES_DIR) -regextype sed \( -name '*.dot' ! -regex '.*/_.*' \))
DOCS_IMAGES_DOT_SVG := $(patsubst $(IMAGES_DIR)/%.dot,$(BUILD_IMAGES_DIR)/%.dot.svg,$(DOCS_IMAGES_DOT))
## Find .circo graphs
DOCS_IMAGES_CIRCO=$(shell find -L $(IMAGES_DIR) -regextype sed \( -name '*.circo' ! -regex '.*/_.*' \))
DOCS_IMAGES_CIRCO_SVG=$(patsubst $(IMAGES_DIR)/%.circo,$(BUILD_IMAGES_DIR)/%.circo.svg,$(DOCS_IMAGES_CIRCO))
DOCS_IMAGES_CIRCO := $(shell find -L $(IMAGES_DIR) -regextype sed \( -name '*.circo' ! -regex '.*/_.*' \))
DOCS_IMAGES_CIRCO_SVG := $(patsubst $(IMAGES_DIR)/%.circo,$(BUILD_IMAGES_DIR)/%.circo.svg,$(DOCS_IMAGES_CIRCO))
## Find .ora images
DOCS_IMAGES_ORA=$(shell find -L $(IMAGES_DIR) -regextype sed \( -name '*.ora' ! -regex '.*/_.*' \))
DOCS_IMAGES_ORA_PNG=$(patsubst $(IMAGES_DIR)/%.ora,$(BUILD_IMAGES_DIR)/%.ora.png,$(DOCS_IMAGES_ORA))
DOCS_IMAGES_ORA := $(shell find -L $(IMAGES_DIR) -regextype sed \( -name '*.ora' ! -regex '.*/_.*' \))
DOCS_IMAGES_ORA_PNG := $(patsubst $(IMAGES_DIR)/%.ora,$(BUILD_IMAGES_DIR)/%.ora.png,$(DOCS_IMAGES_ORA))
## Merge all lists
DOCS_IMAGES_SVG=$(DOCS_IMAGES_DOT_SVG) $(DOCS_IMAGES_CIRCO_SVG) $(DOCS_IMAGES_UML_SVG)
DOCS_IMAGES_PNG=$(DOCS_IMAGES_ORA_PNG)
DOCS_IMAGES_SVG := $(DOCS_IMAGES_DOT_SVG) $(DOCS_IMAGES_CIRCO_SVG) $(DOCS_IMAGES_UML_SVG)
DOCS_IMAGES_PNG := $(DOCS_IMAGES_ORA_PNG)
export
all: help

View file

@ -2,14 +2,34 @@
version: "3.4"
services:
app:
# app:
# build:
# context: .
# dockerfile: docker/Dockerfile
# image: glenux/teaching-boilerplate
# environment: {}
# ports:
# - 5100:5100
# - 5200:5200
slides:
build:
context: .
dockerfile: docker/Dockerfile
image: glenux/teaching-boilerplate
dockerfile: docker/Dockerfile.slides
image: glenux/docmachine-slides:latest
environment: {}
ports:
- 5200:5200
docs:
build:
context: .
dockerfile: docker/Dockerfile.docs
image: glenux/docmachine-docs:latest
environment: {}
ports:
- 5100:5100
- 5200:5200
# proxy:
#

View file

@ -1,8 +1,11 @@
FROM node:18-bookworm-slim
LABEL maintainer="Glenn ROLLAND glenux@glenux.net"
ENV DOCMACHINE_DOCS_ENABLE=1
ENV DOCMACHINE_SLIDES_ENABLE=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 python3-pip pipenv \
&& apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pipenv python3-pypandoc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
@ -16,7 +19,7 @@ RUN apt-get update \
# Tools for building pdfs
RUN apt-get update \
&& apt-get install -y --no-install-recommends make pdftk m4 chromium \
&& apt-get install -y --no-install-recommends make m4 chromium pandoc ghc libghc-pandoc-dev lmodern texlive-xetex texlive-fonts-extra texlive-fonts-recommended librsvg2-bin fonts-noto-mono \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
@ -24,7 +27,7 @@ RUN apt-get update \
# External tools
# yq => manage YML
RUN curl -sSL -o /usr/local/bin/yq \
https://github.com/mikefarah/yq/releases/download/v4.18.1/yq_linux_amd64 \
https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64 \
&& chmod +x /usr/local/bin/yq
COPY . /app
@ -36,8 +39,7 @@ ENV LANG=C.UTF-8 \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_VENV_IN_PROJECT=1
RUN ln -sf python3 /usr/bin/python \
&& make prepare SYSTEM_INSTALL=1
RUN make prepare SYSTEM_INSTALL=1
ENTRYPOINT ["/app/docker/entrypoint.sh"]
CMD ["watch"]

44
docker/Dockerfile.docs Normal file
View file

@ -0,0 +1,44 @@
FROM node:18-bookworm-slim
LABEL maintainer="Glenn ROLLAND glenux@glenux.net"
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 python3-pip pipenv python3-pypandoc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
# Tools for running the common parts
RUN apt-get update \
&& apt-get install -y --no-install-recommends make build-essential inotify-tools gosu unzip curl rsync \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
# Tools for building pdfs
RUN apt-get update \
&& apt-get install -y --no-install-recommends make m4 chromium pandoc ghc libghc-pandoc-dev lmodern texlive-latex-recommended texlive-latex-base texlive-latex-extra \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
# External tools
# yq => manage YML
RUN curl -sSL -o /usr/local/bin/yq \
https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64 \
&& chmod +x /usr/local/bin/yq
COPY . /app
COPY .marp /app/.marp
WORKDIR /app
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_VENV_IN_PROJECT=1
RUN ln -sf python3 /usr/bin/python \
&& make prepare SYSTEM_INSTALL=1
ENTRYPOINT ["/app/docker/entrypoint.sh"]
CMD ["watch"]

44
docker/Dockerfile.slides Normal file
View file

@ -0,0 +1,44 @@
FROM node:18-bookworm-slim
LABEL maintainer="Glenn ROLLAND glenux@glenux.net"
# RUN apt-get update \
# && apt-get install -y --no-install-recommends python3 python3-pip pipenv python3-pypandoc \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
# && truncate -s 0 /var/log/*log
# # Tools for running the common parts
# RUN apt-get update \
# && apt-get install -y --no-install-recommends make build-essential inotify-tools gosu unzip curl rsync \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
# && truncate -s 0 /var/log/*log
# Tools for building pdfs
RUN apt-get update \
&& apt-get install -y --no-install-recommends make m4 chromium \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
# External tools
# yq => manage YML
RUN curl -sSL -o /usr/local/bin/yq \
https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64 \
&& chmod +x /usr/local/bin/yq
COPY . /app
COPY .marp /app/.marp
WORKDIR /app
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_VENV_IN_PROJECT=1
RUN ln -sf /usr/bin/python3 /usr/bin/python \
&& make prepare SYSTEM_INSTALL=1
ENTRYPOINT ["/app/docker/entrypoint.sh"]
CMD ["watch"]

View file

@ -6,34 +6,43 @@ set -e
ARGS="$*"
echo "Arguments: $ARGS"
EXT_UID=${EXT_UID:-999}
EXT_GID=${EXT_GID:-999}
EXT_UID="${EXT_UID:-999}"
EXT_GID="${EXT_GID:-999}"
DOCMACHINE_DOCS_ENABLE="${DOCMACHINE_DOCS_ENABLE:-1}"
DOCMACHINE_SLIDES_ENABLE="${DOCMACHINE_SLIDES_ENABLE:-1}"
# Create missing directories
mkdir -p _cache
mkdir -p _build
mkdir -p .marp
mkdir -p /home/appuser
gx_workdir_prepare() {
# Create missing directories
mkdir -p _cache
mkdir -p _build
if [ "$DOCMACHINE_SLIDES_ENABLE" = "1" ]; then
mkdir -p .marp
fi
mkdir -p /home/appuser
}
# Create user with given ID if needed
if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then
groupadd -g "$EXT_GID" appuser
fi
gx_users_prepare() {
# Create user with given ID if needed
if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then
groupadd -g "$EXT_GID" appuser
fi
# Create group with given ID if needed
if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then
useradd -r -u "$EXT_UID" -g appuser appuser
fi
# Create group with given ID if needed
if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then
useradd -r -u "$EXT_UID" -g appuser appuser
fi
chown -R "$EXT_UID:$EXT_GID" _cache
chown -R "$EXT_UID:$EXT_GID" _build
chown -R "$EXT_UID:$EXT_GID" .marp
chown -R "$EXT_UID:$EXT_GID" /home/appuser
chown -R "$EXT_UID:$EXT_GID" slides
chown -R "$EXT_UID:$EXT_GID" docs
# echo "Setting permissions to $EXT_UID:$EXT_GID"
# chown -R "$EXT_UID:$EXT_GID" _cache
# chown -R "$EXT_UID:$EXT_GID" _build
# chown -R "$EXT_UID:$EXT_GID" .marp
# chown -R "$EXT_UID:$EXT_GID" /home/appuser
# chown -R "$EXT_UID:$EXT_GID" slides
# chown -R "$EXT_UID:$EXT_GID" docs
}
gx_docs_configure() {
# Patch mkdocs configuration
# set -x
if [ -f mkdocs-patch.yml ]; then
# patch reference mkdocs with user-provided options
yq eval-all '. as $item ireduce ({}; . * $item)' \
@ -44,10 +53,20 @@ else
# use reference mkdocs only (no options)
ln -s mkdocs-source.yml mkdocs.yml
fi
# set +x
}
##
## Main
##
gx_workdir_prepare
gx_users_prepare
if [ "$DOCMACHINE_DOCS_ENABLE" = "1" ]; then
gx_docs_configure
fi
if [ "$1" = "supershell" ]; then
exec bash
else
exec gosu "$EXT_UID:$EXT_GID" make "$@"
# exec gosu "$EXT_UID:$EXT_GID" make "$@"
exec make "$@"
fi

View file

@ -8,6 +8,16 @@ hr {
display: none;
}
h1[bc-docs-hidden]
h2[bc-docs-hidden]
h3[bc-docs-hidden]
h4[bc-docs-hidden]
h5[bc-docs-hidden]
h6[bc-docs-hidden] {
display: none;
visibility: hidden;
}
@page {
size: a4 portrait;
margin: 25mm 10mm 25mm 10mm;
@ -18,7 +28,7 @@ hr {
@top-left {
font-size: 70%;
content: 'Formation « Cloud & Enjeux »';
content: 'Formation'; /* « Cloud & Enjeux »'; */
}
/*
@top-center {

View file

@ -1,37 +0,0 @@
@startmindmap
<style>
node {
Shadowing 0.0
}
</style>
* Types d'utilisateurs
right side
** Chercheurs d'emploi
***[#FFCCCC] FIXME: clarifier les sous-types\nd'apres les réponses au questionnaire
** Structure d'accompagnement
*** Responsable d'accompagnement
*** Chargé d'accompagnement
****_ Conseiller·e d'orientation
****_ Coach
****_ Mentor ou expert·e
****_ Parrain ou marraine
****_ Animateur·trice
****_ Révélateur de talent\nou facilitateur·trice
****_ Influenceur·se
****[#FFCCCC] FIXME: sont-ils équivalents ?
** TousTesPossibles\n LesCollectifsEmploi
*** Animateur·trice réseau
***[#FFCCCC] FIXME: Modérateur
****_ Inter structures ?
****_ Intra structures ?
*** Administrateur·trice plate-forme (si centralisé)
** Pole Emploi
*** Conseiller d'orientation
*** Directeur structure
@endmindmap

View file

@ -57,6 +57,7 @@ extra_javascript:
markdown_extensions:
- footnotes
- admonition
# - md_in_html
- toc:
permalink: '#'

12
package-lock.json generated
View file

@ -410,9 +410,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001662",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001662.tgz",
"integrity": "sha512-sgMUVwLmGseH8ZIrm1d51UbrhqMCH3jvS7gF/M6byuHOnKyLOBL7W8yz5V02OHwgLGA36o/AFhWzzh4uc5aqTA==",
"version": "1.0.30001664",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001664.tgz",
"integrity": "sha512-AmE7k4dXiNKQipgn7a2xg558IRqPN3jMQY/rOsbxDhrd0tyChwbITBfiwtnqz8bi2M5mIWbxAYBvk7W7QBUS2g==",
"funding": [
{
"type": "opencollective",
@ -2397,9 +2397,9 @@
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"caniuse-lite": {
"version": "1.0.30001662",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001662.tgz",
"integrity": "sha512-sgMUVwLmGseH8ZIrm1d51UbrhqMCH3jvS7gF/M6byuHOnKyLOBL7W8yz5V02OHwgLGA36o/AFhWzzh4uc5aqTA=="
"version": "1.0.30001664",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001664.tgz",
"integrity": "sha512-AmE7k4dXiNKQipgn7a2xg558IRqPN3jMQY/rOsbxDhrd0tyChwbITBfiwtnqz8bi2M5mIWbxAYBvk7W7QBUS2g=="
},
"chalk": {
"version": "2.4.2",

View file

@ -10,6 +10,9 @@ docker-build: ## build docker image
glenux/docmachine:$(BUILD_VERSION) \
glenux/docmachine:latest
docker-save:
env docker save glenux/docmachine:latest > ~/.cache/docmachine/image.tar
docker-push: ## push docker image
env docker push glenux/docmachine:latest

View file

@ -7,64 +7,60 @@ prepare-docs: ## install prerequisites for static docs site only
.PHONY: prepare-docs
prepare: prepare-docs
.PHONY: sync-docs-internal
sync-docs-internal:
@>&2 echo "ERROR: not implemented"
exit 1
.PHONY: clean-docs
clean-docs: ## remove generated static docs site
rm -fr $(BUILD_DOCS_DIR)
.PHONY: clean-docs
clean: clean-docs
# deploy-docs: ## deploy static docs site to github
# git push $(DEPLOY_REPO)
# pipenv run mkdocs gh-deploy $(DEPLOY_OPTS)
# .PHONY: deploy-docs
# deploy: deploy-docs
build-docs-pdf: ## build pdf docs only
mkdir -p $(BUILD_DOCS_DIR)
rm -f $(BUILD_DOCS_DIR)/combined.pdf
PYTHONUTF8=1 \
ENABLE_PDF_EXPORT=1 \
pipenv run mkdocs build \
--site-dir $(BUILD_DOCS_DIR)
pdftk \
$$(find -L $(BUILD_DOCS_DIR) -name *.pdf -not -name index.pdf |sort ) \
cat output $(BUILD_DOCS_DIR)/docs.pdf
mkdir -p $(CACHE_DOCS_DIR)
rm -f $(BUILD_DOCS_DIR)/docs.pdf
./utils/docs/build_combined.sh $(DOCS_DIR) $(CACHE_DOCS_DIR)/combined.md
./utils/docs/build_metadata.sh mkdocs.yml $(CACHE_DOCS_DIR)/metadata.yml
./utils/docs/build_pdf.py $(CACHE_DOCS_DIR)/metadata.yml $(CACHE_DOCS_DIR)/combined.md $(BUILD_DOCS_DIR)/docs.pdf
# rm -f $(BUILD_DOCS_DIR)/combined.pdf
# PYTHONUTF8=1 \
# ENABLE_PDF_EXPORT=1 \
# pipenv run mkdocs build \
# --site-dir $(BUILD_DOCS_DIR)
# pdftk \
# $$(find -L $(BUILD_DOCS_DIR) -name *.pdf -not -name index.pdf |sort ) \
# cat output $(BUILD_DOCS_DIR)/docs.pdf
.PHONY: build-docs-pdf
build-docs: build-docs-pdf
.PHONY: build-docs-html
build-docs-html: ## build static docs site only
mkdir -p $(BUILD_DOCS_DIR)
pipenv run mkdocs build \
--site-dir $(BUILD_DOCS_DIR)
.PHONY: build-docs-html
build-docs: build-docs-html
build: build-docs
.PHONY: watch-docs-internal
watch-docs-internal:
pipenv run mkdocs serve --dev-addr 0.0.0.0:$(DOCS_PORT)
.PHONY: watch-docs-internal
watch-docs: ## run development server for static docs site
pipenv run honcho start watch-docs watch-toc
.PHONY: watch-docs
watch: watch-docs
watch-docs: ## run development server for static docs site
pipenv run honcho start watch-docs watch-toc
build-pdf: build-docs-pdf ## build docs as PDF files
build-html: build-docs-html ## build docs as HTML files
build-docs: build-docs-pdf build-docs-html ## build only docs as PDF and HTML
.PHONY: serve-docs
serve-docs: watch-docs
.PHONY: watch-docs serve-docs
.PHONY: watch-docs-internal

View file

@ -16,6 +16,7 @@ watch-slides-internal: .marp/theme.css
--theme $$(pwd)/.marp/theme.css \
-w $(SLIDES_DIR) \
-s
# --theme-set glenux
.PHONY: watch-slides serve-slides
watch-slides: ## run development server for PDF slides

View file

@ -0,0 +1,7 @@
% blockquote.tex
% Stylish blockquote setup
\usepackage{tcolorbox} % Load the tcolorbox package for creating colored boxes
% Define a new tcolorbox environment named 'myquote' with specified colors
\newtcolorbox{myquote}{colback=red!5!white, colframe=red!75!black}
% Redefine the standard 'quote' environment to use 'myquote'
\renewenvironment{quote}{\begin{myquote}}{\end{myquote}}

27
utils/docs/build_combined.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/sh
set -ue
INPUT_DIR="$1"
OUTPUT_FILE="$2"
gx_usage() {
echo "Usage: $0 <input_dir> <output_file>"
echo ""
}
if [ -z "$INPUT_DIR" ]; then
gx_usage
exit 1
fi
if [ -z "$OUTPUT_FILE" ]; then
gx_usage
exit 1
fi
find -L "$INPUT_DIR" -regextype sed \( -regex '.*/[0-9][^/]*\.md' ! -regex '.*/_.*' \) -print0 \
| sort -z \
| xargs -0 -iFILE cat FILE \
| sed -e 's/^\s*----\s*$//' -e 's,\[\](.*/images/,[](./images/,' \
> "$OUTPUT_FILE"

33
utils/docs/build_metadata.sh Executable file
View file

@ -0,0 +1,33 @@
#!/bin/sh
set -ue
MKDOCS_YML_FILE="${1:-}"
OUTPUT_FILE="${2:-}"
gx_usage() {
echo "Usage: $0 <mkdocs_yml_file> <output_file>"
echo ""
}
if [ -z "$MKDOCS_YML_FILE" ]; then
gx_usage
exit 1
fi
if [ -z "$OUTPUT_FILE" ]; then
gx_usage
exit 1
fi
TITLE="$(yq -r '.site_name' < "$MKDOCS_YML_FILE")"
AUTHOR="$(yq -r '.site_author' < "$MKDOCS_YML_FILE")"
cat > "$OUTPUT_FILE" <<-MARK
---
title: Formation
subtitle: "$TITLE"
author: "$AUTHOR"
date: \today
MARK

71
utils/docs/build_pdf.py Executable file
View file

@ -0,0 +1,71 @@
#!/usr/bin/env python
# Usage: ./build.py INPUT_DIR OUTPUT_FILE
import os
# import re
import sys
import pypandoc
def gx_usage():
"""Show usage"""
print(f"Usage: {sys.argv[0]} METADATA_FILE INPUT_FILE OUTPUT_FILE")
print()
if len(sys.argv) != 4:
gx_usage()
metadata_file = sys.argv[1]
if not os.path.exists(metadata_file):
print(f"Metadata file not found: {metadata_file}")
sys.exit(1)
input_file = sys.argv[2]
if not os.path.exists(input_file):
print(f"Input file not found: {input_file}")
sys.exit(1)
# Get second
output_file = sys.argv[3]
if os.path.exists(output_file):
print(f"Output file already exists: {output_file}")
sys.exit(1)
print(f"Metadata: {metadata_file}")
print(f"Input: {input_file}")
print(f"Output: {output_file}")
# Build the pandoc options as a string
pandoc_cmd = [
"--verbose",
"--toc",
"--number-sections",
"--include-in-header", "utils/docs/main.tex",
"--metadata-file", metadata_file,
# "-V", "linkcolor:blue",
# "-V", "geometry:a4paper",
# "-V", "geometry:margin=1.8cm",
"-V", "mainfont=DejaVu Serif",
"-V", "monofont=Noto Sans Mono",
"--pdf-engine=xelatex",
"--resource-path=utils/docs",
"--filter=./utils/docs/filter-nobg.hs",
]
# from glob import glob
# input_files = [os.path.join(dp, f) for dp, dn, filenames in os.walk(input_dir) for f in filenames if re.search(r'^[0-9].*\.md$', f)]
# input_files.sort()
# Convert all markdown files in the chapters/ subdirectory.
pypandoc.convert_file(
input_file,
"pdf",
outputfile=output_file,
extra_args=pandoc_cmd,
)
print(f"Conversion completed. Output saved to: {output_file}")
#

View file

@ -0,0 +1,4 @@
% chapter_breaks.tex
% Chapter breaks setup
\usepackage{sectsty}
\sectionfont{\clearpage}

23
utils/docs/filter-nobg.hs Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env runhaskell
{-# LANGUAGE OverloadedStrings #-}
import Text.Pandoc.JSON
import Data.Text (Text, isInfixOf)
-- Function to filter out images with 'bg' in alt text
filterImage :: Inline -> Inline
filterImage img@(Image attr alt _) =
if any ("bg" `isInfixOf`) (map stringify alt)
then Str ""
else img
filterImage x = x
-- Stringify function to convert inlines to Text
stringify :: Inline -> Text
stringify (Str txt) = txt
stringify _ = ""
-- Main function
main :: IO ()
main = toJSONFilter filterImage

View file

@ -0,0 +1,9 @@
% hyperref_setup.tex
% Hyperref setup
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=blue,
}

32
utils/docs/main.tex Normal file
View file

@ -0,0 +1,32 @@
% main.tex
% Set the document language to English
\usepackage[english]{babel}
% \usepackage[utf8]{inputenc}
% \DeclareUnicodeCharacter{21D2}{$\Rightarrow$}
% Adjust page geometry
\usepackage[
a4paper, inner=1.5cm, outer=1.5cm, top=2cm, bottom=2cm,
% bindingoffset=0.5cm
]{geometry}
% Configure headers and footers using scrlayer-scrpage
\usepackage[automark,headsepline,footsepline]{scrlayer-scrpage}
\clearpairofpagestyles
\ohead{\headmark}
\ofoot{\pagemark}
\pagestyle{scrheadings}
% Include additional settings from external files
% \input{inline_code.tex}
% \input{bullet_styling.tex}
\input{utils/docs/chapter_breaks.tex}
\input{utils/docs/blockquote.tex}
\input{utils/docs/hyperref_setup.tex}
% Font settings using fontspec
\usepackage{fontspec}
% \setmainfont{DejaVu Serif} % Set your main font
% \setmonofont{SauceCodePro Nerd Font} % Set your monospace (code) font

5
utils/docs/metadata.yml Normal file
View file

@ -0,0 +1,5 @@
---
title: Formation
subtitle: MariaDB
author: Glenn Y. Rolland <teaching@glenux.net>
date: \today