Skip to content

Commit 9150e33

Browse files
lucasb-eyersoumith
authored andcommitted
Add support for creating docsets. (pytorch#1276)
Docsets are an offline documentation format introduced by Dash.app and supported by Zeal and some other open-source clones.
1 parent e447880 commit 9150e33

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

docs/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ BUILDDIR = build
1212
help:
1313
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1414

15-
.PHONY: help Makefile
15+
docset: html
16+
doc2dash --name $(SPHINXPROJ) --icon $(SOURCEDIR)/_static/img/pytorch-logo-flame.png --enable-js --online-redirect-url http://pytorch.org/docs/ --force $(BUILDDIR)/html/
17+
18+
# Manually fix because Zeal doesn't deal well with `icon.png`-only at 2x resolution.
19+
cp $(SPHINXPROJ).docset/icon.png $(SPHINXPROJ).docset/[email protected]
20+
convert $(SPHINXPROJ).docset/[email protected] -resize 16x16 $(SPHINXPROJ).docset/icon.png
21+
22+
.PHONY: help Makefile docset
1623

1724
# Catch-all target: route all unknown targets to Sphinx using the new
1825
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1010 Bytes
Loading
Lines changed: 33 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)