mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Various api doc related fixes and cleanups
This commit is contained in:
parent
c7022f50e9
commit
686166d5e6
@ -95,7 +95,8 @@ api/$(2).txt: $(1)
|
|||||||
API_TXT += api/$(2).txt
|
API_TXT += api/$(2).txt
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(foreach api,$(API),$(eval $(call api_doc,$(api),$(shell sed -n 's/.*API Doc\s*::\s*\([^ ]*\).*/\1/p' < $(api)),)))
|
api_name = $(shell sed -n 's/.*API Doc\s*::\s*\([^ ]*\).*/\1/p' < $(1))
|
||||||
|
$(foreach api,$(API),$(eval $(call api_doc,$(api),$(call api_name,$(api)))))
|
||||||
|
|
||||||
|
|
||||||
## Se the default doc rules
|
## Se the default doc rules
|
||||||
@ -167,11 +168,11 @@ man_hack = sed "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\"
|
|||||||
|
|
||||||
%.html: %.txt asciidoc.conf
|
%.html: %.txt asciidoc.conf
|
||||||
$(call cmd,asciidoc,xhtml11)
|
$(call cmd,asciidoc,xhtml11)
|
||||||
@-sed -n 's/include::\(.*\)\[.*/$@: \1/p' < $< > .deps/$@
|
@-sed -n 's#include::\(.*\)\[.*#$@: \1#p' < $< > .deps/$(@F)
|
||||||
|
|
||||||
%.xml: %.txt asciidoc.conf
|
%.xml: %.txt asciidoc.conf
|
||||||
$(call cmd,asciidoc,docbook)
|
$(call cmd,asciidoc,docbook)
|
||||||
@-sed -n 's/include::\(.*\)\[.*/$@: \1/p' < $< > .deps/$@
|
@-sed -n 's#include::\(.*\)\[.*#$@: \1#p' < $< > .deps/$(@F)
|
||||||
|
|
||||||
%.1: %.1.xml
|
%.1: %.1.xml
|
||||||
$(call cmd,xmlto,man)
|
$(call cmd,xmlto,man)
|
||||||
|
@ -59,10 +59,13 @@ while (<>)
|
|||||||
|
|
||||||
my $orig_title = $title;
|
my $orig_title = $title;
|
||||||
|
|
||||||
if (not /^#define\s/) {
|
|
||||||
while (not /(struct|enum|typedef|[^=])*[\s*](\w+).*[\[:,;{]/) {
|
# Combine multi-line declarations to one. Break at empty
|
||||||
$_ .= <>;
|
# for #define ...
|
||||||
}
|
while (not /(struct|enum|typedef|[^=])*[\s*](\w+).*[\[:,;{]/) {
|
||||||
|
my $line = $_;
|
||||||
|
$_ .= <>;
|
||||||
|
last if $_ eq $line
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/struct\s+(\w+)\s*{/) {
|
if (/struct\s+(\w+)\s*{/) {
|
||||||
@ -73,36 +76,35 @@ while (<>)
|
|||||||
$title = "enum:$1" . "[$title]";
|
$title = "enum:$1" . "[$title]";
|
||||||
$idpath = "";
|
$idpath = "";
|
||||||
|
|
||||||
} elsif (/#define\s+(\w+)[(]/) {
|
} elsif (/#define/) {
|
||||||
|
if (/#define\s+(\w+)[(]/) {
|
||||||
|
$title = "func:$1" . "[$title]";
|
||||||
|
} elsif (/#define\s+(\w+)/) {
|
||||||
|
$title = "macro:$1" . "[$title]";
|
||||||
|
}
|
||||||
|
$idpath = "";
|
||||||
|
|
||||||
|
} elsif (/typedef/) {
|
||||||
|
if (/.*\(\*(\w+)\)\(/) {
|
||||||
|
$title = "typedef:$1" . "[$title]";
|
||||||
|
} elsif (/typedef.*\s(\w+);/) {
|
||||||
|
$title = "typedef:$1" . "[$title]";
|
||||||
|
}
|
||||||
|
$idpath = "";
|
||||||
|
|
||||||
|
} elsif (/.*[\s*](\w+)\(/) {
|
||||||
$title = "func:$1" . "[$title]";
|
$title = "func:$1" . "[$title]";
|
||||||
$idpath = "";
|
$idpath = "";
|
||||||
|
|
||||||
} elsif (/#define\s+(\w+)/) {
|
} elsif (/.*\(\*(\w+)\)\(/) {
|
||||||
$title = "macro:$1" . "[$title]";
|
$body = "#newline#" . $title if not $body;
|
||||||
$idpath = "";
|
$title = "id:[$idpath$1]::";
|
||||||
|
$indent = "\t";
|
||||||
|
|
||||||
} else {
|
} elsif (/[^=]*[\s*](\w+)[\[\s,:;]/) {
|
||||||
if (/typedef/) {
|
$body = "#newline#" . $title if not $body;
|
||||||
if (/.*\(\*(\w+)\)\(/) {
|
$title = "id:[$idpath$1]::";
|
||||||
$title = "typedef:$1" . "[$title]";
|
$indent = "\t";
|
||||||
} elsif (/typedef.*\s(\w+);/) {
|
|
||||||
$title = "typedef:$1" . "[$title]";
|
|
||||||
}
|
|
||||||
$idpath = "";
|
|
||||||
} else {
|
|
||||||
if (/.*[\s*](\w+)\(/) {
|
|
||||||
$title = "func:$1" . "[$title]";
|
|
||||||
$idpath = "";
|
|
||||||
} elsif (/.*\(\*(\w+)\)\(/) {
|
|
||||||
$body = "#newline#" . $title if not $body;
|
|
||||||
$title = "id:[$idpath$1]::";
|
|
||||||
$indent = "\t";
|
|
||||||
} elsif (/[^=]*[\s*](\w+)[\[\s,:;]/) {
|
|
||||||
$body = "#newline#" . $title if not $body;
|
|
||||||
$title = "id:[$idpath$1]::";
|
|
||||||
$indent = "\t";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
put_section if $orig_title ne $title;
|
put_section if $orig_title ne $title;
|
||||||
next;
|
next;
|
||||||
|
Loading…
Reference in New Issue
Block a user