Updated documentation
(And added missing change from previous commit!)
This commit is contained in:
17
README.md
17
README.md
@@ -29,10 +29,7 @@ computeLayout(
|
||||
]}
|
||||
```
|
||||
|
||||
To run the tests
|
||||
|
||||
- For the JS tests: Open `RunLayoutTests.html` and `RunLayoutRandomTests.html` in Chrome or run `$ npm test`
|
||||
- For the C and Java tests: run `make` in your terminal. It will also transpile the JS code
|
||||
NOTE: You need to run the JavaScript build, as detailed below, before running this code.
|
||||
|
||||
Supported Attributes
|
||||
--------------------
|
||||
@@ -81,3 +78,15 @@ div, span {
|
||||
- Everything is `display: flex` by default. All the behaviors of `block` and `inline-block` can be expressed in term of `flex` but not the opposite.
|
||||
- All the flex elements are oriented from top to bottom, left to right and do not shrink. This is how things are laid out using the default CSS settings and what you'd expect.
|
||||
- Everything is `position: relative`. This makes `position: absolute` target the direct parent and not some parent which is either `relative` or `absolute`. If you want to position an element relative to something else, you should move it in the DOM instead of relying of CSS. It also makes `top, left, right, bottom` do something when not specifying `position: absolute`.
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
The core logic resides with `Layout.js`, which is transpiled into equivalent C and Java implementations.
|
||||
|
||||
To run the tests
|
||||
|
||||
- For the JS tests: run `grunt karma`
|
||||
- For the C and Java tests: run `make` in your terminal. It will also transpile the JS code. This build is also run via Travis CI.
|
||||
|
||||
The JavaScript build process is managed via Grunt. The build performs linting, runs the tests and produce a minified version of the code within a `dist` folder. The build output uses the Universal Module Format (UMD) so that it can be used via AMD / RequireJS, CommonJS or included directly into an HTML page.
|
||||
|
@@ -1,31 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Copyright (c) 2014, Facebook, Inc.
|
||||
All rights reserved.
|
||||
|
||||
This source code is licensed under the BSD-style license found in the
|
||||
LICENSE file in the root directory of this source tree. An additional grant
|
||||
of patent rights can be found in the PATENTS file in the same directory.
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Jasmine Spec Runner v2.0.0</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="https://jasmine.github.io/2.0/lib/jasmine_favicon.png">
|
||||
<link rel="stylesheet" type="text/css" href="https://jasmine.github.io/2.0/lib/jasmine.css">
|
||||
|
||||
<script type="text/javascript" src="https://jasmine.github.io/2.0/lib/jasmine.js"></script>
|
||||
<script type="text/javascript" src="https://jasmine.github.io/2.0/lib/jasmine-html.js"></script>
|
||||
<script type="text/javascript" src="https://jasmine.github.io/2.0/lib/boot.js"></script>
|
||||
|
||||
<!-- include source files here... -->
|
||||
<script type="text/javascript" src="src/Layout.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="text/javascript" src="src/Layout-test-utils.js"></script>
|
||||
<script type="text/javascript" src="src/__tests__/Layout-random-test.js"></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,32 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Copyright (c) 2014, Facebook, Inc.
|
||||
All rights reserved.
|
||||
|
||||
This source code is licensed under the BSD-style license found in the
|
||||
LICENSE file in the root directory of this source tree. An additional grant
|
||||
of patent rights can be found in the PATENTS file in the same directory.
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Jasmine Spec Runner v2.0.0</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="https://jasmine.github.io/2.0/lib/jasmine_favicon.png">
|
||||
<link rel="stylesheet" type="text/css" href="https://jasmine.github.io/2.0/lib/jasmine.css">
|
||||
|
||||
<script type="text/javascript" src="https://jasmine.github.io/2.0/lib/jasmine.js"></script>
|
||||
<script type="text/javascript" src="https://jasmine.github.io/2.0/lib/jasmine-html.js"></script>
|
||||
<script type="text/javascript" src="https://jasmine.github.io/2.0/lib/boot.js"></script>
|
||||
|
||||
<!-- include source files here... -->
|
||||
<script type="text/javascript" src="src/Layout.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="text/javascript" src="src/Layout-test-utils.js"></script>
|
||||
<script type="text/javascript" src="src/__tests__/Layout-test.js"></script>
|
||||
<script type="text/javascript" src="src/__tests__/Layout-consts-test.js"></script>
|
||||
</body>
|
||||
</html>
|
@@ -985,22 +985,3 @@ var computeLayout = (function() {
|
||||
extractNodes: extractNodes
|
||||
};
|
||||
})();
|
||||
|
||||
// UMD (Universal Module Definition)
|
||||
// See https://github.com/umdjs/umd for reference
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define([], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory();
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
root.returnExports = factory();
|
||||
}
|
||||
}(this, function () {
|
||||
return computeLayout;
|
||||
}));
|
||||
|
@@ -1,5 +1,8 @@
|
||||
// UMD (Universal Module Definition)
|
||||
// See https://github.com/umdjs/umd for reference
|
||||
//
|
||||
// This file uses the following specific UMD implementation:
|
||||
// https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
|
Reference in New Issue
Block a user