From d9e74cd03217773097de0be523bacaf301db426d Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 25 Jun 2018 13:01:19 +0000 Subject: For -man -Thtml, ignore author-specified .HP widths because they harm responsive design; use @media-dependent defaults instead. --- man_html.c | 21 +++++---------------- mandoc.css | 7 ++++++- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/man_html.c b/man_html.c index 90f45528..85135aba 100644 --- a/man_html.c +++ b/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.150 2018/05/25 20:23:51 schwarze Exp $ */ +/* $Id: man_html.c,v 1.151 2018/06/25 13:01:19 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze @@ -557,24 +557,13 @@ man_IP_pre(MAN_ARGS) static int man_HP_pre(MAN_ARGS) { - struct roffsu sum, sui; - const struct roff_node *np; - if (n->type == ROFFT_HEAD) return 0; - else if (n->type != ROFFT_BLOCK) - return 1; - - np = n->head->child; - - if (np == NULL || !a2width(np, &sum)) - SCALE_HS_INIT(&sum, INDENT); - sui.unit = sum.unit; - sui.scale = -sum.scale; - - print_bvspace(h, n); - print_otag(h, TAG_DIV, "csului", "Pp", &sum, &sui); + if (n->type == ROFFT_BLOCK) { + print_bvspace(h, n); + print_otag(h, TAG_DIV, "c", "HP"); + } return 1; } diff --git a/mandoc.css b/mandoc.css index 29e47445..4c1d5610 100644 --- a/mandoc.css +++ b/mandoc.css @@ -1,4 +1,4 @@ -/* $Id: mandoc.css,v 1.33 2018/06/10 16:15:43 schwarze Exp $ */ +/* $Id: mandoc.css,v 1.34 2018/06/25 13:01:19 schwarze Exp $ */ /* * Standard style sheet for mandoc(1) -Thtml and man.cgi(8). */ @@ -153,6 +153,9 @@ table.Bl-compact > tbody > tr > td { .eqn { } .tbl { } +.HP { margin-left: 3.8em; + text-indent: -3.8em; } + /* Semantic markup for command line utilities. */ table.Nm { } @@ -245,4 +248,6 @@ dl.Bl-hang > dd { dl.Bl-tag { margin-left: 2em; } dl.Bl-tag > dt { margin-left: -2em; } +.HP { margin-left: 2em; + text-indent: -2em; } } -- cgit v1.2.3-56-ge451