source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* docbook2mdoc: There is no need to ever use the eqn(7) inline syntax
@ 2019-04-12 11:37 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-04-12 11:37 UTC (permalink / raw)
  To: source

Log Message:
-----------
There is no need to ever use the eqn(7) inline syntax ($$):
Its purpose it to inline eqn(7) source code in the *input* file.
On the *output* side, equations are inlined by default.
To display them, the .EQ block needs to be wrapped in .Bd.
This patch gets rid of another user of "sv".

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c
        node.h
        parse.c

Revision Data
-------------
Index: parse.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/parse.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -Lparse.c -Lparse.c -u -p -r1.37 -r1.38
--- parse.c
+++ parse.c
@@ -558,9 +558,6 @@ xml_elem_start(struct parse *p, const ch
 		/* FALLTHROUGH */
 	case NODE_IGNORE:
 		return;
-	case NODE_INLINEEQUATION:
-		p->tree->flags |= TREE_EQN;
-		break;
 	default:
 		break;
 	}
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.110 -r1.111
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -657,12 +657,6 @@ pnode_printprologue(struct format *f, st
 	} else
 		pnode_printrefmeta(f, refmeta);
 	macro_line(f, "Os");
-
-	if (tree->flags & TREE_EQN) {
-		macro_line(f, "EQ");
-		print_text(f, "delim $$", 0);
-		macro_line(f, "EN");
-	}
 }
 
 /*
@@ -910,12 +904,10 @@ pnode_print(struct format *f, struct pno
 		macro_open(f, "Fd");
 		break;
 	case NODE_INFORMALEQUATION:
-		macro_line(f, "EQ");
-		break;
+		macro_line(f, "Bd -ragged -offset indent");
+		/* FALLTHROUGH */
 	case NODE_INLINEEQUATION:
-		if (f->linestate == LINE_NEW)
-			f->linestate = LINE_TEXT;
-		putchar('$');
+		macro_line(f, "EQ");
 		break;
 	case NODE_ITEMIZEDLIST:
 		pnode_printlist(f, n);
@@ -1054,10 +1046,10 @@ pnode_print(struct format *f, struct pno
 		return;
 	case NODE_INFORMALEQUATION:
 		macro_line(f, "EN");
+		macro_line(f, "Ed");
 		break;
 	case NODE_INLINEEQUATION:
-		fputs("$ ", stdout);
-		f->linestate = sv;
+		macro_line(f, "EN");
 		break;
 	case NODE_MEMBER:
 		if ((nn = TAILQ_NEXT(n, child)) != NULL &&
Index: node.h
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -Lnode.h -Lnode.h -u -p -r1.18 -r1.19
--- node.h
+++ node.h
@@ -222,7 +222,6 @@ struct	ptree {
 	int		 flags;
 #define	TREE_ERROR	 (1 << 0)  /* A parse error occurred. */
 #define	TREE_WARN	 (1 << 1)  /* A parser warning occurred. */
-#define	TREE_EQN	 (1 << 2)  /* The document needs inline eqn(7). */
 #define	TREE_CLOSED	 (1 << 3)  /* The document element was closed. */
 };
 
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-12 11:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-12 11:37 docbook2mdoc: There is no need to ever use the eqn(7) inline syntax schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).