@@ -1066,24 +1066,34 @@ def document(filename, outfilebase):
10661066
10671067def make_manpage(fdir, fname):
10681068 # Conversion to manpage format required
1069- opts = [ " --doctype=manpage" ,
1070- " --destination-dir=" + fdir,
1071- " -a" , " mansource=LinuxCNC" ,
1072- " -a" , " manmanual=LinuxCNC Documentation" ]
10731069 try:
10741070 # Try asciidoctor
1075- opts += [ " --backend=manpage" ]
1076- subprocess.call([ " asciidoctor" ] + opts + [ fname] , stdout= subprocess.DEVNULL, stderr= subprocess.DEVNULL)
1071+ args = [ " asciidoctor" ,
1072+ " --doctype=manpage" ,
1073+ " --backend=manpage" ,
1074+ " --destination-dir=" + fdir,
1075+ " -a" , " mansource=LinuxCNC" ,
1076+ " -a" , " manmanual=LinuxCNC Documentation" ,
1077+ fname]
1078+ subprocess.call(args, stdout= subprocess.DEVNULL, stderr= subprocess.DEVNULL)
10771079 except:
10781080 try:
10791081 # Alternative, try a2x
1080- opts += [ " --format=manpage" , " --xsltproc-opts=--nonet" ]
1081- subprocess.call([ " a2x" ] + opts + [ fname] , stdout= subprocess.DEVNULL, stderr= subprocess.DEVNULL)
1082+ # opts += ["--format=manpage", "--xsltproc-opts=--nonet"]
1083+ args = [ " a2x" ,
1084+ " --doctype=manpage" ,
1085+ " --format=manpage" ,
1086+ " --destination-dir=" + fdir,
1087+ " --xsltproc-opts=--nonet" ,
1088+ " -a" , " mansource=LinuxCNC" ,
1089+ " -a" , " manmanual=LinuxCNC Documentation" ,
1090+ fname]
1091+ subprocess.call(args, stdout= subprocess.DEVNULL, stderr= subprocess.DEVNULL)
10821092 except:
10831093 raise SystemExit(" Error: Missing asciidoctor or a2x for adoc-to-manpage conversion or use --adoc for asciidoc file only" )
10841094
10851095 # We should have a file with the extension removed
1086- manfile = fname.removesuffix(" .adoc" )
1096+ manfile = os.path.join(fdir, os.path.basename( fname) .removesuffix(" .adoc" ) )
10871097 if not os.access(manfile, os.R_OK):
10881098 raise SystemExit(" Error: Manpage '%s ' not generated" % manfile)
10891099 return manfile
0 commit comments