docs: build: Use proper path to file in 'contribute' link

NEWS.rst is based in the root of the repository and 'hvsupport.html'
doesn't have a backing file which can be edited since it's fully
generated. Our 'contribute -> edit this page' link on the bottom of the
page is wrong in those cases.

Fix it by adding the contribute section only when there's a source and
base the 'source' of a html file in the root of the repository.

Along with that we need to modify the scripts/meson-html-gen.py script
to accept optional 'pagesrc' and the XSL template to skip the
'contribute' section when we don't have a source.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa
2020-08-03 16:38:31 +02:00
parent 916e077551
commit 862cf2ace4
3 changed files with 13 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ parser.add_argument("timestamp", type=str, help="docs timestamp")
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', '')