Skip to content

Commit ff21219

Browse files
committed
Update README
1 parent a1f72af commit ff21219

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

README.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,24 @@
33
Pseudocode.js is a JavaScript library that typesets pseudocode beautifully to
44
HTML.
55

6-
Pseudocode.js accepts a TeX-style input that borrows the algorithmic constructs
7-
from LaTeX's algorithm packages and produces a HTML output that looks (almost)
8-
identical to its LaTeX counterpart. The usage of a TeX-style grammar enables
9-
simple construction of math formulas. And any user who already has some LaTeX
10-
experience should find pseudocode.js very intuitive.
11-
6+
* **Intuitive grammar**: Pseudocode.js takes a LaTeX-style input that supports
7+
the algorithmic constructs from LaTeX's algorithm packages. With or without
8+
LaTeX experience, a user should find the grammar fairly intuitive.
9+
* **Print quality:** The HTML output produced by pseudocode.js is (almost)
10+
identical with the pretty algorithms printed on publications that are
11+
typeset by LaTeX.
12+
* **Math formula support:** Inserting math formulas in pseudocode.js is as easy
13+
as LaTeX. Just enclose math expression in `$...$` or `\(...\)`.
14+
15+
It supports all modern browsers, including Chrome, Safari,
16+
Firefox, Opera, and IE 8 - IE 11.
17+
1218
## Demo
1319
Visit the [project website](http://www.tatetian.me/pseudocode.js) for demo.
1420

1521
## Usage
22+
23+
### Basics
1624
Download [pseudocode.js](https://github.com/tatetian/pseudocode.js/releases),
1725
and host the files on your server. And then include the `js` and `css` files in
1826
your HTML files:
@@ -52,14 +60,6 @@ var htmlStr = pseudocode.renderToString(code, options);
5260
console.log(htmlStr);
5361
```
5462

55-
## Features
56-
There are several packages for typesetting algorithms in LaTeX, among which
57-
[`algorithmic`](http://mirror.ctan.org/tex-archive/macros/latex/contrib/algorithms/algorithms.pdf)
58-
package is the most simple and intuitive, and is chosen by IEEE in its
59-
[LaTeX template file](http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran).
60-
The grammar of Pseudocode.js is mostly compatible with `algorithmic` package with
61-
a few improvement to make it even more easier to use.
62-
6363
### Example
6464
To give you a sense of the grammar for pseudocode, here is an example that
6565
illustrates a quicksort algorithm:
@@ -92,6 +92,12 @@ illustrates a quicksort algorithm:
9292
```
9393

9494
### Grammar
95+
There are several packages for typesetting algorithms in LaTeX, among which
96+
[`algorithmic`](http://mirror.ctan.org/tex-archive/macros/latex/contrib/algorithms/algorithms.pdf)
97+
package is the most simple and intuitive, and is chosen by IEEE in its
98+
[LaTeX template file](http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran).
99+
The grammar of pseudocode.js is mostly compatible with `algorithmic` package with
100+
a few improvement to make it even more easier to use.
95101

96102
Commands for typesetting algorithms must be enclosed in an `algorithmic` environment:
97103
```tex
@@ -165,13 +171,13 @@ $i \gets i + 1$
165171
normal text {\small the size gets smaller} back to normal again
166172
```
167173

168-
Note that although Pseudocode.js recognizes some LaTeX commands, it is by no
174+
Note that although pseudocode.js recognizes some LaTeX commands, it is by no
169175
means a full-featured LaTeX implementation in JavaScript.
170176
It only support a subset of LaTeX commands that are most relevant to
171177
typesetting algorithms.
172178

173179

174-
To display the caption of an algorithm, use `algorithm` environtment as a 'float' wrapper :
180+
To display the caption of an algorithm, use `algorithm` environment as a 'float' wrapper :
175181
```tex
176182
\begin{algorithm}
177183
\caption{The caption of your algorithm}
@@ -206,6 +212,13 @@ var DEFAULT_OPTIONS = {
206212
captionCount: undefined
207213
};
208214
```
215+
## Author
216+
Tate Tian ([@tatetian](https://github.com/tatetian)) creates pseudocode.js. Any
217+
suggestions and bug reports are welcome.
209218

210219
## Acknowledgement
211-
Pseudocode.js is powered by [KaTeX](http://khan.github.io/KaTeX) to render math formulas.
220+
Pseudocode.js is partially inspired by [KaTeX](http://khan.github.io/KaTeX/) and
221+
relies on it to render math formulas.
222+
Thanks Emily Eisenberg([@xymostech](https://github.com/xymostech))
223+
and other contributers for building such a wonderful project.
224+

pseudocode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* The entry points of pseudocode-js
33
*
44
* TODO:
5+
* * Test on IE8 - IE10
56
* * Support color
6-
* * Case-insensitive
7-
* * elsif
7+
* * Math environment using \(, \)
88
**/
99

1010
var ParseError = require('./src/ParseError');

static/test-suite.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@
137137
});
138138
var testExamples = document.getElementById("test-examples").textContent;
139139
pseudocode.render(testExamples, document.body, {
140-
captionCount: 0,
141140
lineNumber: true,
142141
noEnd: false
143142
});

0 commit comments

Comments
 (0)