Add capabilities to get and render manpage output in the Web UI (#881)

- class method to get arbitrary file contents
- new web UI endpoint to fetch the contents of rascsi man pages (rendered txt files)
- Link to manpage in page footer
- Link to new wiki page for image type docs
- Other UI tweaks
This commit is contained in:
Daniel Markstedt
2022-10-03 12:46:18 -07:00
committed by GitHub
parent fd47411322
commit dcb4b33f2e
6 changed files with 76 additions and 12 deletions
+12
View File
@@ -181,3 +181,15 @@ class SysCmds:
return process.returncode, process.stdout.decode("utf-8")
return process.returncode, process.stderr.decode("utf-8")
@staticmethod
def get_filecontents(file_path):
"""
Takes (str) file_path, with the path to the file to fetch the contents of.
Returns either the file contents, or the exception error.
"""
try:
with open(file_path) as file:
return 0, file.read()
except Exception as error:
return 1, error