Skip to content
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

improve produced html so we can build better stylesheets #5544

Closed
vicuna opened this issue Mar 16, 2012 · 8 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link

commented Mar 16, 2012

Original bug ID: 5544
Reporter: vfiack
Assigned to: @zoggy
Status: closed (set by @zoggy on 2012-05-07T09:43:42Z)
Resolution: fixed
Priority: normal
Severity: trivial
Category: ocamldoc
Monitored by: meyer @hcarty @dbuenzli

Bug description

Summary of the patch:

  • no empty h1 in the main index, use a default title
  • navbar present in all pages, with classes added to pre/up/post links
  • span with class instead of font with fixed color for deprecated module info
  • variants with constructors are also in a
  • ul in index link list
  • removed and useless
    tags
  • css modifications (less important, discard if you want)

Additional information

sample result: http://vfiack.fr/ocaml/doc/

File attachments

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 16, 2012

Comment author: @protz

That's pretty cool. However, the formatting seems to be off at least on http://vfiack.fr/ocaml/doc/Gc.html. Is that intentional?

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 16, 2012

Comment author: @dbuenzli

Yes. It would be nice if all the br and hr could be removed and the markup generation could be reviewed for better semantic markup, adding approriate class names where needed. For the record here are the various hacks I have to use with the current markup in my stylesheet :

hr, hr + br, div + br, center + br, span + br, ul + br, ol + br, pre + br
{ display: none } /* annoying */

code br { display: inline } /* because of the above span + br rule /
pre + code { white-space:nowrap; /
in code examples we don't wrap. /
line-height:1.375em; } /
and the line height is too large. /
code + pre { margin-bottom:1.375em} /
after code example we introduce space. /
center { text-align: left }
center + br + pre { margin-bottom:1.375em} /
Toplevel module description /
div.info + br + code { display:block; margin-top: 1.375em} /
Records */

Also generating valid html could also make the task easier for consistency across different browsers see PR #5111.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 17, 2012

Comment author: vfiack

The formatting in Gc wasn't intentional, I forgot to close a pre tag for record types. This is fixed.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 19, 2012

Comment author: @gasche

I don't like the fact that code examples that are part of the comments have a red background like signature items. See for example (let f () = "foo") in http://vfiack.fr/ocaml/doc/String.html

It seems the generated HTML makes it impossible to do the difference. Maybe you could tweak it again to get different classes for those?

PS: there are two ways to put code in ocamldoc's formatted comment, preformatted {[ foo ]} and verbatim {v foo v}. Both should be handled, possibly with even finer class distinctions to be able to distinguish them, but I'm not sure that's terribly important.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 19, 2012

Comment author: vfiack

added a "codepre" and "verbatim" classes + the css to reset the background & border.

new patch is here : http://vfiack.fr/ocaml/odoc_html.ml.diff

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 20, 2012

Comment author: meyer

+1

I like the proposed doc style quite much - it's pleasant and readable.

Did anybody try it on a different browsers than Firefox?

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 20, 2012

Comment author: vfiack

I've tested it on chrome, IE 8, and an android phone browser.

The first column of the module index table wasn't grey in IE (:first-child isn't supported). I've changed the generator to add a css class to fix this.

Everything else seems ok.

The patch is up to date.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 7, 2012

Comment author: @zoggy

Partially applied patch in revision 12434. What was not applied: some of the style to keep original display, except for table of modules.
Thanks for the patch.

@vicuna vicuna closed this May 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.