Skip to content

Commit

Permalink
fixed operator documentation page overlapping names
Browse files Browse the repository at this point in the history
  • Loading branch information
Doraku committed Mar 15, 2020
1 parent 600adf1 commit 74286e2
Show file tree
Hide file tree
Showing 59 changed files with 535 additions and 416 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
breaking change:
changed netcoreapp to v3.0
do not generate base homepage if there is only one namespace present and no DefaultDocumentationHome specified nor any AssemblyDoc

fixed operator documentation page overlapping names
</PackageReleaseNotes>
</PropertyGroup>
</Project>
30 changes: 29 additions & 1 deletion source/DefaultDocumentation/Model/DocItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,37 @@ protected DocItem(DocItem parent, string id, string fullName, string name, XElem
}

protected DocItem(DocItem parent, IEntity entity, XElement documentation)
: this(parent, entity.GetIdString(), FullNameAmbience.ConvertSymbol(entity), (entity is ITypeDefinition ? TypeNameAmbience : NameAmbience).ConvertSymbol(entity), documentation)
: this(parent, entity.GetIdString(), GetFullName(entity), (entity is ITypeDefinition ? TypeNameAmbience : NameAmbience).ConvertSymbol(entity), documentation)
{ }

private static string GetFullName(IEntity entity)
{
string fullName = FullNameAmbience.ConvertSymbol(entity);

if (entity.SymbolKind == SymbolKind.Operator)
{
int index = fullName.IndexOf(".operator ") + 1;
if (index <= 0)
{
index = fullName.IndexOf(".implicit operator ") + 1;
int offset = 17;
if (index <= 0)
{
index = fullName.IndexOf(".explicit operator ") + 1;
offset = 17;
}

fullName = fullName.Substring(0, index) + entity.Name + fullName.Substring(index + offset);
}
else
{
fullName = fullName.Substring(0, index) + entity.Name + fullName.Substring(fullName.IndexOf('('));
}
}

return fullName;
}

public abstract void WriteDocumentation(DocumentationWriter writer);
}
}
4 changes: 0 additions & 4 deletions source/Dummy/documentation/Dummy-DummyClass--ctor().md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions source/Dummy/documentation/Dummy-DummyClass-DummyClass().md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### [Dummy](./Dummy.md 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyClass() Constructor
dummy
```csharp
public DummyClass();
```
12 changes: 8 additions & 4 deletions source/Dummy/documentation/Dummy-DummyClass-DummyField.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#### [Dummy](./Dummy.md 'Dummy')
### [Dummy](./Dummy.md#Dummy 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyField `field`
dummy
### [Dummy](./Dummy.md 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyClass.DummyField Field
dummy
```csharp
public DummyField;
```
#### Field Value
[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32')
28 changes: 14 additions & 14 deletions source/Dummy/documentation/Dummy-DummyClass-DummyMethod-T2-(T2).md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#### [Dummy](./Dummy.md 'Dummy')
### [Dummy](./Dummy.md#Dummy 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyMethod&lt;T2&gt;(T2) `method`
dummy
### Type parameters

### [Dummy](./Dummy.md 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyClass.DummyMethod&lt;T2&gt;(T2) Method
dummy
```csharp
public void DummyMethod<T2>(T2 pouet);
```
#### Type parameters
<a name='Dummy-DummyClass-DummyMethod-T2-(T2)-T2'></a>
`T2`

lol
### Parameters

`T2`
lol

#### Parameters
<a name='Dummy-DummyClass-DummyMethod-T2-(T2)-pouet'></a>
`pouet`

kikoo
`pouet` [T2](#Dummy-DummyClass-DummyMethod-T2-(T2)-T2 'Dummy.DummyClass.DummyMethod&lt;T2&gt;(T2).T2')
kikoo
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#### [Dummy](./Dummy.md 'Dummy')
### [Dummy](./Dummy.md#Dummy 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass').[DummyNested&lt;T&gt;](./Dummy-DummyClass-DummyNested-T-.md 'Dummy.DummyClass.DummyNested&lt;T&gt;')
## Action `event`
dummy
### [Dummy](./Dummy.md 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass').[DummyClass.DummyNested&lt;T&gt;](./Dummy-DummyClass-DummyNested-T-.md 'Dummy.DummyClass.DummyNested&lt;T&gt;')
## DummyClass.DummyNested&lt;T&gt;.Action Event
dummy
```csharp
public event Action;
```
#### Event type
[System.Action&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[T](./Dummy-DummyClass-DummyNested-T-.md#Dummy-DummyClass-DummyNested-T--T 'Dummy.DummyClass.DummyNested&lt;T&gt;.T')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')
26 changes: 14 additions & 12 deletions source/Dummy/documentation/Dummy-DummyClass-DummyNested-T-.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#### [Dummy](./Dummy.md 'Dummy')
### [Dummy](./Dummy.md#Dummy 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyNested&lt;T&gt; `type`
### [Dummy](./Dummy.md 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyClass.DummyNested&lt;T&gt; Class
dummy `test`
linebreak
```
example
yep
```
### Remarks
pouet
### Example
pouet
### Type parameters
```
```csharp
public class DummyClass.DummyNested<T>
```
Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') &gt; [DummyClass.DummyNested&lt;T&gt;](./Dummy-DummyClass-DummyNested-T-.md 'Dummy.DummyClass.DummyNested&lt;T&gt;')
#### Type parameters
<a name='Dummy-DummyClass-DummyNested-T--T'></a>
`T`


`T`


### Remarks
pouet
### Events
- [Action](./Dummy-DummyClass-DummyNested-T--Action.md 'Dummy.DummyClass.DummyNested&lt;T&gt;.Action')
12 changes: 8 additions & 4 deletions source/Dummy/documentation/Dummy-DummyClass-DummyProperty.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#### [Dummy](./Dummy.md 'Dummy')
### [Dummy](./Dummy.md#Dummy 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyProperty `property`
dummy
### [Dummy](./Dummy.md 'Dummy').[DummyClass](./Dummy-DummyClass.md 'Dummy.DummyClass')
## DummyClass.DummyProperty Property
dummy
```csharp
public int DummyProperty { get; }
```
#### Property Value
[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32')

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 74286e2

Please sign in to comment.