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

Doc, Stock and Two Smoking HTML Tags: Cleanup pass in lift-common scaladocs #1650

Merged
merged 14 commits into from
Jan 5, 2015

Conversation

Shadowfiend
Copy link
Member

Hopefully I'll get to do this with the other modules in short order as well. This pass
removes HTML from scaladocs, adds wiki markup in its stead, adds wiki markup
in places where we were using just text, adds examples here and there, and generally
tidies up the documentation.

It also adds the ability to link to Scala's APIs and scala-xml APIs from our scaladocs,
which required some tweaks to the build.

In the process, also did some very slight code cleanup. Each of these is split out into
a commit in case we want to selectively remove it. Of particular interest is that I
removed documentation that seemed to add nothing on top of the existing function
name or signature in 55fa831. Let me know if you think that's a problem.

We do two things: turn on autoAPIMappings, which
automatically lets us link to Scaladocs for modules that set
their public URIs, and explicitly add the mapping for the
scala-xml module. The addition of the scala-xml module is
also reasonably generic, so we can add more module-specific
URIs fairly easily in the future as needed.
Some places get more detailed Scaladocs, others get some facelifts and get
converted to wiki syntax instead of HTML. Examples added throughout.
Some of the scaladocs were extremely redundant with respect
to the functions they were describing. This commit drops
those Scaladocs.
It doesn’t seem to be used anywhere and we generally lean
on transformation functions rather than generation functions
for NodeSeq. This is also something we want to continue to
encourage, so making using NodeSeqs directly a little more
painful is okay.
checkConfig was used to make sure setup was being run. It’s
now named ranSetup, since that’s more reflective of what it
means.
SimpleList and SimpleVector have a bunch of unsupported
operations with respect to regular Java collections; these
were through Exception instances. We switch them to throw
UnsupportedOperationException as per the Java collection
contract.
* Implements an LRU Hashmap. Given a size, this map will evict the least
* recently used item(s) when new items are added.
*
* Note that `LRUMap` is *not* thread-safe.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The emphasised "not" renders in HTML as *not*. Looks like the scaladoc markup needs ''not'' for italic if that's the intention (https://wiki.scala-lang.org/display/SW/Syntax)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah, yeah, good catch, I forgot to double-check those even though I meant to. Just use Common Mark dammit ;)

@d6y
Copy link
Member

d6y commented Dec 15, 2014

Nice! Thank you for tackling this.

* Empty otherwise
* Create a `Box` from the specified `Box`, checking for `null`.
*
* @return `Full(in)` if `in` is non-null, `Empty` otherwise.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh, this guy needs further clarification.

@fmpwizard
Copy link
Member

I would say that while some of the comments you removed are pretty redundant, when users are new to Scala and/or Lift, they actually help explain what those two or three lines do. I know I learned a lot by reading the source code and its comments.

@Shadowfiend
Copy link
Member Author

Any chance you can comment on the specific ones you think we shouldn't lose? I can see the argument for some, for example the implicit conversions that in turn take implicit parameters, but not so much for others, for example the case class descriptions that basically repeat the case class name.

@fmpwizard
Copy link
Member

sure, I'll comment on the those

* @param justification Justify why calling this method is okay and why it will not result in an Exception
*
* @return The contents of the Box if it has one or an exception if not
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave this one in, I have spoken to a few developers who thought using openOrThrowException was not a big deal, without really understanding that they are not really supposed to use it, (there are use cases for it, but it would be good to point out the alternatives)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually got removed because it should be inherited from Box, which has the same comment above.

@fmpwizard
Copy link
Member

done with comments about what to kepp

Apparently * doesn’t emphasize, ''' does. Seems legit…
Mostly adding `` around classes and parameters in docs, with
a couple of tweaks to docs that weren’t clear enough.
The specific motivation is that scaladoc in 2.11.3 fixes an
issue with picking up indentation in code blocks properly.
These are implicits that take implicits as parameters, and the
docs make it a little clearer what that’s for.
@Shadowfiend
Copy link
Member Author

Pushed fixes to most of the comments, including my own. Also clarified and tweaked some of the docs I'd written that clearly suffered from you-wrote-this-too-late-in-the-evening syndrome.

Also, bumped to Scala 2.11.3 as it fixes an issue with recognizing indentation properly in scaladoc code blocks.

Lastly, I have a proposed fix to the FuncJBridge stuff in commit 51076fa, which isn't in this branch (but I can put it in if we agree it's the way to go).

@fmpwizard
Copy link
Member

Thanks for the changes!

@Shadowfiend
Copy link
Member Author

Well, 'tis the season after all! ;)


crossScalaVersions in ThisBuild := Seq("2.11.2")
crossScalaVersions in ThisBuild := Seq("2.11.3")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cop car

Scala 2.11.3 was DOA. It broke binary compatibility. We need to bump directly to 2.11.4 (which is already out anyway)

Source: https://groups.google.com/forum/#!topic/scala-internals/SSD9BNJaFbU

Evidently 2.11.3 had binary compatibility issues, so 2.11.4 it is!
@Shadowfiend
Copy link
Member Author

Added the 2.11.4 bump for maximum binary neighborly compatibility.

@Shadowfiend Shadowfiend mentioned this pull request Jan 3, 2015
@Shadowfiend
Copy link
Member Author

Any thoughts on the fixes for FuncJBridge? If those look good, I can include that commit here and then we can see about merging these changes.

@fmpwizard
Copy link
Member

looks good to me, 👍

@Shadowfiend
Copy link
Member Author

Kk, pushing accordingly then. Will wait a couple of days for further comments before merging.

@Shadowfiend
Copy link
Member Author

Kk, seeing no further comments I'm going to go ahead and merge this feller in!

Shadowfiend added a commit that referenced this pull request Jan 5, 2015
Doc, Stock and Two Smoking HTML Tags: Cleanup pass in lift-common scaladocs

This pass removes HTML from scaladocs, adds wiki markup in its stead, adds wiki
markup in places where we were using just text, adds examples here and there, and
generally tidies up the documentation.

It also adds the ability to link to Scala's APIs and scala-xml APIs from our scaladocs,
which required some tweaks to the build.
@Shadowfiend Shadowfiend merged commit 0e9573e into master Jan 5, 2015
@Shadowfiend Shadowfiend deleted the doc-stock-and-two-smoking-html-tags branch January 5, 2015 22:23
@fmpwizard fmpwizard added this to the 3.0-M3 milestone Jan 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants