Exemple #1
0
func (f *txtFmt) wrText(e *Elem) {
	if e == nil {
		return
	}
	if e.Nb != "" && !cliveMan {
		f.printPar(e.Nb, " ")
	}
	switch e.Kind {
	case Kurl:
		toks := strings.SplitN(e.Data, "|", 2)
		if len(toks) == 1 {
			e.Data = "[" + e.Data + "]"
		} else {
			e.Data = toks[0] + " [" + toks[1] + "]"
		}
	case Kcite:
		rg, _ := sre.Match(mrexp, e.Data)
		if len(rg) == 3 {
			break
		}
		fallthrough
	case Kbib:
		e.Data = "[" + e.Data + "]"
	case Kcref, Keref, Ktref, Kfref, Ksref:
	}
	f.printPar(e.Data)
	for _, c := range e.Textchild {
		f.wrText(c)
	}
}
Exemple #2
0
func (f *htmlFmt) citeMan(cite string) bool {
	rg, _ := sre.Match(mrexp, cite)
	if len(rg) < 3 {
		return false
	}
	pg := rg[1]
	sec := rg[2]
	f.printParCmd(`<a href="`+ MAN + `/` + sec+`/`+pg+`.html">`+cite+`</a>`)
	return true
}