Skip to content

Commit 93a0821

Browse files
committed
build: Switch from naturaldocs to rustdoc
1 parent 4d4995f commit 93a0821

File tree

4 files changed

+17
-312
lines changed

4 files changed

+17
-312
lines changed

configure

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ probe CFG_LLVM_CONFIG llvm-config
319319
probe CFG_VALGRIND valgrind
320320
probe CFG_PERF perf
321321
probe CFG_ISCC iscc
322-
probe CFG_NATURALDOCS NaturalDocs naturaldocs
323322
probe CFG_LLNEXTGEN LLnextgen
324323
probe CFG_PANDOC pandoc
325324
probe CFG_PDFLATEX pdflatex
@@ -413,7 +412,6 @@ step_msg "making directories"
413412

414413
for i in \
415414
doc doc/core doc/std \
416-
nd nd/core nd/std \
417415
dl tmp
418416
do
419417
make_dir $i

doc/Languages.txt

Lines changed: 0 additions & 126 deletions
This file was deleted.

doc/Topics.txt

Lines changed: 0 additions & 159 deletions
This file was deleted.

mk/docs.mk

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -100,42 +100,34 @@ endif
100100

101101

102102
######################################################################
103-
# Naturaldocs (library reference related)
103+
# Rustdoc (libcore/std)
104104
######################################################################
105105

106-
ifeq ($(CFG_NATURALDOCS),)
107-
$(info cfg: no naturaldocs found, omitting library doc build)
106+
ifeq ($(CFG_PANDOC),)
107+
$(info cfg: no pandoc found, omitting library doc build)
108108
else
109109

110-
define libdoc
111-
doc/$(1)/index.html: nd/$(1)/Languages.txt nd/$(1)/Topics.txt \
112-
nd/$(1)/lib.css $(2)
113-
@$$(call E, naturaldocs: $$@)
114-
$(CFG_NATURALDOCS) -i $(S)src/lib$(1) -o HTML doc/$(1) \
115-
-p nd/$(1) -r -s Default lib
116-
117-
nd/$(1)/Languages.txt: $(S)doc/Languages.txt
118-
@$$(call E, cp: $$@)
119-
$(Q)cp $$< $$@
110+
# The rustdoc executable
111+
RUSTDOC = $(HBIN2_H_$(CFG_HOST_TRIPLE))/rustdoc$(X)
120112

121-
nd/$(1)/Topics.txt: $(S)doc/Topics.txt
122-
@$$(call E, cp: $$@)
123-
$(Q)cp $$< $$@
113+
# The library documenting macro
114+
# $(1) - The output directory
115+
# $(2) - The crate file
116+
# $(3) - The crate soruce files
117+
define libdoc
118+
doc/$(1)/index.html: $(2) $(3) $$(RUSTDOC) doc/$(1)/rust.css
119+
@$$(call E, rustdoc: $$@)
120+
$(Q)$(RUSTDOC) $(2) --output-dir=doc/$(1)
124121

125-
nd/$(1)/lib.css: $(S)doc/lib.css
122+
doc/$(1)/rust.css: $(S)doc/rust.css
126123
@$$(call E, cp: $$@)
127124
$(Q)cp $$< $$@
128125

129-
GENERATED += nd/$(1)/Languages.txt \
130-
nd/$(1)/Topics.txt \
131-
nd/$(1)/Menu.txt \
132-
nd/$(1)/Data
133-
134-
DOCS += doc/$(1)/index.html nd/$(1)/lib.css
126+
DOCS += doc/$(1)/index.html
135127
endef
136128

137-
$(eval $(call libdoc,core,$(CORELIB_CRATE) $(CORELIB_INPUTS)))
138-
$(eval $(call libdoc,std,$(STDLIB_CRATE) $(STDLIB_INPUTS)))
129+
$(eval $(call libdoc,core,$(CORELIB_CRATE),$(CORELIB_INPUTS)))
130+
$(eval $(call libdoc,std,$(STDLIB_CRATE),$(STDLIB_INPUTS)))
139131
endif
140132

141133

0 commit comments

Comments
 (0)