Skip to content

Commit f7defb4

Browse files
committed
[CSS22] If ToC is empty, make an empty file rather than no file.
1 parent 6ea391e commit f7defb4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

css2/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ LN= ln
274274
echo "<p><strong>Contents</strong>" >>$@
275275
$(MKTOC) -l 2 -r $*.html $(HEADINGDB) >>$@
276276
echo "</div>" >>$@
277-
if [ `cat $@ | wc -l` = 3 ]; then $(RM) $@; touch $@; fi
277+
if [ `cat $@ | wc -l` = 3 ]; then $(SED) -i -e 's|^<p><strong>Contents</strong>||' $@; fi
278+
# if [ `cat $@ | wc -l` = 3 ]; then $(RM) $@; touch $@; fi
278279

279280
# Use the shorter line to avoid regenerating all .html if one .src changed,
280281
# at the cost of possibly incorrect xrefs in the other .html files
@@ -503,12 +504,13 @@ indexlist.srd:: build/indexlist.srb #indexlist.src build/blocks.ok
503504
# @echo "=========== making" $@
504505
# $(CP) $< $@
505506

506-
indexlist.html: indexlist.srd build/indexlist.srb Project.cfg build/warning build/meta-viewport build/fixup-js
507+
indexlist.html: indexlist.srd build/indexlist.srb Project.cfg build/warning build/meta-viewport build/fixup-js indexlist.subtoc
507508
@echo "=========== making" $@
508509
$(ADDNAVBAR) -r $@ $< |\
509510
$(INSAFTER) - build/meta-viewport /TITLE - |\
510511
$(INSAFTER) - build/fixup-js /TITLE - |\
511512
$(INSAFTER) - build/warning /H1 - |\
513+
$(INSAFTER) - $*.subtoc /H1 - |\
512514
$(MKCHAIN) -r $@ - |\
513515
$(SED) -e "s|_THIS_VERSION_|$(THIS_VERSION)|g" \
514516
-e "s|_THE_PREVIOUS_VERSION_|$(THE_PREVIOUS_VERSION)|g" \

0 commit comments

Comments
 (0)