Commit f8ef0ad3 authored by gerd's avatar gerd

Reformatting docs with ocamldoc


git-svn-id: https://godirepo.camlcity.org/svn/lib-pxp/trunk@730 dbe99aee-44db-0310-b2b3-d33182c8eb97
parent 489cea47
...@@ -89,6 +89,19 @@ ps/pic/done: src/pic/*.fig ...@@ -89,6 +89,19 @@ ps/pic/done: src/pic/*.fig
.sgml.xml: .sgml.xml:
sx -xndata $< >$@; true sx -xndata $< >$@; true
.PHONY: odoc
odoc: html/pic/done
cd ../../src/pxp-engine && $(MAKE) doc
rm -rf html/ref
mkdir -p html/ref
cp style.css html/ref
ocamldoc -g ../../tools/src/odoc/chtml.cmo \
-t "PXP Reference" \
-I ../../src/pxp-engine \
-load ../../src/pxp-engine/pxp_engine.dump \
-d html/ref \
-css-style style.css
clean: clean:
......
a:visited {color : #416DFF; text-decoration : none; }
a:link {color : #416DFF; text-decoration : none;}
a:hover {color : Red; text-decoration : none; background-color: #5FFF88}
a:active {color : Red; text-decoration : underline; }
.keyword { font-weight : bold ; color : Red }
.keywordsign { color : #C04600 }
.superscript { font-size : 4 }
.subscript { font-size : 4 }
.comment { color : Green }
.constructor { color : Blue }
.type { color : #5C6585 }
.string { color : Maroon }
.warning { color : Red ; font-weight : bold }
.info { margin-left : 1cm; margin-right : 2cm }
.param_info { margin-top: 4px; margin-left : 1cm; margin-right : 2cm }
.code { color : #465F91 ; }
h1 { font-size : 20pt ;
margin-top: 20pt;
margin-bottom: 15t;
text-align: center;
padding: 5px;
border: 1px solid #000000;
}
h2 { font-size : 20pt ;
margin-top: 20pt;
margin-bottom: 8pt;
text-align: left;
padding: 2px;
margin-left: 1cm;
border-bottom: 1px solid #777777;
}
h3 { font-size : 16pt ;
margin-top: 20pt;
margin-bottom: 8pt;
text-align: left;
padding: 2px;
padding-left: 1cm;
}
h4 { font-size : 12pt ;
margin-top: 12pt;
margin-bottom: 6pt;
text-align: left;
padding: 2px;
}
h5 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90FDFF ;padding: 2px; }
h6 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #C0FFFF ; padding: 2px; }
div.h7 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #E0FFFF ; padding: 2px; }
div.h8 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #F0FFFF ; padding: 2px; }
div.h9 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #FFFFFF ; padding: 2px; }
.typetable { border-style : hidden }
.indextable { border-style : hidden }
.paramstable { border-style : hidden ; padding: 5pt 5pt}
body { background-color : White }
tr { background-color : White }
td.typefieldcomment { background-color : #FFFFFF ; font-size: smaller ;}
pre { margin-bottom: 4px }
div.sig_block {margin-left: 1cm}
.picture {
margin-left: 100px;
}
.picture-caption {
font-weight: bold;
padding-bottom: 10px;
}
...@@ -19,6 +19,10 @@ generate: pxp_core_parser.ml pxp_lexing.ml ...@@ -19,6 +19,10 @@ generate: pxp_core_parser.ml pxp_lexing.ml
depend: depend:
$(OCAMLDEP) *.ml *.mli >depend $(OCAMLDEP) *.ml *.mli >depend
.PHONY: doc
doc:
$(MAKE) -f Makefile.code pxp_engine.dump
clean: clean:
rm -f $(CLEAN_LIST) pxp_core_parser.ml pxp_lib.ml pxp_lexing.ml rm -f $(CLEAN_LIST) pxp_core_parser.ml pxp_lib.ml pxp_lexing.ml
......
...@@ -15,6 +15,7 @@ OBJ = pxp_lexing.cmo pxp_type_anchor.cmo \ ...@@ -15,6 +15,7 @@ OBJ = pxp_lexing.cmo pxp_type_anchor.cmo \
pxp_dtd_parser.cmo \ pxp_dtd_parser.cmo \
pxp_yacc.cmo pxp_marshal.cmo pxp_codewriter.cmo pxp_yacc.cmo pxp_marshal.cmo pxp_codewriter.cmo
DOC = pxp_document.mli intro_trees.txt
XOBJ = $(OBJ:.cmo=.cmx) XOBJ = $(OBJ:.cmo=.cmx)
...@@ -28,5 +29,10 @@ pxp_engine.cma: $(OBJ) ...@@ -28,5 +29,10 @@ pxp_engine.cma: $(OBJ)
pxp_engine.cmxa: $(XOBJ) pxp_engine.cmxa: $(XOBJ)
$(OCAMLOPT) -o pxp_engine.cmxa -a $(XOBJ) $(OCAMLOPT) -o pxp_engine.cmxa -a $(XOBJ)
pxp_engine.dump: $(DOC)
if [ ! -f pxp_engine.cma ]; then $(MAKE) -f Makefile.code pxp_engine.cma; fi
ocamldoc -stars -dump pxp_engine.dump \
$(DOC)
include depend include depend
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,6 +2,7 @@ all: ...@@ -2,6 +2,7 @@ all:
$(MAKE) -C m2parsergen $(MAKE) -C m2parsergen
# $(MAKE) -C ucs2_to_utf8 # $(MAKE) -C ucs2_to_utf8
$(MAKE) -C lexpp $(MAKE) -C lexpp
$(MAKE) -C odoc
clean: clean:
...@@ -9,8 +10,10 @@ CLEAN: clean ...@@ -9,8 +10,10 @@ CLEAN: clean
$(MAKE) -C m2parsergen CLEAN $(MAKE) -C m2parsergen CLEAN
# $(MAKE) -C ucs2_to_utf8 CLEAN # $(MAKE) -C ucs2_to_utf8 CLEAN
$(MAKE) -C lexpp CLEAN $(MAKE) -C lexpp CLEAN
$(MAKE) -C odoc CLEAN
distclean: distclean:
$(MAKE) -C m2parsergen distclean $(MAKE) -C m2parsergen distclean
# $(MAKE) -C ucs2_to_utf8 distclean # $(MAKE) -C ucs2_to_utf8 distclean
$(MAKE) -C lexpp distclean $(MAKE) -C lexpp distclean
$(MAKE) -C odoc distclean
TOP_DIR = ../../..
include $(TOP_DIR)/Makefile.rules
SRC = chtml.ml
OBJ = $(SRC:.ml=.cmo)
OCAMLC_OPTIONS += -I +ocamldoc
.PHONY: all
all: chtml.cmo
.PHONY: clean
clean:
rm -f $(CLEAN_LIST)
.PHONY: CLEAN
CLEAN: clean
.PHONY: distclean
distclean: clean
(* Our custom HTML generator *)
(* Define
{picture file.png Caption Text}
so images can be easily included into ocamldoc documentation
*)
open Printf
let word_re = Str.regexp "[ \t\r\n]+"
class chtml =
object(self)
inherit Odoc_html.html
method private html_of_picture b t =
prerr_endline "picture found";
let (file, caption) =
match t with
| [] ->
failwith "{picture ...} needs at least one argument"
| [Odoc_info.Raw arg] ->
let w = Str.split word_re arg in
( match w with
| file :: args ->
(file, String.concat " " args)
| [] ->
failwith "{picture ...} needs a simple word as first argument"
)
| _ :: _ ->
failwith "{picture ...} needs a simple word as first argument" in
bprintf b
"<div class=\"picture\">\
<div class=\"picture-caption\">%s</div>\
<img src=\"%s\">\
</div>"
(self#escape caption)
file
method html_of_custom_text b s t =
match s with
| "{picture" -> self#html_of_picture b t
| _ -> ()
end
let chtml = new chtml
let _ =
Odoc_args.set_doc_generator (Some chtml :> Odoc_args.doc_generator option)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment