Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore static refpages to the build #1127

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'