Re: [AD] Documentation update |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Mon, 2005-09-26 at 21:21 +0200, Elias Pschernig wrote:
> Hm, yes. But if it's possible to change the HTML output to translate `'
> to '', it should be possible to do the opposite for PDF output, in
> makedoc. I'll have a look..
>
I think the enough patch would be enough. It translates "..." to `...'
for texi output. Just, there may be no more unmatched "" now (there's
one in allegro._tx, line 2004), else would need some heuristic to only
use " after space as opening quote, and before space as closing. That
would also make it work for '.
Also, if there's a way to stop the conversion inside code blocks, that
would be better.. but then, no fun trying to figure this out in the
current makedoc - so maybe better to wait after 4.2.0 and the Haskell
makedoc?
--
Elias Pschernig
Index: docs/src/makedoc/maketexi.c
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/makedoc/maketexi.c,v
retrieving revision 1.13
diff -u -p -r1.13 maketexi.c
--- docs/src/makedoc/maketexi.c 8 Sep 2005 15:20:05 -0000 1.13
+++ docs/src/makedoc/maketexi.c 27 Sep 2005 21:33:29 -0000
@@ -68,6 +68,7 @@ int write_texinfo(char *filename)
int continue_def = 0;
int title_pass = 0;
int in_chapter = 0;
+ int in_double_quote = 0;
int i = 0;
char up_target[256] = "Top";
FILE *f;
@@ -272,6 +273,27 @@ int write_texinfo(char *filename)
if (*p)
p++;
}
+ /* catch double quotes */
+ else if (p[0] == '"') {
+ p++;
+ if (in_double_quote) {
+ fputs("'", f);
+ in_double_quote = 0;
+ }
+ else {
+ fputs("`", f);
+ while ((*p) && (*p != '"')) {
+ fputc(*p, f);
+ p++;
+ }
+ if (*p) {
+ fputs("'", f);
+ p++;
+ }
+ else
+ in_double_quote = 1;
+ }
+ }
/* output other characters */
else {
if ((*p == '{') || (*p == '}') || (*p == '@'))