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

Template for displaying manpages in the Web UI #879

Closed
rdmark opened this issue Oct 1, 2022 · 6 comments
Closed

Template for displaying manpages in the Web UI #879

rdmark opened this issue Oct 1, 2022 · 6 comments
Assignees

Comments

@rdmark
Copy link
Member

rdmark commented Oct 1, 2022

Since we have a proven pattern for displaying terminal output in a Flask template, I think it'd be handy to show rascsi manpages. In particularly helpful for folks who aren't comfortable with the command line

@uweseimet
Copy link
Contributor

uweseimet commented Oct 1, 2022

@rdmark Just a personal opinion from someone who regularly uses the command line: If I am willing to use the command line, I am also willing to run 'man' in order to display the manpage in my console. Using a web UI for this while I am using the console anyway is IMHO not that helpful.
And somebody who is not comfortable with the command line would not need to read a manpage at all ;-).

@rdmark
Copy link
Member Author

rdmark commented Oct 1, 2022

@uweseimet Agreed that the rasctl manpage is not very useful if you don't use the command line. The main current use case that I see is that the rascsi manpage contains documentation about supported file extensions and what they're used for. Instead of maintaining effectively duplicated help text in the Web UI I want to refer to the manpage.

@rdmark
Copy link
Member Author

rdmark commented Oct 2, 2022

Here's my take on this #881
It reduces the maintenance overhead of the Web UI

@uweseimet
Copy link
Contributor

@rdmark I see. A better user experience might be to generate HTML from the raw manpage data. See https://linux.die.net/man/1/man2html. Not sure whether this is better, though.

@rdmark
Copy link
Member Author

rdmark commented Oct 3, 2022

@uweseimet Thanks for the lead with man2html. I experimented a bit with it. It general, it creates pretty good html. The challenge will be to use the output in the context of the Flask app. We need to render it inside a Flask template, so at the very least we need heuristics to strip the html/title/body tags, as well as the content header and footer.

As an MVP, I went ahead and used the contents of the generated txt manpage inside a <pre> tag. This works pretty well in modern browsers.

Let me keep experimenting with man2html and reopen this ticket if I find a better solution!

@rdmark rdmark closed this as completed Oct 3, 2022
@rdmark rdmark self-assigned this Oct 3, 2022
@rdmark
Copy link
Member Author

rdmark commented Oct 4, 2022

It was actually fairly easy to get man2html to output what we needed. :)

#887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants