Skip to content

Commit

Permalink
Merge pull request #929 from daira/spec-dark-mode
Browse files Browse the repository at this point in the history
Add dark mode for the protocol specification
  • Loading branch information
daira authored Nov 2, 2024
2 parents 8177448 + 745f0de commit 0ad0068
Show file tree
Hide file tree
Showing 20 changed files with 4,114 additions and 66 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
*.swp
*.save
*.save.*
*~

.Makefile.uptodate
.zipfilelist.*
.draftfilelist.*

protocol/aux/
protocol/html/
protocol/saplinghtml/

protocol/heartwood.pdf
protocol/protocol.ver
*~
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ tag-release:
protocol:
$(MAKE) -C protocol protocol

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

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

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

discard:
git checkout -- 'rendered/*.html' 'README.rst' 'rendered/protocol/*.pdf'

Expand Down
6 changes: 5 additions & 1 deletion README.rst
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
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
37 changes: 27 additions & 10 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,9 +69,12 @@ $(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]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
printf '\\toggletrue{issapling}\n\\renewcommand{\\docversion}{Version %s [\\SaplingSpec]}\n' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
mkdir -p aux
rm -f aux/sapling.*
cp mymakeindex.sh aux
Expand All @@ -81,7 +86,7 @@ sapling:

.PHONY: auxblossom blossom
auxblossom:
printf '\\toggletrue{isblossom}\n\\renewcommand{\\docversion}{Version %s [\\BlossomSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
printf '\\toggletrue{isblossom}\n\\renewcommand{\\docversion}{Version %s [\\BlossomSpec]}\n' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
mkdir -p aux
rm -f aux/blossom.*
cp mymakeindex.sh aux
Expand All @@ -93,7 +98,7 @@ blossom:

.PHONY: auxheartwood heartwood
auxheartwood:
printf '\\toggletrue{isheartwood}\n\\renewcommand{\\docversion}{Version %s [\\HeartwoodSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
printf '\\toggletrue{isheartwood}\n\\renewcommand{\\docversion}{Version %s [\\HeartwoodSpec]}\n' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
mkdir -p aux
rm -f aux/heartwood.*
cp mymakeindex.sh aux
Expand All @@ -105,7 +110,7 @@ heartwood:

.PHONY: auxcanopy canopy
auxcanopy:
printf '\\toggletrue{iscanopy}\n\\renewcommand{\\docversion}{Version %s [\\CanopySpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
printf '\\toggletrue{iscanopy}\n\\renewcommand{\\docversion}{Version %s [\\CanopySpec]}\n' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
mkdir -p aux
rm -f aux/canopy.*
cp mymakeindex.sh aux
Expand All @@ -117,7 +122,7 @@ canopy:

.PHONY: auxnu5 nu5
auxnu5:
printf '\\toggletrue{isnufive}\n\\renewcommand{\\docversion}{Version %s [\\NUFiveSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
printf '\\toggletrue{isnufive}\n\\renewcommand{\\docversion}{Version %s [\\NUFiveSpec]}\n' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
mkdir -p aux
rm -f aux/nu5.*
cp mymakeindex.sh aux
Expand All @@ -129,7 +134,7 @@ nu5:

.PHONY: auxnu6 nu6
auxnu6:
printf '\\toggletrue{isnusix}\n\\renewcommand{\\docversion}{Version %s [\\NUSixSpec]}' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
printf '\\toggletrue{isnusix}\n\\renewcommand{\\docversion}{Version %s [\\NUSixSpec]}\n' "$$(git describe --tags --abbrev=6)" |tee protocol.ver
mkdir -p aux
rm -f aux/nu6.*
cp mymakeindex.sh aux
Expand All @@ -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 0ad0068

Please sign in to comment.