Permalink
Browse files

More syntax highlighting

  • Loading branch information...
Brad Robinson
Brad Robinson committed Sep 19, 2017
1 parent 9ea18f9 commit d3474d728d3d5a90c051692f31a519a5e4ebf464
Showing with 34 additions and 26 deletions.
  1. +24 −18 Doc/usage-api.md
  2. +7 −5 Doc/usage-build.md
  3. +3 −3 README.md
View
@@ -10,39 +10,45 @@ please consult the documentation for your development tool.
2. Create an instance of the MiniMI Compiler object. eg:
{{C#}}
// Create an instance of the MiniME minifier
var mm = new MiniME.Compiler();
```C#
// Create an instance of the MiniME minifier
var mm = new MiniME.Compiler();
```
3. Set MiniME options. eg:
{{C#}}
// Setup options
mm.MaxLineLength = 0;
```C#
// Setup options
mm.MaxLineLength = 0;
```
4. Add files to process:
{{C#}}
// Add files
mm.AddFile("MyJavaScriptFile.js", Encoding.UTF8)
```C#
// Add files
mm.AddFile("MyJavaScriptFile.js", Encoding.UTF8)
```
or, add script directly
{{C#}}
mm.AddScript("snippet", "<javascript code here>");
```C#
mm.AddScript("snippet", "<javascript code here>");
```
5. Compile the script
{{C#}}
// Compile and write to an output file
mm.OutputFileName="MyMinifiedFile.js";
mm.OutputEncoding=Encoding.UTF8;
mm.Compile();
```C#
// Compile and write to an output file
mm.OutputFileName="MyMinifiedFile.js";
mm.OutputEncoding=Encoding.UTF8;
mm.Compile();
```
or, compile to a string
{{C#}}
var ObfuscatedScript=mm.CompileToString();
```C#
var ObfuscatedScript=mm.CompileToString();
```
6. That's it!
View
@@ -12,11 +12,13 @@ post-build command.
Here's a typical example:
-nologo
-check-filetimes
*.js
-o:scripts.min.js
```
-nologo
-check-filetimes
*.js
-o:scripts.min.js
```
In this example, MiniME will process all `.js` files in the same folder as `MiniME.txt` and
generate a single output script `scripts.min.js`. Modify the above example to suit your
View
@@ -30,9 +30,9 @@ Use it from the command line:
or programatically from .NET code:
```C#
var mm = new MiniME.Compiler();
mm.AddFile("MyJavaScriptFile.js");
var minified=mm.CompileToString();
var mm = new MiniME.Compiler();
mm.AddFile("MyJavaScriptFile.js");
var minified=mm.CompileToString();
```
## More Information ##

0 comments on commit d3474d7

Please sign in to comment.