Skip to content

Commit 7094abc

Browse files
committed
Improved documentation
1 parent 06ba247 commit 7094abc

File tree

14 files changed

+93
-33
lines changed

14 files changed

+93
-33
lines changed

.github/CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ There are a couple of rules, which are definitely not standard, but highly recom
6464

6565
1. If no issue already exists for the work you'll be doing, create one to document the problem(s) being solved and self-assign.
6666
2. Otherwise please let us know that you are working on the problem. Regular status updates (e.g. "still in progress", "no time anymore", "practically done", "pull request issued") are highly welcome.
67-
3. Create a new branch—please don't work in the `master` branch directly. It is reserved for releases. We recommend naming the branch to match the issue being addressed (`feature/#777` or `issue-777`).
67+
3. Create a new branch—please don't work in the `main` branch directly. It is reserved for releases. We recommend naming the branch to match the issue being addressed (`feature/#777` or `issue-777`).
6868
4. Add failing tests for the change you want to make. Tests are crucial and should be taken from W3C (or other specification).
6969
5. Fix stuff. Always go from edge case to edge case.
7070
6. All tests should pass now. Also your new implementation should not break existing tests.
@@ -73,7 +73,7 @@ There are a couple of rules, which are definitely not standard, but highly recom
7373

7474
Just to illustrate the git workflow for AngleSharp a little bit more we've added the following graphs.
7575

76-
Initially, AngleSharp starts at the `master` branch. This branch should contain the latest stable (or released) version.
76+
Initially, AngleSharp starts at the `main` branch. This branch should contain the latest stable (or released) version.
7777

7878
Here we now created a new branch called `devel`. This is the development branch.
7979

@@ -101,7 +101,7 @@ git push
101101
Finally, we may have all the features that are needed to release a new version of AngleSharp. Here we tag the release. For instance for the 1.0 release we use `v1.0`.
102102

103103
```sh
104-
git checkout master
104+
git checkout main
105105
git merge devel
106106
git tag v1.0
107107
```
@@ -128,7 +128,7 @@ To sync manually:
128128

129129
```sh
130130
git remote add gitbase [email protected]:AngleSharp/AngleSharp.GitBase.git
131-
git pull gitbase master
131+
git pull gitbase main
132132
```
133133

134134
### Versioning

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.17.0
2+
3+
Released on Tuesday, May 31 2022.
4+
5+
- Updated to use AngleSharp 0.17
6+
- Dropped .NET Framework 4.6
7+
18
# 0.16.0
29

