that can be searched for by apropos(1), such that you see the
semantic function in a tooltip when hovering with the mouse.
-/* $Id: html.c,v 1.207 2017/02/05 20:22:04 schwarze Exp $ */
+/* $Id: html.c,v 1.208 2017/03/13 19:01:38 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
print_byte(h, '=');
print_byte(h, '"');
switch (*fmt) {
print_byte(h, '=');
print_byte(h, '"');
switch (*fmt) {
- case 'M':
- print_href(h, arg1, arg2, 1);
- fmt++;
- break;
case 'I':
print_href(h, arg1, NULL, 0);
fmt++;
break;
case 'I':
print_href(h, arg1, NULL, 0);
fmt++;
break;
+ case 'M':
+ print_href(h, arg1, arg2, 1);
+ fmt++;
+ break;
case 'R':
print_byte(h, '#');
case 'R':
print_byte(h, '#');
+ print_encode(h, arg1, NULL, 1);
+ break;
+ case 'T':
+ print_encode(h, arg1, NULL, 1);
+ print_word(h, "\" title=\"");
+ print_encode(h, arg1, NULL, 1);
+ fmt++;
+ break;
default:
print_encode(h, arg1, NULL, 1);
break;
default:
print_encode(h, arg1, NULL, 1);
break;
-.\" $Id: mandoc_html.3,v 1.5 2017/01/28 22:36:38 schwarze Exp $
+.\" $Id: mandoc_html.3,v 1.6 2017/03/13 19:01:38 schwarze Exp $
.\"
.\" Copyright (c) 2014, 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\"
.\" Copyright (c) 2014, 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: January 28 2017 $
+.Dd $Mdocdate: March 13 2017 $
.Dt MANDOC_HTML 3
.Os
.Sh NAME
.Dt MANDOC_HTML 3
.Os
.Sh NAME
Print a
.Cm class
attribute.
Print a
.Cm class
attribute.
+This attribute letter can optionally be followed by the modifier letter
+.Cm T .
+In that case, a
+.Cm title
+attribute with the same value is also printed.
.It Cm h
Print a
.Cm href
.It Cm h
Print a
.Cm href
-/* $Id: mdoc_html.c,v 1.273 2017/03/03 13:55:31 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.274 2017/03/13 19:01:38 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
switch (n->type) {
case ROFFT_HEAD:
id = make_id(n);
switch (n->type) {
case ROFFT_HEAD:
id = make_id(n);
- print_otag(h, TAG_H1, "ci", "Sh", id);
+ print_otag(h, TAG_H1, "cTi", "Sh", id);
free(id);
break;
case ROFFT_BODY:
free(id);
break;
case ROFFT_BODY:
return 1;
id = make_id(n);
return 1;
id = make_id(n);
- print_otag(h, TAG_H2, "ci", "Ss", id);
+ print_otag(h, TAG_H2, "cTi", "Ss", id);
static int
mdoc_fl_pre(MDOC_ARGS)
{
static int
mdoc_fl_pre(MDOC_ARGS)
{
- print_otag(h, TAG_B, "c", "Fl");
+ print_otag(h, TAG_B, "cT", "Fl");
print_text(h, "\\-");
if (!(n->child == NULL &&
print_text(h, "\\-");
if (!(n->child == NULL &&
static int
mdoc_cm_pre(MDOC_ARGS)
{
static int
mdoc_cm_pre(MDOC_ARGS)
{
- print_otag(h, TAG_B, "c", "Cm");
+ print_otag(h, TAG_B, "cT", "Cm");
/* XXX: this tag in theory can contain block elements. */
print_text(h, "\\(em");
/* XXX: this tag in theory can contain block elements. */
print_text(h, "\\(em");
- print_otag(h, TAG_SPAN, "c", "Nd");
+ print_otag(h, TAG_SPAN, "cT", "Nd");
print_otag(h, TAG_TD, "");
/* FALLTHROUGH */
case ROFFT_ELEM:
print_otag(h, TAG_TD, "");
/* FALLTHROUGH */
case ROFFT_ELEM:
- print_otag(h, TAG_B, "c", "Nm");
+ print_otag(h, TAG_B, "cT", "Nm");
return 1;
case ROFFT_BODY:
print_otag(h, TAG_TD, "");
return 1;
case ROFFT_BODY:
print_otag(h, TAG_TD, "");
return 0;
if (h->base_man)
return 0;
if (h->base_man)
- print_otag(h, TAG_A, "chM", "Xr",
+ print_otag(h, TAG_A, "cThM", "Xr",
n->child->string, n->child->next == NULL ?
NULL : n->child->next->string);
else
n->child->string, n->child->next == NULL ?
NULL : n->child->next->string);
else
- print_otag(h, TAG_A, "c", "Xr");
+ print_otag(h, TAG_A, "cT", "Xr");
n = n->child;
print_text(h, n->string);
n = n->child;
print_text(h, n->string);
static int
mdoc_ar_pre(MDOC_ARGS)
{
static int
mdoc_ar_pre(MDOC_ARGS)
{
- print_otag(h, TAG_VAR, "c", "Ar");
+ print_otag(h, TAG_VAR, "cT", "Ar");
static int
mdoc_st_pre(MDOC_ARGS)
{
static int
mdoc_st_pre(MDOC_ARGS)
{
- print_otag(h, TAG_SPAN, "c", "St");
+ print_otag(h, TAG_SPAN, "cT", "St");
return 1;
}
static int
mdoc_em_pre(MDOC_ARGS)
{
return 1;
}
static int
mdoc_em_pre(MDOC_ARGS)
{
- print_otag(h, TAG_I, "c", "Em");
+ print_otag(h, TAG_I, "cT", "Em");
char *id;
id = make_id(n);
char *id;
id = make_id(n);
- print_otag(h, TAG_A, "chR", "Sx", id);
+ print_otag(h, TAG_A, "cThR", "Sx", id);
static int
mdoc_pa_pre(MDOC_ARGS)
{
static int
mdoc_pa_pre(MDOC_ARGS)
{
- print_otag(h, TAG_I, "c", "Pa");
+ print_otag(h, TAG_I, "cT", "Pa");
if (n->sec == SEC_AUTHORS && ! (h->flags & HTML_NOSPLIT))
h->flags |= HTML_SPLIT;
if (n->sec == SEC_AUTHORS && ! (h->flags & HTML_NOSPLIT))
h->flags |= HTML_SPLIT;
- print_otag(h, TAG_SPAN, "c", "An");
+ print_otag(h, TAG_SPAN, "cT", "An");
mdoc_cd_pre(MDOC_ARGS)
{
synopsis_pre(h, n);
mdoc_cd_pre(MDOC_ARGS)
{
synopsis_pre(h, n);
- print_otag(h, TAG_B, "c", "Cd");
+ print_otag(h, TAG_B, "cT", "Cd");
return 1;
}
static int
mdoc_dv_pre(MDOC_ARGS)
{
return 1;
}
static int
mdoc_dv_pre(MDOC_ARGS)
{
- print_otag(h, TAG_CODE, "c", "Dv");
+ print_otag(h, TAG_CODE, "cT", "Dv");
return 1;
}
static int
mdoc_ev_pre(MDOC_ARGS)
{
return 1;
}
static int
mdoc_ev_pre(MDOC_ARGS)
{
- print_otag(h, TAG_CODE, "c", "Ev");
+ print_otag(h, TAG_CODE, "cT", "Ev");
return 1;
}
static int
mdoc_er_pre(MDOC_ARGS)
{
return 1;
}
static int
mdoc_er_pre(MDOC_ARGS)
{
- print_otag(h, TAG_CODE, "c", "Er");
+ print_otag(h, TAG_CODE, "cT", "Er");
struct tag *t;
if (n->parent->tok != MDOC_Fo) {
struct tag *t;
if (n->parent->tok != MDOC_Fo) {
- print_otag(h, TAG_VAR, "c", "Fa");
+ print_otag(h, TAG_VAR, "cT", "Fa");
return 1;
}
for (nn = n->child; nn; nn = nn->next) {
return 1;
}
for (nn = n->child; nn; nn = nn->next) {
- t = print_otag(h, TAG_VAR, "c", "Fa");
+ t = print_otag(h, TAG_VAR, "cT", "Fa");
print_text(h, nn->string);
print_tagq(h, t);
if (nn->next) {
print_text(h, nn->string);
print_tagq(h, t);
if (nn->next) {
assert(n->type == ROFFT_TEXT);
if (strcmp(n->string, "#include")) {
assert(n->type == ROFFT_TEXT);
if (strcmp(n->string, "#include")) {
- print_otag(h, TAG_B, "c", "Fd");
+ print_otag(h, TAG_B, "cT", "Fd");
- print_otag(h, TAG_B, "c", "In");
+ print_otag(h, TAG_B, "cT", "In");
print_text(h, n->string);
if (NULL != (n = n->next)) {
print_text(h, n->string);
if (NULL != (n = n->next)) {
cp = strchr(buf, '\0') - 1;
if (cp >= buf && (*cp == '>' || *cp == '"'))
*cp = '\0';
cp = strchr(buf, '\0') - 1;
if (cp >= buf && (*cp == '>' || *cp == '"'))
*cp = '\0';
- t = print_otag(h, TAG_A, "chI", "In", buf);
+ t = print_otag(h, TAG_A, "cThI", "In", buf);
- t = print_otag(h, TAG_A, "c", "In");
+ t = print_otag(h, TAG_A, "cT", "In");
print_text(h, n->string);
print_tagq(h, t);
print_text(h, n->string);
print_tagq(h, t);
} else if (n->type == ROFFT_HEAD)
return 0;
} else if (n->type == ROFFT_HEAD)
return 0;
- print_otag(h, TAG_VAR, "c", "Vt");
+ print_otag(h, TAG_VAR, "cT", "Vt");
mdoc_ft_pre(MDOC_ARGS)
{
synopsis_pre(h, n);
mdoc_ft_pre(MDOC_ARGS)
{
synopsis_pre(h, n);
- print_otag(h, TAG_VAR, "c", "Ft");
+ print_otag(h, TAG_VAR, "cT", "Ft");
ep = strchr(sp, ' ');
if (NULL != ep) {
ep = strchr(sp, ' ');
if (NULL != ep) {
- t = print_otag(h, TAG_VAR, "c", "Ft");
+ t = print_otag(h, TAG_VAR, "cT", "Ft");
while (ep) {
sz = MIN((int)(ep - sp), BUFSIZ - 1);
while (ep) {
sz = MIN((int)(ep - sp), BUFSIZ - 1);
- t = print_otag(h, TAG_B, "c", "Fn");
+ t = print_otag(h, TAG_B, "cT", "Fn");
if (sp)
print_text(h, sp);
if (sp)
print_text(h, sp);
for (n = n->child->next; n; n = n->next) {
if (NODE_SYNPRETTY & n->flags)
for (n = n->child->next; n; n = n->next) {
if (NODE_SYNPRETTY & n->flags)
- t = print_otag(h, TAG_VAR, "css?", "Fa",
+ t = print_otag(h, TAG_VAR, "cTss?", "Fa",
"white-space", "nowrap");
else
"white-space", "nowrap");
else
- t = print_otag(h, TAG_VAR, "c", "Fa");
+ t = print_otag(h, TAG_VAR, "cT", "Fa");
print_text(h, n->string);
print_tagq(h, t);
if (n->next) {
print_text(h, n->string);
print_tagq(h, t);
if (n->next) {
assert(n->type == ROFFT_TEXT);
assert(n->type == ROFFT_TEXT);
- print_otag(h, TAG_A, "ch", "Lk", n->string);
+ print_otag(h, TAG_A, "cTh", "Lk", n->string);
if (NULL == n->next)
print_text(h, n->string);
if (NULL == n->next)
print_text(h, n->string);
assert(n->type == ROFFT_TEXT);
mandoc_asprintf(&cp, "mailto:%s", n->string);
assert(n->type == ROFFT_TEXT);
mandoc_asprintf(&cp, "mailto:%s", n->string);
- t = print_otag(h, TAG_A, "ch", "Mt", cp);
+ t = print_otag(h, TAG_A, "cTh", "Mt", cp);
print_text(h, n->string);
print_tagq(h, t);
free(cp);
print_text(h, n->string);
print_tagq(h, t);
free(cp);
return 0;
assert(n->child->string);
return 0;
assert(n->child->string);
- t = print_otag(h, TAG_B, "c", "Fn");
+ t = print_otag(h, TAG_B, "cT", "Fn");
print_text(h, n->child->string);
print_tagq(h, t);
return 0;
print_text(h, n->child->string);
print_tagq(h, t);
return 0;
struct tag *t;
synopsis_pre(h, n);
struct tag *t;
synopsis_pre(h, n);
- print_otag(h, TAG_B, "c", "In");
+ print_otag(h, TAG_B, "cT", "In");
/*
* The first argument of the `In' gets special treatment as
/*
* The first argument of the `In' gets special treatment as
assert(n->type == ROFFT_TEXT);
if (h->base_includes)
assert(n->type == ROFFT_TEXT);
if (h->base_includes)
- t = print_otag(h, TAG_A, "chI", "In", n->string);
+ t = print_otag(h, TAG_A, "cThI", "In", n->string);
- t = print_otag(h, TAG_A, "c", "In");
+ t = print_otag(h, TAG_A, "cT", "In");
print_text(h, n->string);
print_tagq(h, t);
print_text(h, n->string);
print_tagq(h, t);
static int
mdoc_ic_pre(MDOC_ARGS)
{
static int
mdoc_ic_pre(MDOC_ARGS)
{
- print_otag(h, TAG_B, "c", "Ic");
+ print_otag(h, TAG_B, "cT", "Ic");
return 1;
}
static int
mdoc_va_pre(MDOC_ARGS)
{
return 1;
}
static int
mdoc_va_pre(MDOC_ARGS)
{
- print_otag(h, TAG_VAR, "c", "Va");
+ print_otag(h, TAG_VAR, "cT", "Va");
static int
mdoc_ms_pre(MDOC_ARGS)
{
static int
mdoc_ms_pre(MDOC_ARGS)
{
- print_otag(h, TAG_B, "c", "Ms");
+ print_otag(h, TAG_B, "cT", "Ms");
if (n->prev && SEC_SEE_ALSO == n->sec)
print_paragraph(h);
if (n->prev && SEC_SEE_ALSO == n->sec)
print_paragraph(h);
- print_otag(h, TAG_CITE, "c", "Rs");
+ print_otag(h, TAG_CITE, "cT", "Rs");
static int
mdoc_sy_pre(MDOC_ARGS)
{
static int
mdoc_sy_pre(MDOC_ARGS)
{
- print_otag(h, TAG_B, "c", "Sy");
+ print_otag(h, TAG_B, "cT", "Sy");
if (SEC_LIBRARY == n->sec && NODE_LINE & n->flags && n->prev)
print_otag(h, TAG_BR, "");
if (SEC_LIBRARY == n->sec && NODE_LINE & n->flags && n->prev)
print_otag(h, TAG_BR, "");
- print_otag(h, TAG_SPAN, "c", "Lb");
+ print_otag(h, TAG_SPAN, "cT", "Lb");