Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-05-2024, 09:42 PM   #16
Kurler
Junior Member
Kurler began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2024
Device: none
Quote:
Originally Posted by ratinox View Post
groff uses mandoc underneath with the eponymous '-mandoc' switch.
No, “mandoc” is not the same thing as “groff -mandoc”. Both tools can convert manpages to HTML, but they are different programs written by different authors and produce different HTML. “groff -mandoc” refers to the input filetypes it supports (the two common manpage languages “man” and “mdoc”), as does the program name “mandoc,” but they’re not otherwise related. mandoc’s HTML is better quality, making it the tool of choice for this job.
Kurler is offline   Reply With Quote
Old 12-06-2024, 03:06 AM   #17
Shohreh
Addict
Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.Shohreh ought to be getting tired of karma fortunes by now.
 
Posts: 205
Karma: 304158
Join Date: Jan 2016
Location: France
Device: none
Quote:
Originally Posted by Kurler View Post
I recommend using the program “mandoc” (https://mandoc.bsd.lv/) to convert a manpage from source to HTML. It was designed from the start specifically as a manpage-to-HTML converter, so it does a better job of realizing semantics from the manpage, resulting in better quality HTML than pandoc or groff.
Thanks for the info. I'll try it next time.

Code:
mandoc -Thtml /usr/share/man/man1/ls.1.gz > ls.html
Turns out pandoc supports man pages too:
Code:
pandoc --from man --to html < input.1 > output.html
Shohreh is offline   Reply With Quote
Advert
Old 12-06-2024, 09:04 AM   #18
ratinox
Guru
ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.
 
Posts: 735
Karma: 10000000
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Mini
Quote:
Originally Posted by Kurler View Post
No, “mandoc” is not the same thing as “groff -mandoc”. Both tools can convert manpages to HTML, but they are different programs written by different authors and produce different HTML. “groff -mandoc” refers to the input filetypes it supports (the two common manpage languages “man” and “mdoc”), as does the program name “mandoc,” but they’re not otherwise related. mandoc’s HTML is better quality, making it the tool of choice for this job.
Are you sure about that? I was under the impression that groff uses the mandoc(1) program or code when the -mandoc switch is used. I do know that standalone mandoc on BSD is designed specifically and only for man pages where groff and other roff-alikes are general purpose markup parsers, so if groff isn't using mandoc(1) then that would be a reason for the differences.
ratinox is offline   Reply With Quote
Old 12-06-2024, 07:28 PM   #19
Kurler
Junior Member
Kurler began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2024
Device: none
Quote:
Originally Posted by ratinox View Post
Are you sure about that?
Yes, I am sure.
Quote:
Originally Posted by ratinox View Post
I was under the impression that groff uses the mandoc(1) program or code when the -mandoc switch is used.
That is incorrect. groff has been used for manpages since the early nineties, and the mandoc program was only created in 2008. But even current groff has never used mandoc in that way, or any way.
Quote:
Originally Posted by ratinox View Post
I do know that standalone mandoc on BSD is designed specifically and only for man pages where groff and other roff-alikes are general purpose markup parsers, so if groff isn't using mandoc(1) then that would be a reason for the differences.
Yes, this is reasonably accurate. To groff, the -mandoc switch is just like any of its other macro language switches like -ms or -mm; it loses track of the manpage semantics along the way which has a negative impact on its HTML.
Kurler is offline   Reply With Quote
Old 12-07-2024, 09:11 AM   #20
ratinox
Guru
ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.
 
Posts: 735
Karma: 10000000
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Mini
Cool. Thank you for the clarification.
ratinox is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert .pages to epub peaceridge Conversion 13 08-20-2024 09:54 AM
Convert ePub to Landscape PDF with facing pages derekvan Conversion 6 08-04-2018 09:43 AM
Convert PDF to EPub or LRF puts pages out of order Timber Conversion 3 12-29-2011 06:57 AM
Script to convert all system installed Man Pages to HTML rogerx Conversion 1 08-26-2011 08:12 AM


All times are GMT -4. The time now is 09:41 PM.


MobileRead.com is a privately owned, operated and funded community.