# each entry is a dictionary with following items:
# name - base file name (required)
# file - generated file (required)
-# source - source filename (required)
+# source - source filename relative to repository root (optional, if there is no source)
docs_html_in_gen = []
foreach name : docs_html_in_files
docs_html_in_gen += {
'name': name,
'file': html_in_file,
- 'source': html_in_file,
+ 'source': 'docs' / html_in_file,
}
endforeach
docs_html_in_gen += {
'name': name,
'file': docs_rst2html_gen.process(rst_file),
- 'source': rst_file,
+ 'source': 'docs' / rst_file,
}
endforeach
docs_html_in_gen += {
'name': 'hvsupport',
'file': hvsupport_html_in,
- 'source': 'hvsupport.html.in',
}
news_html_in = docs_rst2html_gen.process(meson.source_root() / 'NEWS.rst')
site_xsl,
'@INPUT@',
'@OUTPUT@',
- data['source'],
+ data.get('source', []),
],
depends: [ aclperms_gen ],
depend_files: [ page_xsl ],
<li><a href="http://serverfault.com/questions/tagged/libvirt">serverfault</a></li>
</ul>
</div>
- <div id="contribute">
- <h3>Contribute</h3>
- <ul>
- <li><a href="https://gitlab.com/libvirt/libvirt/-/blob/master/docs/{$pagesrc}">edit this page</a></li>
- </ul>
- </div>
+ <xsl:if test="$pagesrc != ''">
+ <div id="contribute">
+ <h3>Contribute</h3>
+ <ul>
+ <li><a href="https://gitlab.com/libvirt/libvirt/-/blob/master/{$pagesrc}">edit this page</a></li>
+ </ul>
+ </div>
+ </xsl:if>
<div id="conduct">
Participants in the libvirt project agree to abide by <a href="{$href_base}governance.html#codeofconduct">the project code of conduct</a>
</div>
parser.add_argument("style", type=str, help="XSL stile file")
parser.add_argument("infile", type=str, help="path to source HTML file")
parser.add_argument("htmlfile", type=str, help="path to generated HTML file")
-parser.add_argument("pagesrc", type=str, help="path to source file used for edit this page")
+parser.add_argument("pagesrc", type=str, default="", nargs='?', help="(optional) path to source file used for edit this page")
args = parser.parse_args()
name = os.path.basename(args.htmlfile).replace('.html', '')