summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-12 22:24:33 -0500
committerJune McEnroe <june@causal.agency>2021-01-12 22:24:33 -0500
commite673ea6deaee59a72c8861a67b10489703f75c61 (patch)
tree680f1a9e5b026283ed0f9f4e6fd4f4cf726bb249
parentMove hilex out of hilex directory (diff)
downloadsrc-e673ea6deaee59a72c8861a67b10489703f75c61.tar.gz
src-e673ea6deaee59a72c8861a67b10489703f75c61.zip
Don't output a pre in hilex by default
Diffstat (limited to '')
-rw-r--r--bin/hilex.c7
-rw-r--r--bin/man1/hilex.146
2 files changed, 25 insertions, 28 deletions
diff --git a/bin/hilex.c b/bin/hilex.c
index d9b747cc..e91442f6 100644
--- a/bin/hilex.c
+++ b/bin/hilex.c
@@ -71,6 +71,7 @@ static const struct Lexer *matchLexer(const char *name) {
 	X(Document, "document") \
 	X(Inline, "inline") \
 	X(Monospace, "monospace") \
+	X(Pre, "pre") \
 	X(Style, "style") \
 	X(Tab, "tab") \
 	X(Title, "title")
@@ -207,17 +208,17 @@ static void htmlHeader(const char *opts[]) {
 	}
 
 body:
-	if (opts[Inline] && opts[Tab]) {
+	if ((opts[Document] || opts[Pre]) && opts[Inline] && opts[Tab]) {
 		printf("<pre class=\"hilex\" style=\"");
 		styleTabSize(opts[Tab]);
 		printf("\">");
-	} else {
+	} else if (opts[Document] || opts[Pre]) {
 		printf("<pre class=\"hilex\">");
 	}
 }
 
 static void htmlFooter(const char *opts[]) {
-	printf("</pre>");
+	if (opts[Document] || opts[Pre]) printf("</pre>");
 	if (opts[Document]) printf("\n");
 }
 
diff --git a/bin/man1/hilex.1 b/bin/man1/hilex.1
index 858c8565..aec57860 100644
--- a/bin/man1/hilex.1
+++ b/bin/man1/hilex.1
@@ -67,11 +67,8 @@ Output ANSI terminal control sequences.
 .
 .It Cm html
 Output HTML
-.Sy <span>
-elements
-within a
-.Sy <pre>
-element.
+.Sy span
+elements.
 Each element has the classes
 .Sy hilex
 and one of the following:
@@ -89,43 +86,42 @@ and one of the following:
 .Pp
 The options are as follows:
 .Bl -tag -width "title=..."
+.It Cm document
+Output an HTML document containing a
+.Sy pre
+element.
+.It Cm inline
+Output inline style attributes
+rather than classes.
+.It Cm pre
+Wrap the output in a
+.Sy pre
+element with the class
+.Sy hilex .
 .It Cm style Ns = Ns Ar url
 With
 .Cm document ,
-output a
-.Sy <link>
-element for the external stylesheet
+use the external stylesheet
 .Ar url .
 If unset,
-output default styles in a
-.Sy <style>
-element.
-.
-.It Cm document
-Output an HTML document containing the
-.Sy <pre>
-element.
-.
-.It Cm inline
-Output inline
+default styles are included in a
 .Sy style
-attributes rather than classes.
-.
+element.
 .It Cm tab Ns = Ns Ar n
 With
-.Cm document
+.Cm document ,
+.Cm inline
 or
-.Cm inline ,
+.Cm pre ,
 set the
 .Sy tab-size
 property to
 .Ar n .
-.
 .It Cm title Ns = Ns Ar ...
 With
 .Cm document ,
 set the
-.Sy <title>
+.Sy title
 element text.
 The default title is the same as
 .Ar name .
ight'> 2022-08-15Allow names with prefixes of months and daysJune McEnroe 2022-08-15Add named dates to whenJune McEnroe 2022-08-14Remove tweets text fileJune McEnroe Such link rot. 2022-08-04Add Conversations With FriendsJune McEnroe The better of the two, but largely the same. I feel like these books are a bit too autobiographical, but I don't know if I'm allowed to accuse an author of that. My real problem is that I read these books as largely uncritical of their characters. They behave in nonsense ways, are mostly uncritical of their own behaviour, and don't really have arcs of growth or change. I suppose this book had a bit of one, but only in the last two chapters. 2022-07-30Add Normal PeopleJune McEnroe Unbearably straight. Eyerolls and sighs per page off the charts. Shout out to Joanna, I guess. I kinda like the lack of quotation marks though to be honest. After half of the Ruth Ozeki novel and now this, I need to get back to some genre fiction. 2022-07-26Rewrite glitch from new pngoJune McEnroe 2022-07-26Update Care with time-to-ID and piercingsJune McEnroe 2022-07-26Add -w to upJune McEnroe 2022-07-13Set push.autoSetupRemoteJune McEnroe 2022-07-08Remove TOURJune McEnroe There is not that much distinct stuff here anymore. 2022-07-03Add The Bone Shard EmperorJune McEnroe Suffers a little bit from middle book but I really enjoyed it. Read it faster than the first one too, despite its length. 2022-06-25Bump xterm font size to 12June McEnroe 2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe Mixed bag like most collections of short stories. Some of them are pretty good. The author of the worst written story also has the worst written bio. 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe Absolutely indiscriminately. 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe