Skip to content

Commit

Permalink
Finally fixed markup for NuGet.
Browse files Browse the repository at this point in the history
Mainly "Example:" immediately before the table without a separator was the problem.

Found the following helpful links:
- https://devblogs.microsoft.com/nuget/add-a-readme-to-your-nuget-package/
- https://learn.microsoft.com/de-de/nuget/nuget-org/package-readme-on-nuget-org#supported-markdown-features

However, NuGet sometimes adds another empty small column (with varying width) to the right side...
I give up trying to figure it out... The NuGet markup interpreter unfortunately seems to be buggy...
  • Loading branch information
db2222 committed Jul 24, 2023
1 parent 6944e3e commit 5877eac
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 84 deletions.
150 changes: 67 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,153 +1,137 @@
# ReadOnlySpanExtensions
Available via Nuget: https://www.nuget.org/packages/ReadOnlySpanExtensions

# ReadOnlySpanExtensions (C#)
Available via Nuget: https://www.nuget.org/packages/ReadOnlySpanExtensions \
\
Little convenience helper extension methods for slicing `ReadOnlySpan` (C#) via texts.\
All available extension methods start with `Span` in their name.

# Extension methods
## SpanBefore
Returns all characters before the given text.

Example:
<table>
<tr><th>span</th><th>text</th><th>Return value</th></tr>
<tr><td>Test1/Test2</td><td>/</td><td>Test1</td></tr>
</table>
### Example
span | text | Return value
-----|------|-------------
`Test1/Test2` | `/` | `Test1`

## SpanBeforeIncluding
Returns all characters before and including the given text itself.

Example:
<table>
<tr><th>span</th><th>text</th><th>Return value</th></tr>
<tr><td>Test1/Test2</td><td>/</td><td>Test1/</td></tr>
</table>
### Example
span | text | Return value
-----|------|-------------
`Test1/Test2` | `/` | `Test1/`

## SpanBeforeLast
Returns all characters before the last occurence of the given text.

Example:
<table>
<tr><th>span</th><th>text</th><th>Return value</th></tr>
<tr><td>Test1/Test2</td><td>Test</td><td>Test1/</td></tr>
</table>
### Example
span | text | Return value
-----|------|-------------
`Test1/Test2` | `Test` | `Test1/`

## SpanBeforeLastIncluding
Returns all characters before the last occurence of and including the given text itself.

Example:
<table>
<tr><th>span</th><th>text</th><th>Return value</th></tr>
<tr><td>Test1/Test2</td><td>Test</td><td>Test1/Test</td></tr>
</table>
### Example
span | text | Return value
-----|------|-------------
`Test1/Test2` | `Test` | `Test1/Test`

## SpanBeforeNth
Returns all characters before the nth occurence of the given text.

Example:
<table>
<tr><th>span</th><th>text</th><th>count</th><th>Return value</th></tr>
<tr><td>Test1/Test2/Test3</td><td>Test</td><td>3</td><td>Test1/Test2/</td></tr>
</table>
### Example
span | text | count | Return value
-----|------|-------|-------------
`Test1/Test2/Test3` | `Test` | `3` | `Test1/Test2/`

## SpanBeforeNthIncluding
Returns all characters before the nth occurence of and including the given text itself.

Example:
<table>
<tr><th>span</th><th>text</th><th>count</th><th>Return value</th></tr>
<tr><td>Test1/Test2/Test3</td><td>Test</td><td>3</td><td>Test1/Test2/Test</td></tr>
</table>
### Example
span | text | count | Return value
-----|------|-------|-------------
`Test1/Test2/Test3` | `Test` | `3` | `Test1/Test2/Test`

## SpanAfter
Returns all characters after the given text.

Example:
<table>
<tr><th>span</th><th>text</th><th>Return value</th></tr>
<tr><td>Test1/Test2</td><td>/</td><td>Test2</td></tr>
</table>
### Example
span | text | Return value
-----|------|-------------
`Test1/Test2` | `/` | `Test2`

## SpanAfterIncluding
Returns all characters after and including the given text itself.

Example:
<table>
<tr><th>span</th><th>text</th><th>Return value</th></tr>
<tr><td>Test1/Test2</td><td>/</td><td>/Test2</td></tr>
</table>
### Example
span | text | Return value
-----|------|-------------
`Test1/Test2` | `/` | `/Test2`

## SpanAfterLast
Returns all characters after the last occurence of the given text.

Example:
<table>
<tr><th>span</th><th>text</th><th>Return value</th></tr>
<tr><td>Test1/Test2</td><td>Test</td><td>2</td></tr>
</table>
### Example
span | text | Return value
-----|------|-------------
`Test1/Test2` | `Test` | `2`

## SpanAfterLastIncluding
Returns all characters after the last occurence of and including the given text itself.

Example:
<table>
<tr><th>span</th><th>text</th><th>Return value</th></tr>
<tr><td>Test1/Test2</td><td>Test</td><td>Test2</td></tr>
</table>
### Example
span | text | Return value
-----|------|-------------
`Test1/Test2` | `Test` | `Test2`

## SpanAfterNth
Returns all characters after the nth occurence of the given text.

Example:
<table>
<tr><th>span</th><th>text</th><th>count</th><th>Return value</th></tr>
<tr><td>Test1/Test2/Test3</td><td>Test</td><td>3</td><td>3</td></tr>
</table>
### Example
span | text | count | Return value
-----|------|-------|-------------
`Test1/Test2/Test3` | `Test` | `3` | `3`

## SpanAfterNthIncluding
Returns all characters after the nth occurence of and including the given text itself.

Example:
<table>
<tr><th>span</th><th>text</th><th>count</th><th>Return value</th></tr>
<tr><td>Test1/Test2/Test3</td><td>Test</td><td>3</td><td>Test3</td></tr>
</table>
### Example
span | text | count | Return value
-----|------|-------|-------------
`Test1/Test2/Test3` | `Test` | `3` | `Test3`

## SpanBetween
Returns all characters between the given start and end text.

Example:
<table>
<tr><th>span</th><th>startText</th><th>endText</th><th>Return value</th></tr>
<tr><td>&lt;td&gt;Dummy1&lt;/td&gt;&lt;td&gt;Dummy2&lt;/td&gt;</td><td>&lt;td&gt;</td><td>&lt;/td&gt;</td><td>Dummy1</td></tr>
</table>
### Example
span | startText | endText | Return value
-----|-----------|---------|-------------
`<td>Dummy1</td><td>Dummy2</td>` | `<td>` | `</td>` | `Dummy1`

## SpanBetweenIncluding
Returns all characters between and including the given start and end text themselves.

Example:
<table>
<tr><th>span</th><th>startText</th><th>endText</th><th>Return value</th></tr>
<tr><td>&lt;td&gt;Dummy1&lt;/td&gt;&lt;td&gt;Dummy2&lt;/td&gt;</td><td>&lt;td&gt;</td><td>&lt;/td&gt;</td><td>&lt;td&gt;Dummy1&lt;/td&gt;</td></tr>
</table>
### Example
span | startText | endText | Return value
-----|-----------|---------|-------------
`<td>Dummy1</td><td>Dummy2</td>` | `<td>` | `</td>` | `<td>Dummy1</td>`

## SpanBetweenOuter
Returns all characters between the first occurrence of the given start and the last occurrence of the given end text.

Example:
<table>
<tr><th>span</th><th>startText</th><th>endText</th><th>Return value</th></tr>
<tr><td>&lt;td&gt;Dummy1&lt;/td&gt;&lt;td&gt;Dummy2&lt;/td&gt;</td><td>&lt;td&gt;</td><td>&lt;/td&gt;</td><td>Dummy1&lt;/td&gt;&lt;td&gt;Dummy2</td></tr>
</table>
### Example
span | startText | endText | Return value
-----|-----------|---------|-------------
`<td>Dummy1</td><td>Dummy2</td>` | `<td>` | `</td>` | `Dummy1</td><td>Dummy2`

## SpanBetweenOuterIncluding
Returns all characters between the first occurrence of the given start and the last occurrence of the given end text and including the texts themselves.

Example:
<table>
<tr><th>span</th><th>startText</th><th>endText</th><th>Return value</th></tr>
<tr><td>&lt;td&gt;Dummy1&lt;/td&gt;&lt;td&gt;Dummy2&lt;/td&gt;</td><td>&lt;td&gt;</td><td>&lt;/td&gt;</td><td>&lt;td&gt;Dummy1&lt;/td&gt;&lt;td&gt;Dummy2&lt;/td&gt;</td></tr>
</table>
### Example
span | startText | endText | Return value
-----|-----------|---------|-------------
`<td>Dummy1</td><td>Dummy2</td>` | `<td>` | `</td>` | `<td>Dummy1</td><td>Dummy2</td>`

# Further remarks
See the tests for further examples.\
Expand Down
2 changes: 1 addition & 1 deletion ReadOnlySpanExtensions/ReadOnlySpanExtensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Version>1.0.1</Version>
<PackageReleaseNotes>Fixed README</PackageReleaseNotes>
<PackageReleaseNotes>Modified &amp; fixed README for NuGet.</PackageReleaseNotes>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down

0 comments on commit 5877eac

Please sign in to comment.