Skip to content

Commit 98759e6

Browse files
authored
Add DevContainer for GitHub Codespaces
Signed-off-by: GitHub <[email protected]>
1 parent 86b0105 commit 98759e6

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.9 as final
2+
3+
USER root
4+
5+
# Add dev tools needed for building
6+
RUN export DEBIAN_FRONTEND=noninteractive \
7+
&& apt-get update \
8+
&& apt-get -y install --no-install-recommends \
9+
curl gnupg2 git nano make graphviz imagemagick inkscape sass unzip wget php-cli npm latexmk texlive-latex-extra tex-gyre \
10+
&& wget https://getcomposer.org/installer -qO /tmp/composer-setup.php \
11+
&& php /tmp/composer-setup.php \
12+
&& mv composer.phar /usr/local/bin/composer \
13+
&& npm install svgexport -g \
14+
&& rm -f /tmp/composer-setup.php \
15+
&& rm -rf /var/lib/apt/lists/*

.devcontainer/devcontainer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// For format details, see https://aka.ms/devcontainer.json.
2+
{
3+
"name": "Nextcloud documentation DevContainer",
4+
"context": "..",
5+
"dockerFile": "Dockerfile",
6+
"containerUser": "root",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"tht13.rst-vscode",
11+
"tomoki1207.pdf"
12+
]
13+
}
14+
},
15+
"postCreateCommand": "python3 -m pip install -r requirements.txt && python3 -m pip install sphinx-autobuild && cd build && composer install --ignore-platform-reqs"
16+
}

README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ Building PDF
134134
5. Install the dependencies `pip install -r requirements.txt`
135135
6. Now you can use `make ...` to build all the stuff - for example `make pdf` to build the PDF flavor of all manuals
136136

137+
Using the VSCode DevContainer
138+
=============================
139+
140+
This repository contains a full-featured `VSCode DevContainer <https://code.visualstudio.com/docs/devcontainers/containers>`_.
141+
You can use it in your local development environment or via `GitHub Codespaces <https://github.com/features/codespaces>`_.
142+
Just open the container an use one of the commands from above to build the project. For example ``make`` to build the full
143+
documentaion, ``make html`` to build the HTML documentaion or ``make pdf`` to build the PDF documentation. You can also use
144+
``make SPHINXBUILD=sphinx-autobuild html`` in combination with `port forwarding <https://code.visualstudio.com/docs/devcontainers/containers#_forwarding-or-publishing-a-port>`_
145+
to watch file changes and automatically reload the html preview.
146+
137147
Icons
138148
-----
139149

0 commit comments

Comments
 (0)