Skip to content

Commit

Permalink
Restore static refpages to the build (#1127)
Browse files Browse the repository at this point in the history
These were commented out during debugging and not restored.
Also factors out a small difference between Vulkan and OpenCL scripts.

Closes #1121
  • Loading branch information
oddhack authored Apr 1, 2024
1 parent 48128e3 commit ed84d35
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ $(REFPATH)/apispec.txt: $(SPECFILES) $(GENREF) $(SCRIPTS)/reflib.py $(PYAPIMAP)
(cat $(MANDIR)/rewritehead ; \
echo ; echo "# Aliases hard-coded in refpage markup" ; \
sort < $(REFPATH)/rewritebody) > $(REFPATH)/.htaccess
echo $(CP) $(MANDIR)/static/*.txt $(REFPATH)
$(CP) $(MANDIR)/static/*.txt $(REFPATH)

# These targets are HTML5 ref pages
#
Expand Down Expand Up @@ -493,11 +493,12 @@ $(MANHTMLDIR)/%.html: $(REFPATH)/%.txt $(MANCOPYRIGHT) $(GENDEPENDS) $(KATEXINST
$(VERYQUIET)$(ASCIIDOCTOR) -b html5 $(ADOCOPTS) $(ADOCHTMLOPTS) \
$(ADOCREFOPTS) -o $@ $<

# This is not formatted as a refpage, so needs a different build rule
$(MANHTMLDIR)/intro.html: $(REFPATH)/intro.txt $(MANCOPYRIGHT)
$(VERYQUIET)echo "Building $@ from $< using default options"
$(VERYQUIET)$(MKDIR) $(MANHTMLDIR)
$(VERYQUIET)$(ASCIIDOCTOR) -b html5 $(ADOCOPTS) $(ADOCHTMLOPTS) \
$(ADOCREFOPTS) -o $@ $<
-o $@ $<

# Targets generated from the XML and registry processing scripts
# apimap.py - Python encoding of the registry
Expand Down
8 changes: 6 additions & 2 deletions scripts/docgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ def writeInclude(self, directory, basename, contents):
index_term = basename
write('indexterm:[{}]'.format(index_term), file=fp)

write(f'[source%unbreakable,{self.conventions.docgen_language}]', file=fp)
source_options = self.conventions.docgen_source_options
source_language = self.conventions.docgen_language
source_directive = f'[source{source_options},{source_language}]'

write(source_directive, file=fp)
write('----', file=fp)
write(contents, file=fp)
write('----', file=fp)
Expand All @@ -270,7 +274,7 @@ def writeInclude(self, directory, basename, contents):
# Asciidoc anchor
write(self.genOpts.conventions.warning_comment, file=fp)
write('// Include this no-xref version without cross reference id for multiple includes of same file', file=fp)
write(f'[source,%unbreakable,{self.conventions.docgen_language}]', file=fp)
write(source_directive, file=fp)
write('----', file=fp)
write(contents, file=fp)
write('----', file=fp)
Expand Down
8 changes: 8 additions & 0 deletions scripts/spec_tools/conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,3 +548,11 @@ def docgen_language(self):
blocks."""

return 'c++'

@property
def docgen_source_options(self):
"""Return block options to be used in docgenerator [source] blocks,
which are appended to the 'source' block type.
Can be empty."""

return '%unbreakable'

0 comments on commit ed84d35

Please sign in to comment.