
Estou tentando usar o pandoc (se alguém tiver um programa de conversão melhor, sou todo ouvidos, por favor, não dependo de Ruby) para converter arquivos markdown em páginas de manual. Funciona bem até eu fazer um documento com uma mesa. Aqui está meu documento de teste:
% Author Man
% TEST(1) This is a test | Version .01
% 18-April-2016
# Header1
# Format
foo
+-----------+-----------+-----------+
| linenum-1 | two | three |
|===========+===========+===========+
| three | four | fove |
| 6 | 7 | 8 |
+-----------+-----------+-----------+
| linenum-1 | two | three |
|-----------|-----------|-----------|
| three | four | fove |
| 6 | 7 | 8 |
| linenum-1 | two | three
|-----------|-----------|--------:
| three | four | fove
| 6 | 7 | 8
I WAS HERE
| linenum-1 | two | three
|--- |--- |---
| three | four | fove
| 6 | 7 | 8
here is some text
_italics_
**bold**
eu estava usando
pandoc.exe -s -f markdown -t man ~/test.md | man -p t -l -
(tentei com e sem -p t
forçar o tbl
pré-processador) com o mesmo resultado:
Author Man() Author Man()
Header1
Format
foo
tab(@); lw(11.7n) lw(11.7n) lw(11.7n). T{
linenum-1 ===========+ three 6 T}@T{
two ===========+ four 7 T}@T{
three ===========+ fove 8 T}
tab(@); l l l. T{ linenum-1 T}@T{ two T}@T{ three T} _ T{ three T}@T{ four T}@T{ fove T}
T{ 6 T}@T{ 7 T}@T{ 8 T}
tab(@); l l r. T{ linenum-1 T}@T{ two T}@T{ three T} _ T{ three T}@T{ four T}@T{ fove T}
T{ 6 T}@T{ 7 T}@T{ 8 T}
I WAS HERE
tab(@); l l l. T{ linenum-1 T}@T{ two T}@T{ three T} _ T{ three T}@T{ four T}@T{ fove T}
T{ 6 T}@T{ 7 T}@T{ 8 T}
here is some text
italics
bold
AUTHORS
TEST(1) This is a test | Version .01.
18-April-2016 Author Man()
A saída bruta sem canalizá-la man
é:
.\"t
.\" Automatically generated by Pandoc 1.17.0.2
.\"
.TH "Author Man" "" "18\-April\-2016" "" ""
.hy
.SH Header1
.SH Format
.PP
foo
.PP
.TS
tab(@);
lw(11.7n) lw(11.7n) lw(11.7n).
T{
.PP
linenum\-1 ===========+ three 6
T}@T{
.PP
two ===========+ four 7
T}@T{
.PP
three ===========+ fove 8
T}
.TE
.PP
.TS
tab(@);
l l l.
T{
linenum\-1
T}@T{
two
T}@T{
three
T}
_
T{
three
T}@T{
four
T}@T{
fove
T}
T{
6
T}@T{
7
T}@T{
8
T}
.TE
.PP
.TS
tab(@);
l l r.
T{
linenum\-1
T}@T{
two
T}@T{
three
T}
_
T{
three
T}@T{
four
T}@T{
fove
T}
T{
6
T}@T{
7
T}@T{
8
T}
.TE
.PP
I WAS HERE
.PP
.TS
tab(@);
l l l.
T{
linenum\-1
T}@T{
two
T}@T{
three
T}
_
T{
three
T}@T{
four
T}@T{
fove
T}
T{
6
T}@T{
7
T}@T{
8
T}
.TE
.PP
here is some text
.PP
\f[I]italics\f[]
.PP
\f[B]bold\f[]
.SH AUTHORS
TEST(1) This is a test | Version .01.
Com a -d
bandeira recebo muito, mas apenas a última parte parece aplicável:
final search path = /mingw64/share/man:/usr/share/man
restore_cwd: 3 (null)
pre-processors `t' from command line
page_encoding = UTF-8
source_encoding = ISO-8859-1
roff_encoding = ISO-8859-1
Terminal width 102
Terminal width 102 not within cat page range [80, 80]
formatted_encoding = UTF-8
opening -
opened -
E a parte divertida...
Pandoc na minha caixa debian 8.3 gerou a mesma saída, mas as páginas de manual exibem isso bem no debian/linux.
Para uma comparação
janelas
- pandoc.exe 1.17.0.2
- homem 2.7.4
- GNU tbl (groff) versão 1.22.3
linux
- pandoc 1.12.4.2 [linux]
- homem 2.7.0.2
Estou lendo man man
man groff_man
man tbl
etc há horas e não estou mais perto de resolver isso. Qualquer ideia aqui seria MUITO apreciada!!
Obrigado -Eric
Editar - 1
O problema é sem dúvida man
o sistema associado groff
no Windows/msys. A saída pandoc funciona bem no Linux.
Encontrei e tentei um programa de renderização alternativo:
http://embedeo.org/ws/doc/man_windows/
O que não tem problema em exibir a saída do pandoc com o formato
mandoc.exe foo.man.1 | less
Tentando novamente uma abordagem mais direta
cat foo.man.1 | nroff -mandoc -Tlatin1 | less
Tem exatamente o mesmo efeito que chamarman -l -
Tentei então baixar os binários gnuwin32 diretamente e obtive o mesmo resultado novamente
cat foo.man.1 | Downloads/groff-1.20.1-bin/bin/nroff -mandoc -Tlatin1 | less
Responder1
Bem, aparentemente estou um pouco lento esta semana...
a solução mais simples imaginável e perdi apenas 3 dias:
pandoc.exe -s -f markdown -t man ~/test.md | dos2unix.exe | man -l -
(a chave é a introdução dedos2unix.exe
na mistura)
Rende um lindo:
Author Man() Author Man()
Header1
Format
foo
linenum-1 two three
===========+ ===========+ ===========+
three four fove
6 7 8
linenum-1 two three
─────────────────────────
three four fove
6 7 8
linenum-1 two three
─────────────────────────
three four fove
6 7 8
I WAS HERE
linenum-1 two three
─────────────────────────
three four fove
6 7 8
here is some text
italics
bold
AUTHORS
TEST(1) This is a test | Version .01.
18-April-2016 Author Man()