Skip to content

Commit

Permalink
Add devcontainer.json
Browse files Browse the repository at this point in the history
This ensures that VS Code or GitHub Codespaces can automatically create an environment where `make` can build the rst files.
It also enables the rst preview pane in VS Code or GitHub Codespaces.
  • Loading branch information
AArnott committed Sep 8, 2023
1 parent 497bcc1 commit 49e9b32
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM debian:latest

RUN apt-get update \
&& apt-get install -y \
gawk \
perl \
sed \
git \
python3 \
python3-pip \
pandoc \
biber \
latexmk \
texlive \
texlive-science \
texlive-fonts-extra \
texlive-plain-generic \
texlive-bibtex-extra \
&& apt-get clean

# Install Python packages, after removing a file that breaks pip.
RUN rm /usr/lib/python3.11/EXTERNALLY-MANAGED
RUN pip install rst2html5 \
&& pip install docutils==0.19

RUN apt-get install -y locales \
&& echo "LC_ALL=en_US.UTF-8" >> /etc/environment \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& echo "LANG=en_US.UTF-8" > /etc/locale.conf \
&& locale-gen en_US.UTF-8

ENV PATH=${PATH}:/root/.local/bin
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "Dev space",
"dockerFile": "Dockerfile"
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ protocol/saplinghtml/
protocol/heartwood.pdf
protocol/protocol.ver
*~

# VS Code settings files
.vscode/settings.json
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Use ``make`` to check that you are using correct
`Markdown <https://pandoc.org/MANUAL.html#pandocs-markdown>`__ syntax,
and double-check the generated ``draft-*.html`` file before filing a Pull Request.

Consider leveraging `our devcontainer.json <devcontainer.rst>`__ for ease of tool aquisition
when working in this repo.

NU5 ZIPs
--------
Expand Down
2 changes: 2 additions & 0 deletions README.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Use ``make`` to check that you are using correct
`Markdown <https://pandoc.org/MANUAL.html#pandocs-markdown>`__ syntax,
and double-check the generated ``draft-*.html`` file before filing a Pull Request.

Consider leveraging `our devcontainer.json <devcontainer.rst>`__ for ease of tool aquisition
when working in this repo.

NU5 ZIPs
--------
Expand Down
20 changes: 20 additions & 0 deletions devcontainer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Using dev containers for editing this repo

This repo uses devcontainer.json to ease configuring the tools necessary to run ``make``.
You can use `Codespaces <https://docs.github.com/en/codespaces/developing-in-codespaces/developing-in-a-codespace>`__
to make your contributions and validate your work.
Or when using VS Code, use the "Dev Containers: Reopen in Container" command to create
the docker container with the tools.

## VS Code experience

When using VS Code to edit .rst files, the following extensions will add a preview pane,
and otherwise add tooling for the files you may be editing:

- `Makefile Tools <https://marketplace.visualstudio.com/items?itemName=ms-vscode.makefile-tools>`__
- `reStructuredText <https://marketplace.visualstudio.com/items?itemName=lextudio.restructuredtext>`__
- `Python <https://marketplace.visualstudio.com/items?itemName=ms-python.python>`__
- `reStructuredText Syntax highlighting <https://marketplace.visualstudio.com/items?itemName=trond-snekvik.simple-rst>`__
- `Docker <https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker>`__

Note that these extensions are not endorsed nor been vetted by the Zcash Foundation.

0 comments on commit 49e9b32

Please sign in to comment.