v doc: don't show 'pub' at the beginning

pull/3944/head
yuyi 2020-03-06 23:28:20 +08:00 committed by GitHub
parent db22bc579a
commit ed9075b937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -63,7 +63,7 @@ pub fn doc(mod string, table &table.Table) string {
} }
fn (d &Doc) get_fn_node(f ast.FnDecl) string { fn (d &Doc) get_fn_node(f ast.FnDecl) string {
return f.str(d.table).replace(d.mod + '.', '') return f.str(d.table).replace_each([d.mod + '.', '', 'pub ', ''])
} }
fn (d mut Doc) print_fns() { fn (d mut Doc) print_fns() {
@ -92,8 +92,9 @@ fn (d Doc) get_fn_signatures(filter_fn FilterFn) []string {
fn_signatures << d.get_fn_node(it) fn_signatures << d.get_fn_node(it)
} }
} }
else {} else {
} }
}
} }
fn_signatures.sort() fn_signatures.sort()
return fn_signatures return fn_signatures