Skip to content

Commit

Permalink
[protocol spec] Add dark mode.
Browse files Browse the repository at this point in the history
Signed-off-by: Daira-Emma Hopwood <[email protected]>
  • Loading branch information
daira committed Nov 1, 2024
1 parent 0a490b6 commit 9a45d6b
Show file tree
Hide file tree
Showing 9 changed files with 4,094 additions and 51 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ tag-release:
protocol:
$(MAKE) -C protocol protocol

protocol-dark:
$(MAKE) -C protocol protocol-dark

all-protocol:
$(MAKE) -C protocol all

Expand Down
6 changes: 5 additions & 1 deletion README.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ to talk about your idea.
Participation in the Zcash project is subject to a `Code of
Conduct <https://github.com/zcash/zcash/blob/master/code_of_conduct.md>`__.

The Zcash protocol is documented in its `Protocol Specification <rendered/protocol/protocol.pdf>`__.
.. raw:: html

<p>The Zcash protocol is documented in its
<span class="lightmode"><a href="https://zips.z.cash/protocol/protocol.pdf">Protocol Specification</a></span><span
class="darkmode" style="display: none;"><a href="https://zips.z.cash/protocol/protocol-dark.pdf">Protocol Specification</a></span>.</p>

To start contributing, first read `ZIP 0 <zips/zip-0000.rst>`__ which documents the ZIP process.
Then clone `this repo <https://github.com/zcash/zips>`__ from GitHub, and start adding
Expand Down
25 changes: 21 additions & 4 deletions protocol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ PDFDIR=../rendered/protocol
# Use EXTRAOPT=-pvc for "continuous preview" mode. For example, "make auxblossom EXTRAOPT=-pvc".
# In this case the updated .pdf will be in the aux/ directory.

.PHONY: all protocol all-specs tag-release discard
.PHONY: all protocol protocol-dark all-specs tag-release discard
all: .Makefile.uptodate
$(MAKE) $(PDFDIR)/protocol.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf
$(MAKE) $(PDFDIR)/protocol.pdf $(PDFDIR)/protocol-dark.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf

protocol: $(PDFDIR)/protocol.pdf

protocol-dark: $(PDFDIR)/protocol-dark.pdf

all-specs: .Makefile.uptodate
$(MAKE) nu6 nu5 canopy heartwood blossom sapling
$(MAKE) nu6 nu6-dark nu5 canopy heartwood blossom sapling

tag-release:
ifeq ($(shell git tag --points-at HEAD |wc -l),0)
Expand Down Expand Up @@ -67,6 +69,9 @@ $(PDFDIR)/nu5.pdf: protocol.tex zcash.bib jubjub.png key_components_sapling.png
$(PDFDIR)/protocol.pdf: protocol.tex zcash.bib jubjub.png key_components_sapling.png key_components_orchard.png incremental_merkle.png
$(MAKE) nu6

$(PDFDIR)/protocol-dark.pdf: protocol.tex zcash.bib jubjub.png key_components_sapling.png key_components_orchard_dark.png incremental_merkle_dark.png
$(MAKE) nu6-dark

.PHONY: auxsapling sapling
auxsapling:
printf '\\toggletrue{issapling}\n\\renewcommand{\\docversion}{Version %s [\\SaplingSpec]}\n' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
Expand Down Expand Up @@ -139,6 +144,18 @@ nu6:
$(MAKE) auxnu6
mv -f aux/nu6.pdf $(PDFDIR)/protocol.pdf

.PHONY: auxnu6-dark nu6-dark
auxnu6-dark:
printf '\\toggletrue{darkmode}\\toggletrue{isnusix}\n\\renewcommand{\\docversion}{Version %s [\\NUSixSpec]}\n' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
mkdir -p aux
rm -f aux/nu6-dark.*
cp mymakeindex.sh aux
$(LATEXMK) -jobname=nu6-dark -auxdir=aux -outdir=aux $(EXTRAOPT) protocol $(NOCRUFT)

nu6-dark:
$(MAKE) auxnu6-dark
mv -f aux/nu6-dark.pdf $(PDFDIR)/protocol-dark.pdf

.PHONY: clean
clean:
rm -f aux/* protocol.ver $(PDFDIR)/protocol.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf
rm -f aux/* protocol.ver $(PDFDIR)/protocol.pdf $(PDFDIR)/protocol-dark.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf
Binary file added protocol/incremental_merkle_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9a45d6b

Please sign in to comment.