Skip to content

Minimize markup in variand and field descriptions. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/odoc_wiki/odoc_wiki.ml
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,16 @@ class virtual info =
@param indent can be specified not to use the style of info comments;
default is [true].
*)
method html_of_info ?(indent=true) b info_opt =
method html_of_info ?(no_markup=false) ?(indent=true) b info_opt =
match info_opt with
None ->
()
| Some info when no_markup ->
(
match info.Odoc_info.i_desc with
None -> ()
| Some d -> bs b (self#escape (Odoc_text.Texter.string_of_text d))
)
| Some info ->
let module M = Odoc_info in
if indent then bs b "<<div class=\"odocwiki_info\"|";
Expand Down Expand Up @@ -1234,7 +1240,7 @@ class wiki =
| Some t ->
bs b "<<span class=\"odocwiki_comments\"|";
bp b "<<span class=\"odocwiki_comments_open\"|(*>> <<span|";
self#html_of_info b (Some t);
self#html_of_info ~no_markup: true b (Some t);
bp b ">><<span class=\"odocwiki_comments_close\"| ~*)>>";
bs b ">>";
);
Expand Down Expand Up @@ -1263,7 +1269,7 @@ class wiki =
| Some t ->
bs b "<<span class=\"odocwiki_comments\"|";
bp b "<<span class=\"odocwiki_comments_open\"|(*>> <<span|";
self#html_of_info b (Some t);
self#html_of_info ~no_markup: true b (Some t);
bp b ">><<span class=\"odocwiki_comments_close\"| ~*)>>";
bs b ">>";
);
Expand Down Expand Up @@ -1490,7 +1496,7 @@ class wiki =
if info then
(
if complete then
self#html_of_info ~indent: false
self#html_of_info ?no_markup: None ~indent: false
else
self#html_of_info_first_sentence
) b m.m_info
Expand Down Expand Up @@ -1521,7 +1527,7 @@ class wiki =
if info then
(
if complete then
self#html_of_info ~indent: false
self#html_of_info ?no_markup: None ~indent: false
else
self#html_of_info_first_sentence
) b mt.mt_info
Expand Down Expand Up @@ -1678,7 +1684,7 @@ class wiki =
bs b ">>" ;
(
if complete then
self#html_of_info ~indent: false
self#html_of_info ?no_markup: None ~indent: false
else
self#html_of_info_first_sentence
) b c.cl_info
Expand Down Expand Up @@ -1721,7 +1727,7 @@ class wiki =
bs b ">>";
(
if complete then
self#html_of_info ~indent: false
self#html_of_info ?no_markup: None ~indent: false
else
self#html_of_info_first_sentence
) b ct.clt_info
Expand Down