310
Released on Sunday, June 6 2021.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013 - 2021 AngleSharp
3+
Copyright (c) 2013 - 2022 AngleSharp
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![logo](https://raw.githubusercontent.com/AngleSharp/AngleSharp.Io/master/header.png)
1+
![logo](https://raw.githubusercontent.com/AngleSharp/AngleSharp.Io/main/header.png)
22

33
# AngleSharp.Io
44

@@ -148,7 +148,7 @@ This project is supported by the [.NET Foundation](https://dotnetfoundation.org)
148148

149149
The MIT License (MIT)
150150

151-
Copyright (c) 2015 - 2020 AngleSharp
151+
Copyright (c) 2015 - 2022 AngleSharp
152152

153153
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
154154

build.cake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ var projectName = "AngleSharp.Io";
33
var solutionName = "AngleSharp.Io";
44
var frameworks = new Dictionary<String, String>
55
{
6-
{ "net46", "net46" },
76
{ "net461", "net461" },
87
{ "net472", "net472" },
98
{ "netstandard2.0", "netstandard2.0" },

docs/tutorials/01-API.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,18 @@ section: "AngleSharp.Io"
44
---
55
# API Documentation
66

7-
(tbd)
7+
The AngleSharp.Io package brings a new DOM interface `IStorage` into AngleSharp. Furthermore, the `InputFile` and `WebSocket` classes have been implemented in AngleSharp.Io.
8+
9+
The `InputFile` makes it possible to append files to, e.g., `<input type=file>` elements. This way you could write:
10+
11+
```cs
12+
var element = document.QuerySelector("input[type=file]");
13+
var file = new InputFile("foo.png", "image/png", new Byte[0] {});
14+
element.AppendFile(file);
15+
```
16+
17+
The content could be either a byte array or `Stream`.
18+
19+
Most importantly, the `AdvancedCookieProvider` is a much better way of handling cookies. While AngleSharp itself uses the cookie jar provided by .NET, AngleSharp.Io has reimplemented a cookie provider following the official specification. This way, the cookie handling just works.
20+
21+
Cookies can be handled temporarily (`MemoryFileHandler`) or persistently (`LocalFileHandler`). Custom file handlers for actually storing or retrieving the cookie content are possible. The crucial interface for this is `ICookieFileHandler`.

docs/tutorials/02-Examples.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,22 @@ This is a (growing) list of examples for every-day usage of AngleSharp.Io.
88

99
## Some Example
1010

11-
(tbd)
11+
AngleSharp.Io makes it easy to use the `HttpClient` for, e.g., utilizing a proxy to make HTTP requests.
12+
13+
```cs
14+
var handler = new HttpClientHandler
15+
{
16+
Proxy = new WebProxy(myProxyHost, false),
17+
PreAuthenticate = true,
18+
UseDefaultCredentials = false,
19+
};
20+
21+
var config = Configuration.Default
22+
.WithRequesters(handler) // from AngleSharp.Io with a handler config
23+
.WithDefaultLoader();
24+
25+
var context = BrowsingContext.New(config);
26+
27+
// this will load the document using the given requester, i.e., using the proxy
28+
var document = await context.OpenAsync("https://some-page.com/foo");
29+
```

docs/tutorials/03-Questions.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ section: "AngleSharp.Io"
44
---
55
# Frequently Asked Questions
66

7-
## What to ask?
7+
## How can the new requesters be used?
88

9-
(tbd)
9+
The integration of the new requesters can be done via the `WithRequesters` extension method. Don't forgot to add the loaders.
10+
11+
A quick example:
12+
13+
```cs
14+
var config = Configuration.Default
15+
.WithRequesters() // from AngleSharp.Io
16+
.WithDefaultLoader(); // from AngleSharp
17+
```
18+
19+
In this case the order matters. The `WithDefaultLoader` method will - by default - look for registered requesters. If no requester has been registered yet, default requesters will be added. This is not what you want. Therefore, add the custom requesters first.
20+
21+
## What requesters will be added?
22+
23+
There are 5 requesters:
24+
25+
- `http:` / `https:` requester (`HttpClientRequester`) using the `HttpClient`
26+
- `data:` requester
27+
- `ftp:` requester
28+
- `file:` requester
29+
- `about:` requester
30+
31+
If you would like to only add specific ones, then register them individually using the `With` extension method. Example:
32+
33+
```cs
34+
var config = Configuration.Default
35+
.With(new HttpClientRequester()) // only requester
36+
.WithDefaultLoader();
37+
```

src/AngleSharp.Io.Docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@anglesharp/io",
3-
"version": "0.16.0",
3+
"version": "0.17.0",
44
"preview": true,
55
"description": "The doclet for the AngleSharp.Io documentation.",
66
"keywords": [

src/AngleSharp.Io.Tests/AngleSharp.Io.Tests.csproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
3+
<TargetFrameworks>net6.0</TargetFrameworks>
44
<SignAssembly>true</SignAssembly>
55
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
66
<IsPackable>false</IsPackable>
@@ -16,12 +16,13 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19+
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.0" PrivateAssets="all" />
20+
<PackageReference Include="AngleSharp" Version="0.17.0" />
21+
<PackageReference Include="FluentAssertions" Version="5.10.3" />
1922
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
20-
<PackageReference Include="GitHubActionsTestLogger" Version="1.2.0" />
2123
<PackageReference Include="NUnit" Version="3.13.2" />
22-
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
23-
<PackageReference Include="FluentAssertions" Version="5.10.3" />
24-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
24+
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
25+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
2526
</ItemGroup>
2627

2728
<ItemGroup>

src/AngleSharp.Io.nuspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<icon>logo.png</icon>
1111
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1212
<description>Providers additional requesters and IO helpers for AngleSharp.</description>
13-
<releaseNotes>https://github.com/AngleSharp/AngleSharp.Io/blob/master/CHANGELOG.md</releaseNotes>
14-
<copyright>Copyright 2016-2021, AngleSharp</copyright>
13+
<releaseNotes>https://github.com/AngleSharp/AngleSharp.Io/blob/main/CHANGELOG.md</releaseNotes>
14+
<copyright>Copyright 2016-2022, AngleSharp</copyright>
1515
<tags>html html5 css css3 dom requester http https io filesystem storage httpclient cache</tags>
1616
<dependencies>
17-
<dependency id="AngleSharp" version="0.16.0" />
17+
<dependency id="AngleSharp" version="0.17.0" />
1818
</dependencies>
1919
</metadata>
2020
</package>

src/AngleSharp.Io/AngleSharp.Io.csproj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<AssemblyName>AngleSharp.Io</AssemblyName>
44
<RootNamespace>AngleSharp.Io</RootNamespace>
55
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0</TargetFrameworks>
6-
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">netstandard2.0;net46;net461;net472</TargetFrameworks>
6+
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">netstandard2.0;net461;net472</TargetFrameworks>
77
<SignAssembly>true</SignAssembly>
88
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -21,13 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="AngleSharp" Version="0.16.0" />
25-
</ItemGroup>
26-
27-
<ItemGroup Condition="'$(TargetFramework)' == 'net46'">
28-
<Reference Include="System.Net" />
29-
<Reference Include="System.Net.Http" />
30-
<Reference Include="System.Net.WebSockets" />
24+
<PackageReference Include="AngleSharp" Version="0.17.0" />
3125
</ItemGroup>
3226

3327
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<PropertyGroup>
33
<Description>Providers additional requesters and IO helpers for AngleSharp.</Description>
44
<Product>AngleSharp.Io</Product>
5-
<Version>0.16.0</Version>
5+
<Version>0.17.0</Version>
66
</PropertyGroup>
77
</Project>

tools/anglesharp.cake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#addin "Cake.FileHelpers"
2-
#addin "Octokit"
1+
#addin nuget:?package=Cake.FileHelpers&version=3.2.0
2+
#addin nuget:?package=Octokit&version=0.32.0
33
using Octokit;
44

55
var configuration = Argument("configuration", "Release");
@@ -28,7 +28,6 @@ if (isRunningOnGitHubActions)
2828

2929
if (!isRunningOnWindows)
3030
{
31-
frameworks.Remove("net46");
3231
frameworks.Remove("net461");
3332
frameworks.Remove("net472");
3433
}

0 commit comments

Comments
 (0)