first commit

This commit is contained in:
2024-04-15 22:41:01 +02:00
commit f0f778dc11
154 changed files with 5454 additions and 0 deletions
Executable
+2
View File
@@ -0,0 +1,2 @@
UID=1000
GID=1000
+24
View File
@@ -0,0 +1,24 @@
FROM debian
RUN apt update -y
RUN apt install pandoc pandoc-data texlive-base texlive-binaries texlive-fonts-extra texlive-fonts-extra-links texlive-fonts-recommended texlive-lang-greek texlive-lang-other texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-pictures texlive-plain-generic texlive-science texlive-xetex -y
RUN useradd isen
RUN apt install wget -y
RUN wget https://github.com/jgm/pandoc/releases/download/3.1.13/pandoc-3.1.13-1-amd64.deb -O /tmp/pandoc.deb
RUN dpkg -i /tmp/pandoc.deb
RUN apt install texlive-lang-french -y
RUN echo coucou.
COPY pandoc-fonts.tar /tmp/
RUN tar xf /tmp/pandoc-fonts.tar -C /usr/share/fonts/
RUN fc-cache -v -f
COPY run_conversion.sh /bin/
RUN chmod ugo+x /bin/run_conversion.sh
USER 1000:1000
CMD /bin/run_conversion.sh
+42
View File
@@ -0,0 +1,42 @@
# Install docker
apt install docker
# User UID docker
```
sudo usermod -aG docker [USER]
```
Ne pas oublier de re-déamrrer sa session
# Install docker compose
```
curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url | grep docker-compose-linux-x86_64 | cut -d '"' -f 4 | wget -qi -
```
mv docker-compose-linux-x86_64 /bin/docker-compose
# DEBUG
## Build isen-gen-exam
```
docker build . -t pandoc-gen-file
```
## Start conversion
```
docker-compose up
```
## Run Debug
```
touch ../.tmp
docker-compose up
```
BIN
View File
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
services:
gen-doc:
user: "1000:1000"
image: pandoc-gen-file
volumes:
- ../:/data
+13
View File
@@ -0,0 +1,13 @@
digraph G {
graph [layout=dot rankdir=LR]
// This is just an example for you to use as a template.
// Edit as you like. Whenever you save a legal graph
// the layout in the graphviz window will be updated.
vim [href="http://www.vim.org/"]
dot [href="http://www.graphviz.org/"]
vimdot [href="file:///usr/bin/vimdot"]
{vim dot} -> vimdot
}
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
while [[ -f /data/lock ]]
do
sleep 1
done
source /data/CONF/config
cd /data/IN
Date=$(date +%Y-%m-%d)
for File in $(find . -name "*.md")
do
InFile=$(basename ${File})
BaseFile=$(echo $(basename ${File}) | sed 's/.md//g')
OutFile=$(echo $(basename ${File}) | sed 's/.md//g').pdf
Title=$(echo $OutFile | sed 's/_/ /g' | sed 's/.pdf//g')
echo -n "$Title : "
dos2unix ./${InFile} &> /dev/null
cat ../CONF/header | sed "s/___NAME___/${Name}/g" | sed "s/___TITLE___/${Title}/g" | sed "s/___DATE___/${Date}/g" > ./${InFile}.better
cat ./${InFile} >> ./${InFile}.better
pandoc --from markdown --pdf-engine=xelatex --template "${ThemePDFNameCours}" --toc-depth 2 --listings --toc -o ../OUT/${OutFile} ./${InFile}.better &> /dev/null
[[ $? -eq 0 ]] && echo OK || echo FAILED
done
echo -n "Clean environement : "
rm -f ./*.better &> /dev/null
[[ $? -eq 0 ]] && echo OK || echo FAILED