Skip to content

Commit

Permalink
Add DevContainer for GitHub Codespaces
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
R0Wi authored Nov 21, 2022
1 parent 86b0105 commit 98759e6
Showing 3 changed files with 41 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.9 as final

USER root

# Add dev tools needed for building
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y install --no-install-recommends \
curl gnupg2 git nano make graphviz imagemagick inkscape sass unzip wget php-cli npm latexmk texlive-latex-extra tex-gyre \
&& wget https://getcomposer.org/installer -qO /tmp/composer-setup.php \
&& php /tmp/composer-setup.php \
&& mv composer.phar /usr/local/bin/composer \
&& npm install svgexport -g \
&& rm -f /tmp/composer-setup.php \
&& rm -rf /var/lib/apt/lists/*
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "Nextcloud documentation DevContainer",
"context": "..",
"dockerFile": "Dockerfile",
"containerUser": "root",
"customizations": {
"vscode": {
"extensions": [
"tht13.rst-vscode",
"tomoki1207.pdf"
]
}
},
"postCreateCommand": "python3 -m pip install -r requirements.txt && python3 -m pip install sphinx-autobuild && cd build && composer install --ignore-platform-reqs"
}
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -134,6 +134,16 @@ Building PDF
5. Install the dependencies `pip install -r requirements.txt`
6. Now you can use `make ...` to build all the stuff - for example `make pdf` to build the PDF flavor of all manuals

Using the VSCode DevContainer
=============================

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

Icons
-----

0 comments on commit 98759e6

Please sign in to comment.