Afficher un message
Vieux 03/07/2008, 14h39   #2
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: conversion ascii => texte formaté

2008-07-3, 05:07(-07), Gamotte:
> Bonjour,
>
> J'ai un fichier ascii que je voudrais imprimer en rajoutant
> quelques formatages pour améliorer la lisibilité. Par exemple,
> je voudrais que les mots délimités par deux * (ou autre marque
> de formatage) soient mis en gras.
> Je cherche donc une commande qui me permettrait de convertir
> les fichiers textes en prenant en compte des tags simples de mise
> en forme avec pour contrainte que la longueur des lignes et les
> indentations soient strictement respectées. Le format du fichier
> final
> importe peu.

[...]

$ echo '\ttest *foo* bar' | txt2html --preserve_indent
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta name="generator" content="HTML::TextToHTML v2.51"/>
</head>
<body>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;test <em>foo</em> bar</p>

</body>
</html>


~$ apt-cache show txt2html txt2tags txt2man
Package: txt2html
Priority: optional
Section: text
Installed-Size: 296
Maintainer: Varun Hiremath <varun@debian.org>
Architecture: all
Version: 2.51-1
Depends: perl (>= 5.6.0-16), libgetopt-argvfile-perl, libyaml-syck-perl
Suggests: perl-doc
Filename: pool/main/t/txt2html/txt2html_2.51-1_all.deb
Size: 91494
MD5sum: b50cf92a3d3c0377c64b1f354f2cb6f7
SHA1: 89b9e40f48124f935e7bfb86b1a9508ced1a7b77
SHA256: 1adb754e5a9dbdeb95bec88776c81bb2e24350990b39b3fb67 2fe95a66d72e94
Description: Text to HTML converter
txt2html is a Perl program that converts plain text to HTML.
  Réponse avec citation
 
Page generated in 0,05079 seconds with 9 queries