Skip to content

Commit 26e76a5

Browse files
committed
Fleshing out the documentation and fixing various typos.
1 parent f4f5ae9 commit 26e76a5

8 files changed

+329
-132
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_size = 4
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
// "commonjs": true,
5+
"es6": true,
6+
"node": true,
7+
"amd": true,
8+
"mocha": true
9+
},
10+
11+
"parserOptions": {
12+
"ecmaFeatures": {
13+
"jsx": true
14+
},
15+
"sourceType": "module"
16+
},
17+
18+
"extends": "eslint:recommended",
19+
// See http://eslint.org/docs/rules/
20+
21+
"rules": {
22+
// Note:
23+
// "off" or 0 - turn the rule off
24+
// "warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
25+
// "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
26+
"no-const-assign": "warn",
27+
"no-this-before-super": "warn",
28+
// "no-undef": "warn",
29+
"no-unreachable": "warn",
30+
// "no-unused-vars": "warn",
31+
"constructor-super": "warn",
32+
33+
"block-scoped-var": "error",
34+
35+
"array-bracket-spacing": ["error", "never"],
36+
"block-spacing": ["error", "always"],
37+
"brace-style": [1, "1tbs", { "allowSingleLine": true }],
38+
"prefer-const": "warn",
39+
40+
"valid-typeof": "error",
41+
"consistent-return": "error",
42+
"curly": ["warn","multi-line"],
43+
"eqeqeq": ["error","smart"],
44+
"guard-for-in": "warn",
45+
// "max-len": "warn",
46+
"new-cap": 1,
47+
"no-bitwise": 1,
48+
"no-else-return": 1,
49+
"no-eval": 2,
50+
"no-fallthrough": 1,
51+
"no-invalid-this": 1,
52+
"no-lone-blocks": 1,
53+
"no-return-assign": [1,"always"],
54+
"no-self-compare": 2,
55+
"no-sequences": 1,
56+
"no-unneeded-ternary": 1,
57+
"no-unused-expressions": 1,
58+
"no-useless-call": 1,
59+
"no-var": "error",
60+
"no-with": 2,
61+
// "vars-on-top": 1,
62+
"no-delete-var": 1,
63+
"no-mixed-spaces-and-tabs": [1,"smart-tabs"],
64+
"require-jsdoc": "error",
65+
"space-infix-ops": ["error", {"int32Hint": false}]
66+
67+
68+
// "no-trailing-spaces": [1,{"skipBlankLines":true}]
69+
}
70+
}

