Exemple #1
0
static int
mdoc_sx_pre(MDOC_ARGS)
{
	char	*id;

	id = html_make_id(n, 0);
	print_otag(h, TAG_A, "cThR", "Sx", id);
	free(id);
	return 1;
}
Exemple #2
0
static int
mdoc_ss_pre(MDOC_ARGS)
{
	char	*id;

	if (n->type != ROFFT_HEAD)
		return 1;

	id = html_make_id(n, 1);
	print_otag(h, TAG_H2, "cTi", "Ss", id);
	if (id != NULL)
		print_otag(h, TAG_A, "chR", "permalink", id);
	return 1;
}
Exemple #3
0
static int
man_SS_pre(MAN_ARGS)
{
	char	*id;

	if (n->type == ROFFT_HEAD) {
		id = html_make_id(n);
		print_otag(h, TAG_H2, "cTi", "Ss", id);
		if (id != NULL)
			print_otag(h, TAG_A, "chR", "selflink", id);
		free(id);
	}
	return 1;
}
Exemple #4
0
static char *
cond_id(const struct roff_node *n)
{
	if (n->child != NULL &&
	    n->child->type == ROFFT_TEXT &&
	    (n->prev == NULL ||
	     (n->prev->type == ROFFT_TEXT &&
	      strcmp(n->prev->string, "|") == 0)) &&
	    (n->parent->tok == MDOC_It ||
	     (n->parent->tok == MDOC_Xo &&
	      n->parent->parent->prev == NULL &&
	      n->parent->parent->parent->tok == MDOC_It)))
		return html_make_id(n, 1);
	return NULL;
}
Exemple #5
0
static int
mdoc_er_pre(MDOC_ARGS)
{
	char	*id;

	id = n->sec == SEC_ERRORS &&
	    (n->parent->tok == MDOC_It ||
	     (n->parent->tok == MDOC_Bq &&
	      n->parent->parent->parent->tok == MDOC_It)) ?
	    html_make_id(n, 1) : NULL;

	if (id != NULL)
		print_otag(h, TAG_A, "chR", "permalink", id);
	print_otag(h, TAG_CODE, "cTi", "Er", id);
	return 1;
}
Exemple #6
0
static int
mdoc_sh_pre(MDOC_ARGS)
{
	char	*id;

	switch (n->type) {
	case ROFFT_HEAD:
		id = html_make_id(n, 1);
		print_otag(h, TAG_H1, "cTi", "Sh", id);
		if (id != NULL)
			print_otag(h, TAG_A, "chR", "permalink", id);
		break;
	case ROFFT_BODY:
		if (n->sec == SEC_AUTHORS)
			h->flags &= ~(HTML_SPLIT|HTML_NOSPLIT);
		break;
	default:
		break;
	}
	return 1;
}