use pandoc to generate html from md files, use dillo to view welcome screen, renamed rootdir to nanodesk-files

This commit is contained in:
Marcus 2023-05-03 15:46:57 +02:00
parent f77ba1cbbd
commit ec2c44651a
17 changed files with 100 additions and 9 deletions

View File

@ -63,7 +63,7 @@ sudo apt install \
mtools \
dosfstools \
coreutils \
markdown || error
pandoc || error
message "start building nanodesk ${YELLOW}${VERSION}${ENDCOLOR}"
@ -72,7 +72,7 @@ read -p "press [enter] to continue"
### stuff begins here
message "creating build directories"
for dir in $(echo build/{staging/{EFI/BOOT,boot/grub/x86_64-efi,isolinux,live},tmp,chroot})
for dir in $(echo build/{staging/{EFI/BOOT,boot/grub/x86_64-efi,isolinux,live}tmp,chroot,nanodesk-files})
do
message "$dir"
test -d $dir || mkdir -p $dir
@ -97,12 +97,22 @@ $CHROOTCMD /bin/bash /tmp/install_base.sh || error
message "clear /tmp"
$CHROOTCMD /usr/bin/rm -Rf /tmp/* || error
message "write nanodesk version $VERSION into rootdir/usr/share/nanodesk/version"
echo $VERSION > rootdir/usr/share/nanodesk/version
### copy nanodesk configs to chroot
message "copy nanodesk config files into chroot"
sudo cp -r rootdir/* build/chroot/
### copy nanodesk files in nanodesk-files/ to build/nanodesk-files/ so we can make changes there,
### like generate version file and convert .md to .html in usr/share/docs/nanodesk
message "copy nanodesk-files/ to build/nanodesk-files/"
sudo cp -r nanodesk-files/* build/nanodesk-files/
message "write nanodesk version $VERSION into build/nanodesk-files/usr/share/nanodesk/version"
echo $VERSION > nanodesk-files/usr/share/nanodesk/version
message "convert .md files in build/nanodesk-files/usr/doc/nanodesk/ to .html"
for md in $(find build/nanodesk-files/usr/share/doc/nanodesk/ -name "*.md")
do pandoc --self-contained --css=pandoc/pandoc.css -M pagetitle:$(basename $md|sed 's/\.md//') -s $md -o $(echo $md | sed 's/\.md/\.html/')
done
message "copy build/nanodesk-files/ to build/chroot/"
sudo cp -r build/nanodesk-files/* build/chroot/
message "correct file permissions"
$CHROOTCMD /usr/bin/chmod 440 /etc/sudoers || error

View File

@ -236,10 +236,11 @@
<Key mask="A" key="Left">ldesktop</Key>
<Key mask="A" key="Up">udesktop</Key>
<Key mask="A" key="Down">ddesktop</Key>
<StartupCommand>$(find ~/.screenlayout/ -type f -executable|head -n 1)</StartupCommand>
<StartupCommand>xscreensaver -no-splash</StartupCommand>
<StartupCommand>gxmessage -center -file /usr/share/nanodesk/firstlogin/welcome.md -title "Welcome to nanodesk"</StartupCommand>
<StartupCommand>volumeicon</StartupCommand>
<StartupCommand>connman-ui-gtk</StartupCommand>
<StartupCommand>dillo -f -g 640x480 /usr/share/doc/nanodesk/welcome/welcome.html</StartupCommand>
</JWM>

View File

@ -50,7 +50,7 @@ error () {
finish () {
message "removing firststart dialoge from jwm config"
$CHROOTCMD /usr/bin/sed -i '/firstlogin\/welcome/d' /etc/jwm/system.jwmrc || error
$CHROOTCMD /usr/bin/sed -i '/doc\/nanodesk\/welcome\/welcome\.html/d' /etc/jwm/system.jwmrc || error
message "removing installer files from target"
$CHROOTCMD /usr/bin/rm -Rf /root/nanodesk-installer.sh || error

View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -0,0 +1 @@
v0.1.6

78
pandoc/pandoc.css Normal file
View File

@ -0,0 +1,78 @@
/* this file is based on https://pandoc.org/demo/pandoc.css */
body {
margin: auto;
padding-right: 1em;
padding-left: 1em;
color: black;
font-family: Verdana, sans-serif;
font-size: 100%;
line-height: 140%;
color: #333;
}
pre,code {
background-color: #ececec;
}
pre {
border: 1px dotted gray;
color: #1111111;
padding: 0.5em;
}
code {
font-family: monospace;
}
h1 a, h2 a, h3 a, h4 a, h5 a {
text-decoration: none;
/*color: #7a5ada; */
}
h1, h2, h3, h4, h5 {
/* font-family: verdana; */
font-family: Verdana, sans-serif;
font-weight: bold;
border-bottom: 1px dotted black;
/* color: #7a5ada; */
}
h1 {
font-size: 150%;
}
h2 {
font-size: 110%;
}
h3 {
font-size: 95%;
}
h4 {
font-size: 90%;
font-style: italic;
}
h5 {
font-size: 90%;
font-style: italic;
}
h1.title {
font-size: 200%;
font-weight: bold;
padding-top: 0.2em;
padding-bottom: 0.2em;
text-align: left;
border: none;
}
dt code {
font-weight: bold;
}
dd p {
margin-top: 0;
}
#footer {
padding-top: 1em;
font-size: 70%;
color: gray;
text-align: center;
}

View File

@ -92,6 +92,7 @@ apt install -y \
arandr \
lxterminal \
gparted \
dillo \
firefox-esr \
pcmanfm \
/tmp/xdgmenumaker*.deb || error