.github/ISSUE_TEMPLATE.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Prerequisites
2+
3+
* [ ] Did you check the [issue tracker](https://github.com/arnog/mathlive/issues) to see if this issue has already been reported?
4+
5+
For more information, see the `CONTRIBUTING` guide.
6+
7+
## Description
8+
[Description of the bug or feature.]
9+
[Include screenshots or code fragments if applicable]
10+
11+
## Steps to Reproduce
12+
[Provide steps that are specific and repeatable, if possible]
13+
1. [First Step]
14+
2. [Second Step]
15+
3. [and so on...]
16+
17+
### Actual behavior
18+
[What actually happened]
19+
[If there are any error messages, include the exact text shown,
20+
or upload a screenshot]
21+
22+
### Expected Behavior
23+
[What you expected to happen]
24+
[Is this a regression: did it use to work in a previous version]
25+
26+
### Environment
27+
**Operating System** [macOS, Windows, iOS], [include the version if possible]
28+
29+
**Browser** [Safari, Chrome, IE, Firefox, etc...]
30+
31+
**URL** [URL where the problem can be reproduced, if available]

.gitignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Include your project-specific ignores in this file
2+
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
3+
/build
4+
/node_modules
5+
6+
# OS generated files #
7+
######################
8+
.DS_Store
9+
.DS_Store?
10+
._*
11+
.Spotlight-V100
12+
.Trashes
13+
ehthumbs.db
14+
Thumbs.db

CONTRIBUTING.md

+65-90
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,87 @@
1-
#MathLive Programming Guide
1+
# Contributing to MathLive
22

3-
MathLive can be used to beautifully render and edit math in web pages.
3+
There are many ways you can get involved with MathLive. Contributing to
4+
an open source project is fun and rewarding.
45

5-
This guide describes how to use the MathLive Javascript libraries in your own
6-
web content. To contribute to the MathLive project, see the MathLive
7-
Contributor Guide.
6+
## Contributings Issues
87

9-
## Overview
8+
If you're running into some problems using MathLive or something doesn't
9+
behave the way you think it should, please file an issue in GitHub.
1010

11-
```
12-
```
11+
Before filing something, [have a look](https://github.com/arnog/mathlive/issues)
12+
at the existing issues. It's better to avoid filing duplicates. You can
13+
add a comment to an existing issue if you'd like.
1314

14-
## Getting Started
15+
### What happens after I file an issue?
1516

16-
The MathLive library is a series of Javascript modules and a few
17-
CSS files. The modules can be combined into a single library
18-
using a bundler such as **webpack**, or they can be included
19-
individually. We recommend to use **require.js** to simplify
20-
and optimize the loading of the individual modules.
17+
1. After a bug is filed, it will be _awaiting review_ (the issue will be untagged)
18+
2. After the bug has been triaged, it will be tagged _reviewed_
19+
3. Once a developer has started working on the bug, it will be tagged _fix in progress_. If the bug is a feature rather than a bug, it will be tagged _moved to backlog_
20+
4. Once a bug has been fixed, it will be tagged _fixed_
2121

22-
To use **require.js**, include the following in your web page,
23-
preferably before the `</body>` tag:
22+
In addition, issues can be tagged with the following:
23+
* _high priority_: Catastrophic issue that impacts many users
24+
* _medium priority_: Regression or issues that impact a significant number of users
25+
* _low priority_: Low severity (minor cosmetic issue) or very few users impacted
26+
* _no priority_: No plan to fix the issue, but we will consider a fix if someone offers a pull request
27+
* _starter bug_: This is an issue that would be a good candidate for someone
28+
who has little experience with the code base
29+
* _external_: This is an issue that has a dependency on an external component
30+
(typically, a browser)
31+
* _architecture_: This is an issue that requires a significant architectural
32+
change
33+
* _performance_: This issue affects perceived or measurable performance
34+
* _cleanup_: Resolving this issue would improve the code base maintainability
35+
without adding new functionality
36+
* _utr_: _unable to reproduce_ the bug, as reported, could not be replicated
37+
by the developer. Additional information is necessary to continue investigating.
38+
* _nab_: _not a bug_: The behavior described in the issue report is actually
39+
the intended behavior. This may be a usability issue, a documentation issue,
40+
or a disagreement regarding what the behavior should be.
41+
* _fol_: _fact of life_: The issue cannot be resolved due to constraints of
42+
the browser, the OS, or the laws of physics.
2443

25-
```
26-
<script data-main="js/main" src="js/vendor/require.js"></script>
27-
```
44+
### Can I help fix a bug?
2845

29-
``js/main`` should be a path to your "main" file, without the `.js`
30-
extension.
46+
Sure! Have a look at the issue report, and make sure no one is already
47+
working on it. If the issue is tagged _fix in progress_, someone is already
48+
on it. Otherwise, add a comment in the issue indicating you'd like to work on
49+
resolving the issue and go for it! See the [Contributor Guide](CONTRIBUTOR_GUIDE.md) for coding guidelines.
3150

32-
Inside `main.js`, use the following:
33-
```
34-
define(['mathlive'], function(MathLive) {
3551

36-
// YOUR CODE GOES HERE
52+
## Contributings Test Cases
3753

38-
});
39-
```
54+
The `test/` folder contains test cases that are used to make sure that
55+
bugs are not introduced as new features are added (regression).
4056

57+
If you'd like to revise or add some new test cases, that can be very helpful
58+
to improve MathLive's quality. Submit an issue indicating what you'd like
59+
to work on, and a pull request when you have it ready. Test cases should
60+
follow the TAP (Test Anything Protocol) format.
4161

42-
## Rendering math automatically
4362

44-
Math in a web page can automatically be rendered after the page has
45-
loaded using the `auto-render` module.
63+
## Contributing Ideas and Feature Requests
4664

47-
By default, any text that is enclosed with the following delimiters
48-
will be converted to a math formula:
49-
* `$$`...`$$`
50-
* `\[`...`\]`
51-
* `\(`...`\)`
65+
Use the [issue tracker](https://github.com/arnog/mathlive/issues) to submit
66+
requests for new features. First, have a look at what might already be there,
67+
and if you don't see anything that matches, write up a new issue.
5268

53-
When being considered for conversion, some tags are ignored: `script`, `noscript`, `style`, `textarea`, `pre` and `code`.
69+
## Contributing Code
5470

55-
To use this module, add it to the list of modules you import, for example:
56-
```
57-
define(['mathlive', 'auto-render'], function(MathLive, AutoRender) {
71+
Whether you have a fix for an issue, some improved test cases, or a brand
72+
new feature, we welcome contributions in the form of pull requests.
73+
Once submitted, your pull request will be reviewed and you will receive
74+
some feedback to make sure that your pull request fits in with
75+
* the roadmap for MathLive
76+
* the architecture of the project
77+
* the coding guidelines of the project
5878

59-
// YOUR CODE GOES HERE
79+
Before we can consider merging your pull request, you must sign the
80+
Contributor License Agreement here:
6081

61-
});
62-
```
82+
<a href="https://cla-assistant.io/arnog/mathlive"><img src="https://cla-assistant.io/readme/badge/arnog/mathlive" alt="CLA assistant" /></a>
6383

64-
Alternatively, if you don't have a `main.js` file, you can load it
65-
directly from your main page:
84+
Once your pull request has been accepted, it will be merged
85+
into the master branch.
6686

67-
```
68-
<!doctype html>
69-
<html lang="en-US">
70-
<head>
71-
...
72-
</head>
73-
<body onload = "
74-
requirejs.config({baseUrl:'js/'});
75-
requirejs(['auto-render'], function(AutoRender) {
76-
AutoRender.renderMathInElement(
77-
document.getElementsByTagName('body')[0])
78-
});
79-
">
80-
<h1>Taxicab Number</h1>
81-
<p>The second taxicab number is $$1729 = 10^3 + 9^3 = 12^3 + 1^3$$</p>
82-
83-
<script data-main="js/main" src="js/vendor/require.js"></script>
84-
</body>
85-
</html>
86-
```
87-
88-
If you dynamically generate content, you can request the autorenderer to run again using `AutoRender.renderMathInElement(el)`.
89-
90-
The `renderMathInElement()` functions takes a second parameter which can be used to customize the list of delimiters to consider, and the tags to ignore.
91-
92-
93-
94-
## Rendering math programatically
95-
96-
To make use of the MathLive API, include the MathLive module.
97-
98-
99-
## Math Editor
100-
101-
102-
103-
#MathLive Contributor Guide
104-
105-
This guide describes how to make contributions to the MathLive project. If you
106-
simply want to use MathLive with your web content, see the MathLive Programming
107-
Guide.
108-
109-
## Code structure
110-
111-
112-
## Architecture
87+
Congratulations, you've become a Mathlive contributor! Thanks for your help!

0 commit comments

Comments
 (0)