FROM rust:slim

RUN apt-get update && apt-get install -y \
    curl \
    git \
    cmake \
    build-essential \
    g++ \
    pkg-config \
    libfreetype6-dev \
    libexpat1-dev \
    libfontconfig1-dev \
    libharfbuzz-dev \
    libicu-dev \
    libgraphite2-dev \
    libpng-dev \
    zlib1g-dev \
    libssl-dev \
    texlive-xetex \
    texlive-latex-base \
    texlive-fonts-recommended \
    texlive-full \
  && rm -rf /var/lib/apt/lists/*

RUN curl -L -o /tmp/pandoc.deb \
        https://github.com/jgm/pandoc/releases/download/3.1.12.2/pandoc-3.1.12.2-1-arm64.deb \
    && dpkg -i /tmp/pandoc.deb \
    && rm /tmp/pandoc.deb

RUN cargo install mdbook
RUN cargo install mdbook-obsidian
RUN cargo install mdbook-pandoc --locked


RUN curl -L -o /tmp/pandoc.deb \
        https://github.com/jgm/pandoc/releases/download/3.1.12.2/pandoc-3.1.12.2-1-arm64.deb 
RUN dpkg -i /tmp/pandoc.deb \
    && rm /tmp/pandoc.deb

ENV PATH="/root/.cargo/bin:${PATH}"

