SliTaz SliTaz Forum

You are not logged in.

#1 2015-12-17 21:38:46

llev
Member
Registered: 2011-12-09
Posts: 568

man & retawq

Hi,

I'm working on another revision of SliTaz's fake man, it will be faster to find relevant sections if they are not specified, and use a more complete source of man pages (linux.die.net).

I've come to wonder why, in order to display local html docs, we request retawq only to run [c]retawq --dump[/c], loosing all html markup & links... Since we're making a fake man, why not launch retawq for good if it is available?

Offline

#2 2015-12-18 10:35:21

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: man & retawq

Hi Lucas,

Retawq is nice and small. It gives good results when browsing linux.die.net man pages:

[c]retawq linux.die.net/man/1/ash[/c]
man-ash-in-retawq.png

The only problem for me: how to exit it?? :-D

Ctrl+Z ?

In other hand, retawq not supported UTF-8. Really? Yes.

We can use [c]man[/c] to read local documentation in HTML format:

[c]man tazpkg[/c]
man-tazpkg-in-retawq.png

Here, as I found from [c]/usr/share/man[/c] sources, HTML is dumped using retawq. The only problem here is: lines of text is half-filled because text is in UTF-8 and each Cyrillic symbol here takes two bytes.

Let's direct open that HTML page in retawq:

[c]retawq file:///usr/share/doc/tazpkg/tazpkg.ru.html[/c]
man-tazpkg-in-retawq2.png

Oh, no.

To summarize. The using of retawq is limited. You can use it to display English man pages from linux.die.net (but how to exit it?:)

But it is better not to use it everywhere in /usr/share/man.

Also, please take a look at my (weird) script in which I convert local HTML page to display it in the terminal:

[c]tazpkg -h gi[/c]
Regular expression is a "heart" of this script: http://hg.slitaz.org/tazpkg/file/879df9728956/modules/help#l140

Offline

#3 2015-12-18 16:02:32

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Re: man & retawq

Hi Aleksej,

The only problem for me: how to exit it??

Hit the M key -> opens the context menu.

Then select Quit :-D

EDIT: or uppercase Q

Offline

#4 2015-12-18 20:55:13

llev
Member
Registered: 2011-12-09
Posts: 568

Re: man & retawq

man-tazpkg-in-retawq2.png

Oh, no.

LOL!

OK, so if retawq is available I'll use it to display online manpages, otherwise just to dump text.

If it's not, I can use your regexp to translate HTML to text. For online pages, w3.org offers a translation service that's not bad: http://www.w3.org/services/html2txt .

Offline

#5 2015-12-18 23:19:44

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: man & retawq

smile

Note, regexp is far from ideal sad It not processes unordered lists (that I added to html later, after I finished to develop regexp):

[c]<ul>
  <li>...</li>
  <li>...</li>
</ul>[/c]
You can find the bug executing next command:

[c]tazpkg -h convert[/c]

Offline

#6 2015-12-19 11:43:09

llev
Member
Registered: 2011-12-09
Posts: 568

Re: man & retawq

Noted, but I'm not sure I'd be able to patch it, it's so complicated. Maybe a small list of the meaning of your control codes (A^H etc.) would help.

Offline

#7 2015-12-19 12:21:25

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: man & retawq

OK, I'll write a couple of lines in the README.devel.

PS: http://hg.slitaz.org/tazpkg/rev/bbc6b0a453a7

Offline

#8 2015-12-21 18:41:35

llev
Member
Registered: 2011-12-09
Posts: 568

Re: man & retawq

Hi Aleksej,

Very nice "couple" of lines! I see you support description lists, do you plan to use them in the doc? (I see none in tazpkg.html.)

Offline

#9 2015-12-24 00:40:06

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: man & retawq

Hi Lucas,

No, I planned it early.

We can use the same code to get command line help in other SliTaz tools where dl may be useful.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.026 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]