Skip to content

Commit 99f734c

Browse files
committed
Update readme
1 parent 7219a43 commit 99f734c

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,24 @@ AngleSharp.Js extends the core AngleSharp library with a .NET-based JavaScript e
1414

1515
## Basic Configuration
1616

17-
(tbd)
17+
If you just want a configuration *that works* you should use the following code:
18+
19+
```cs
20+
var config = Configuration.Default
21+
.WithJs(); // from AngleSharp.Js
22+
```
23+
24+
This will register a scripting engine for JS files. The JS parsing options and more could be set with parameters of the `WithJs` method.
25+
26+
You can also use this part with a console for logging. The call for this is `WithConsoleLogger`, e.g.,
27+
28+
```cs
29+
var config = Configuration.Default
30+
.WithJs()
31+
.WithConsoleLogger(ctx => new MyConsoleLogger(ctx));
32+
```
33+
34+
in the previous example `MyConsoleLogger` refers to a class implementing the `IConsoleLogger` interface. Examples of classes implementing this interface are available in our [samples repository](https://github.com/AngleSharp/AngleSharp.Samples).
1835

1936
## Vision and Status
2037

0 commit comments

Comments
 (0)