Skip to content

Commit

Permalink
Incorporated errata.
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Nov 15, 2015
1 parent cd68927 commit bedaea2
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ reverse-dependency-test :
$(OCAMLBUILD) -clean && \
$(OCAMLBUILD) $(CFLAGS) dependency.native --

.PHONY : all-tests
all-tests : uninstall install test reverse-dependency-test

HTML := docs/html

.PHONY : docs
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ perhaps we should add it to Lambda Soup.

Lambda Soup is distributed under the BSD license. See [LICENSE][license].

Lambda Soup includes a modified version of [Ocamlnet][ocamlnet]'s Nethtml HTML
parser. The license for this parser is also found in the [LICENSE][license]
file.

[docs]: http://aantron.github.io/lambda-soup
[postprocess]: https://github.com/aantron/lambda-soup/blob/master/docs/postprocess.ml
[tests]: https://github.com/aantron/lambda-soup/blob/master/test/test.ml
Expand All @@ -114,3 +118,4 @@ Lambda Soup is distributed under the BSD license. See [LICENSE][license].
[extracss]: http://aantron.github.io/lambda-soup#VALselect
[traversals]: http://aantron.github.io/lambda-soup#2_Elementarytraversals
[combinators]: http://aantron.github.io/lambda-soup#2_Combinators
[ocamlnet]: http://projects.camlcity.org/projects/ocamlnet.html
25 changes: 16 additions & 9 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ improvement. Here are a few examples:
of performance improvements to be made.
- Lambda Soup could extend CSS with parent, ancestor, previous sibling, and
adjacent previous sibling combinators. These are the natural inverses of the
standard combinators.
standard combinators. There are also some potentially useful extensions in
jQuery, such as `:has`, that Lambda Soup could borrow.
- Lambda Soup could also support XPath for selection. XPath does seem to be much
less familiar to people, on average, however.
- Lambda Soup relies on [Ocamlnet's parser][nethtml] for HTML. This parser, like
every other, has quirks, such as the way it handles attributes without a
value and the fact that it does not resolve entities. Lambda Soup is also
completely reliant on it for dealing properly with character encodings. We may
need to work around some of these behaviors and/or parametrize Lambda Soup
over parsers.
completely reliant on it for dealing properly with character encodings.

Of course, this is aside from any bugs that may be found :)

Expand All @@ -39,14 +40,20 @@ Of course, this is aside from any bugs that may be found :)
Clone the repository locally. The library source is organized as follows:

- `src/`: main source, i.e. `src/soup.mli` and `src/soup.ml`.
- `test/`: test cases in `test.ml`.
- `test/`: unit tests in `test.ml`, a performance test, and a reverse dependency
("integration") test.
- `docs/`: files related to the `ocamldoc` documentation, such as extra HTML and
the postprocessing script.

To run tests, run `make test`. This requires the `ounit` package. To generate
docs, run `make docs`. To install the library from your repo clone, run
`make install`. This uses OPAM to pin the repository and install a `lambdasoup`
package. To undo this, run `make uninstall`.
Tu run tests, run `make all-tests`. This requires the `ounit` package. This
takes some time, because it reinstalls Lambda Soup. If you want to run only the
unit and performance tests, run `make test`.

To generate docs, run `make docs`.

To install the library from your repo clone, run `make install`. This uses OPAM
to pin the repository and install a `lambdasoup` package. To undo this, run
`make uninstall`.

Make a branch off master, make your changes, rebase over master (if you have to)
when done, and submit a pull request :)
Expand Down
8 changes: 8 additions & 0 deletions docs/postprocess.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ let () =
|> filter (fun e -> e $? "br" <> None)
|> iter (fun e -> e $ "+ .info" |> add_class "multiline-member");

(* Find every section that has additional text after the title, and add a
class to the last element of such text. This is used by CSS to increase
spacing. *)
soup $$ "h2" |> iter (fun h2 ->
let e = h2 $ "~ pre:not(.codepre)" |> R.previous_element in
if name e = "h2" then ()
else add_class "end-of-section-text" e);

(* Clean up links in the head. *)
soup $$ "head link:not([rel=stylesheet])" |> iter delete;

Expand Down
4 changes: 4 additions & 0 deletions docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ body > pre:first-of-type {
margin-top: 1.5em;
}

.end-of-section-text {
margin-bottom: 3em;
}

/* Links. */

a {
Expand Down

0 comments on commit bedaea2

Please sign in to comment.