diff --git a/.github/workflows/pandoc.yaml b/.github/workflows/pandoc.yaml new file mode 100644 index 000000000000..4a52c010327b --- /dev/null +++ b/.github/workflows/pandoc.yaml @@ -0,0 +1,50 @@ +name: Pandoc + +on: + push: + branches: [scala3-pandoc] + +jobs: + printenv: + runs-on: ubuntu-latest + + steps: + - name: Print Ubuntu environment + run: | + env | grep GIT + env | grep HOME + docker version --format '{{.Server.Version}}' + #docker run pandoc/latex:latest --version | grep ^pandoc + + build: + needs: printenv + runs-on: ubuntu-latest + container: + image: pandoc/latex:latest + #if: "( github.event_name == 'pull_request' + # && !contains(github.event.pull_request.body, '[skip ci]') + # && !contains(github.event.pull_request.body, '[skip docs]') + # ) + # || contains(github.event.ref, 'pandoc') + # || contains(github.event.ref, 'master')" + + steps: + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Print Pandoc environment + run: | + #env | grep TEX + pandoc --version | grep ^pandoc + + - name: Install additional TeX fonts + run: | + find . -name install-tex-fonts + chmod u+x ./pandoc/extras/install-tex-fonts + DEBUG=1 & ./pandoc/extras/install-tex-fonts + + - name: Generate PDF reference documentation + run: | + find . -name md2pdf + chmod u+x ./pandoc/md2pdf + DEBUG=1 & ./pandoc/md2pdf reference diff --git a/community-build/community-projects/cask b/community-build/community-projects/cask index d9e3ec387ade..da12e13da23c 160000 --- a/community-build/community-projects/cask +++ b/community-build/community-projects/cask @@ -1 +1 @@ -Subproject commit d9e3ec387ade7f462fe696d25c647e3192daf566 +Subproject commit da12e13da23c184196a5c253628cd91673e4ac84 diff --git a/community-build/community-projects/intent b/community-build/community-projects/intent index b1a62511741d..38c7314fb764 160000 --- a/community-build/community-projects/intent +++ b/community-build/community-projects/intent @@ -1 +1 @@ -Subproject commit b1a62511741d84cc84fdf14c051804fe81629cdb +Subproject commit 38c7314fb7643bc1786e4358b83a815194071d48 diff --git a/community-build/community-projects/onnx-scala b/community-build/community-projects/onnx-scala index ff0c47297fd2..64cb918ea298 160000 --- a/community-build/community-projects/onnx-scala +++ b/community-build/community-projects/onnx-scala @@ -1 +1 @@ -Subproject commit ff0c47297fd2885f8b56def3ea4fd22efdfe1e8b +Subproject commit 64cb918ea298ba2a9410d99d4dd565cdeed79b3e diff --git a/community-build/community-projects/scala-stm b/community-build/community-projects/scala-stm index 96ef6e56af08..7011331d3684 160000 --- a/community-build/community-projects/scala-stm +++ b/community-build/community-projects/scala-stm @@ -1 +1 @@ -Subproject commit 96ef6e56af08d0ec600ec80ebec68d227a8c048c +Subproject commit 7011331d36848faf9af407e3e85ab75076dfdefa diff --git a/community-build/community-projects/scalap b/community-build/community-projects/scalap index 6dc9e16358a0..08e4a6172dfe 160000 --- a/community-build/community-projects/scalap +++ b/community-build/community-projects/scalap @@ -1 +1 @@ -Subproject commit 6dc9e16358a07150ca0e89df6ed38e79854a411c +Subproject commit 08e4a6172dfef0425abe0dac6808127ba58ce909 diff --git a/community-build/community-projects/scas b/community-build/community-projects/scas index 650b72f7baeb..91b1de233de7 160000 --- a/community-build/community-projects/scas +++ b/community-build/community-projects/scas @@ -1 +1 @@ -Subproject commit 650b72f7baeb4443f16fe4e923901837f5d9ad98 +Subproject commit 91b1de233de7128e57aca1303e099b1a5499807f diff --git a/community-build/community-projects/scodec b/community-build/community-projects/scodec index 84db5f776573..8d7f83ae76e3 160000 --- a/community-build/community-projects/scodec +++ b/community-build/community-projects/scodec @@ -1 +1 @@ -Subproject commit 84db5f7765738024aebd8df2bf53151cc6d4d793 +Subproject commit 8d7f83ae76e3278245631126d808c9c02e57ae23 diff --git a/community-build/community-projects/shapeless b/community-build/community-projects/shapeless index 94c1d4413373..273524d806fc 160000 --- a/community-build/community-projects/shapeless +++ b/community-build/community-projects/shapeless @@ -1 +1 @@ -Subproject commit 94c1d44133739c7c57b64228caccc4fc938c2862 +Subproject commit 273524d806fc38a4fdfff27550c3fb3720716754 diff --git a/community-build/community-projects/stdLib213 b/community-build/community-projects/stdLib213 index 891f92f01cfb..21cb41941e39 160000 --- a/community-build/community-projects/stdLib213 +++ b/community-build/community-projects/stdLib213 @@ -1 +1 @@ -Subproject commit 891f92f01cfbc900a1a1efada73530246babd075 +Subproject commit 21cb41941e399b0b06c4ea80abbc6e2084f2e415 diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index b5a04a2f3e35..d31c98761a20 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit b5a04a2f3e35ae340e0821d604dafe9cb10a7fc7 +Subproject commit d31c98761a204c91f0e06a4eaa8a45aa038d14b8 diff --git a/pandoc/.dockerignore b/pandoc/.dockerignore new file mode 100644 index 000000000000..6ab5a428a959 --- /dev/null +++ b/pandoc/.dockerignore @@ -0,0 +1,4 @@ +docs/ +extras/ +*.bat +README.md diff --git a/pandoc/.gitignore b/pandoc/.gitignore new file mode 100644 index 000000000000..3fec32c84275 --- /dev/null +++ b/pandoc/.gitignore @@ -0,0 +1 @@ +tmp/ diff --git a/pandoc/Dockerfile b/pandoc/Dockerfile new file mode 100644 index 000000000000..677bb7d2c7fd --- /dev/null +++ b/pandoc/Dockerfile @@ -0,0 +1,35 @@ +## Created by mics (https://github.com/michelou/) on December 2020. + +FROM pandoc/ubuntu-latex:2.11.4 + +LABEL md2pdf.author="Stéphane Micheloud " +LABEL md2pdf.description="Create PDF file for Scala 3 documentation" +LABEL md2pdf.version=1.0 + +WORKDIR /dotty +COPY ./tmp/docs ./docs/docs + +WORKDIR pandoc +COPY ./data ./data +COPY ./md2pdf . + +ENV TEXLIVE_HOME=/opt/texlive/texdir + +## See https://github.com/openjournals/whedon/blob/master/paperdraft.Dockerfile +RUN tlmgr update --self + +## Install additional LaTeX packages +## Already present: fancyvrb, fontspec, l3backend, l3kernel, l3packages, pgf, unicode-math, xcolor. +RUN tlmgr install \ + dejavu \ + environ \ + gnu-freefont \ + selnolig \ + tcolorbox \ + trimspaces + +RUN echo "#!/bin/bash \n ./md2pdf \n ls /dotty/out/pandoc/" > ./entrypoint.sh +RUN chmod +x ./entrypoint.sh + +ENTRYPOINT [ "./entrypoint.sh" ] +CMD [ "reference" ] diff --git a/pandoc/README.md b/pandoc/README.md new file mode 100644 index 000000000000..bc7c0cc575de --- /dev/null +++ b/pandoc/README.md @@ -0,0 +1,90 @@ +# Creating PDF files for the Scala 3 documentation + + +This project is located at the root of the [`lampepfl/dotty`][github_dotty] repository, at the same level as the [`Scaladoc`][github_scala3doc] project. + +We aim to generate a *single* PDF file from a collection of [Markdown] documents, for instance for the [*Scala 3 reference*][scala3_reference] documentation. + +Our solution is built on [Pandoc]; it gets its inputs from two directories and generates a PDF file into the output directory: + + + + + + + + + + + + +
Input directoriesdocs/docs/<project>/
pandoc/data/
*.md files
Pandoc data files
Output directoryout/pandoc/scala3_<project>.pdf(*)
+ +(*) *``* is one of [`contributing`](https://github.com/lampepfl/dotty/tree/master/docs/docs/contributing), [`internals`](https://github.com/lampepfl/dotty/tree/master/docs/docs/internals), [`reference`](https://github.com/lampepfl/dotty/tree/master/docs/docs/reference) or [`usage`](https://github.com/lampepfl/dotty/tree/master/docs/docs/usage). + +The generated PDF file is more elaborated than its sibling HTML version; unlike the online [*Scala 3 reference*][scala3_reference] documentation available on the [Scala 3 documentation](https://docs.scala-lang.org/scala3/) webpage, the `scala3_reference.pdf` document : +- starts with a *title page* directly followed by a *table of contents* and ends with an *appendix*. +- gathers all the "*More details*" sections in the appendix. + +> See document [`PROJECT.md`](docs/PROJECT.md) for further information, e.g. project organisation. + +## Project dependencies + +This project depends on the following software : + +- [Pandoc 2](https://github.com/jgm/pandoc/releases) [1](#footnote_01) *([release notes](https://pandoc.org/releases.html))* +- [TeX Live 2021](https://tug.org/texlive/) [2](#footnote_02) *([release notes](http://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-880009.2))* + +> See documents [`PANDOC.md`](docs/PANDOC.md) and [`TEXLIVE.md`](docs/TEXLIVE.md) for product specific information, e.g. software installation. + +One may also install the following software: + +- [Docker Desktop 3](https://docs.docker.com/get-docker/) [3](#footnote_03) *([release notes](https://docs.docker.com/release-notes/))* + +> See document [`DOCKER.md`](docs/DOCKER.md) for further information, e.g. `Dockerfile` usage. + +## Build commands + +We provide two commands for MacOS/Ubuntu as well as their equivalents for MS Windows : +- for *interactive users* :
[`build {