Skip to content

Commit

Permalink
Replace ` with <c>
Browse files Browse the repository at this point in the history
  • Loading branch information
kostiantxn committed Dec 10, 2023
1 parent 4418337 commit bcff8c0
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 48 deletions.
4 changes: 2 additions & 2 deletions docs/DocComment.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The sequence of nodes this comment consists of (e.g. `summary`, `remarks`, etc.)
public DocCommentElement? Param(string name)
```

A nested <param>documentation element that has the specified name.
A nested `<param>` documentation element that has the specified name.

#### Parameters
- `name`: The name of the parameter to search inside the comment.
Expand All @@ -37,7 +37,7 @@ A nested <param>documentation element that has the specified name.
public DocCommentElement? TypeParam(string name)
```

A nested <typeparam>documentation element that has the specified name.
A nested `<typeparam>` documentation element that has the specified name.

#### Parameters
- `name`: The name of the parameter to search inside the comment.
Expand Down
9 changes: 5 additions & 4 deletions docs/DocCommentParamRef.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# [Summary.DocCommentParamRef](../src/Core/DocCommentParamRef.cs#L7)
# [Summary.DocCommentParamRef](../src/Core/DocCommentParamRef.cs#L8)
```cs
public record DocCommentParamRef(string Value) : DocCommentNode
```

A [`DocCommentNode`](./DocCommentNode.md) that represents the reference to a parameter (`<paramref>`, `<typeparamref>`).
A [`DocCommentNode`](./DocCommentNode.md) that represents the reference to a parameter
(`<paramref>`, `<typeparamref>`).

## Properties
### [Value](../src/Core/DocCommentParamRef.cs#L7)
### [Value](../src/Core/DocCommentParamRef.cs#L8)
```cs
public string Value { get; }
```

The name of the parameter .
The name of the parameter.

4 changes: 2 additions & 2 deletions docs/DocTypeDeclaration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
public record DocTypeDeclaration : DocMember
```

A [`DocMember`](./DocMember.md) that represents a documented type declaration (e.g. `struct`, `class`, etc.)
in the parsed source code.
A [`DocMember`](./DocMember.md) that represents a documented type declaration
(e.g. `struct`, `class`, etc.) in the parsed source code.

## Properties
### [Members](../src/Core/DocTypeDeclaration.cs#L14)
Expand Down
8 changes: 4 additions & 4 deletions src/Core/AccessModifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
public enum AccessModifier
{
/// <summary>
/// The `private` keyword access modifier.
/// The <c>private</c> keyword access modifier.
/// </summary>
Private,

/// <summary>
/// The `protected` keyword access modifier.
/// The <c>protected</c> keyword access modifier.
/// </summary>
Protected,

/// <summary>
/// The `internal` keyword access modifier.
/// The <c>internal</c> keyword access modifier.
/// </summary>
Internal,

/// <summary>
/// The `public` keyword access modifier.
/// The <c>public</c> keyword access modifier.
/// </summary>
Public,
}
14 changes: 7 additions & 7 deletions src/Core/DocComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// A documentation comment parsed from the source code.
/// </summary>
/// <param name="Nodes">The sequence of nodes this comment consists of (e.g. `summary`, `remarks`, etc.).</param>
/// <param name="Nodes">The sequence of nodes this comment consists of (e.g. <c>summary</c>, <c>remarks</c>, etc.).</param>
public record DocComment(DocCommentNode[] Nodes)
{
/// <summary>
Expand All @@ -12,36 +12,36 @@ public record DocComment(DocCommentNode[] Nodes)
public static readonly DocComment Empty = new(Array.Empty<DocCommentNode>());

/// <summary>
/// A nested &lt;param&gt; documentation element that has the specified name.
/// A nested <c>&lt;param&gt;</c> documentation element that has the specified name.
/// </summary>
/// <param name="name">The name of the parameter to search inside the comment.</param>
public DocCommentElement? Param(string name) =>
Element("param", name);

/// <summary>
/// A nested &lt;typeparam&gt; documentation element that has the specified name.
/// A nested <c>&lt;typeparam&gt;</c> documentation element that has the specified name.
/// </summary>
/// <param name="name">The name of the parameter to search inside the comment.</param>
public DocCommentElement? TypeParam(string name) =>
Element("typeparam", name);

/// <summary>
/// A nested documentation element that has the specified name (e.g. `summary`, `remarks`, etc.).
/// A nested documentation element that has the specified name (e.g. <c>summary</c>, <c>remarks</c>, etc.).
/// </summary>
/// <param name="tag">The name of the element tag to search inside the comment.</param>
/// <param name="name">The value of the `name` attribute of the tag.</param>
/// <param name="name">The value of the <c>name</c> attribute of the tag.</param>
public DocCommentElement? Element(string tag, string name) =>
Element(x => x.Name == tag && x.Attribute("name")?.Value == name);

/// <summary>
/// A nested documentation element that has the specified name (e.g. `summary`, `remarks`, etc.).
/// A nested documentation element that has the specified name (e.g. <c>summary</c>, <c>remarks</c>, etc.).
/// </summary>
/// <param name="tag">The name of the element tag to search inside the comment.</param>
public DocCommentElement? Element(string tag) =>
Element(x => x.Name == tag);

/// <summary>
/// A nested documentation element that matches the specified predicate `p`.
/// A nested documentation element that matches the specified predicate <c>p</c>.
/// </summary>
/// <param name="p">The predicate to apply on each nested documentation element.</param>
public DocCommentElement? Element(Func<DocCommentElement, bool> p) =>
Expand Down
6 changes: 3 additions & 3 deletions src/Core/DocCommentElementAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Summary;

/// <summary>
/// An XML-documentation attribute (e.g. `name` in `param`, etc.).
/// An XML-documentation attribute (e.g. <c>name</c> in <c>param</c>, etc.).
/// </summary>
/// <param name="Name">The name of the attribute (e.g. `name`, `cref`, etc.)</param>
/// <param name="Value">The value of the attribute (e.g. the actual name in `name` attribute).</param>
/// <param name="Name">The name of the attribute (e.g. <c>name</c>, <c>cref</c>, etc.)</param>
/// <param name="Value">The value of the attribute (e.g. the actual name in <c>name</c> attribute).</param>
public record DocCommentElementAttribute(string Name, string Value);
2 changes: 1 addition & 1 deletion src/Core/DocCommentInheritDoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/// <summary>
/// A <see cref="DocCommentNode" /> that inherits documentation from another member
/// (`&lt;inheritdoc&gt;`).
/// (<c>&lt;inheritdoc&gt;</c>).
/// </summary>
/// <param name="Cref">An optional link to the member the documentation should be inherited from.</param>
public record DocCommentInheritDoc(string? Cref) : DocCommentNode;
2 changes: 1 addition & 1 deletion src/Core/DocCommentLink.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Summary;

/// <summary>
/// A <see cref="DocCommentNode"/> that represents the link to other member (e.g. `&lt;see cref="SomeMember"/&gt;`).
/// A <see cref="DocCommentNode"/> that represents the link to other member (e.g. <c>&lt;see cref="SomeMember"/&gt;</c>).
/// </summary>
/// <param name="Value">The name of the member the link links to.</param>
/// TODO: Should the link contain a `DocMember` instead of a string?
Expand Down
5 changes: 3 additions & 2 deletions src/Core/DocCommentParamRef.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace Summary;

/// <summary>
/// A <see cref="DocCommentNode"/> that represents the reference to a parameter (`&lt;paramref&gt;`, `&lt;typeparamref&gt;`).
/// A <see cref="DocCommentNode"/> that represents the reference to a parameter
/// (<c>&lt;paramref&gt;</c>, <c>&lt;typeparamref&gt;</c>).
/// </summary>
/// <param name="Value">The name of the parameter .</param>
/// <param name="Value">The name of the parameter.</param>
public record DocCommentParamRef(string Value) : DocCommentNode;
8 changes: 4 additions & 4 deletions src/Core/DocMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ namespace Summary;
public abstract record DocMember
{
/// <summary>
/// The fully qualified name of the member (e.g., `Summary.DocMember`).
/// The fully qualified name of the member (e.g., <c>Summary.DocMember</c>).
/// </summary>
public required string FullyQualifiedName { get; init; }

/// <summary>
/// The name of the member (e.g. `public int Field` has name `Field`).
/// The name of the member (e.g. <c>public int Field</c> has name <c>Field</c>).
/// </summary>
public required string Name { get; init; }

/// <summary>
/// The code-snippet that contains the full declaration of the member
/// (e.g. `public int Field` is a declaration of the field member `Field`).
/// (e.g. <c>public int Field</c> is a declaration of the field member <c>Field</c>).
/// </summary>
public required string Declaration { get; init; }

Expand Down Expand Up @@ -55,7 +55,7 @@ public abstract record DocMember
public DocLocation? Location { get; init; }

/// <summary>
/// Whether this member matches the specified `cref` reference.
/// Whether this member matches the specified <c>cref</c> reference.
/// </summary>
public bool MatchesCref(string cref)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Core/DocMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public record DocMethod : DocMember
public required bool Delegate { get; init; } = false;

/// <summary>
/// The signature of the method without parameters in link format (e.g., `Sum{T}`).
/// The signature of the method without parameters in link format (e.g., <c>Sum{T}</c>).
/// </summary>
public string SignatureWithoutParams => $"{FullyQualifiedName}{TypeParamsSignature}";

/// <summary>
/// The signature of the method in link format (e.g., `Sum{T}(T, T)`).
/// The signature of the method in link format (e.g., <c>Sum{T}(T, T)</c>).
/// </summary>
public string Signature => $"{SignatureWithoutParams}{ParamsSignature}";

Expand Down
2 changes: 1 addition & 1 deletion src/Core/DocParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public record DocParam(DocType? Type, string Name)
{
/// <summary>
/// The comment of the parameter (i.e., `&lt;param&gt;` tag).
/// The comment of the parameter (i.e., <c>&lt;param&gt;</c> tag).
/// </summary>
public DocCommentElement? Comment(DocMember parent) =>
parent.Comment.Param(Name);
Expand Down
2 changes: 1 addition & 1 deletion src/Core/DocType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Summary;

/// <summary>
/// A simple type (e.g. `int`, `string`, `List&lt;int&gt;`, etc.).
/// A simple type (e.g. <c>int</c>, <c>string</c>, <c>List&lt;int&gt;</c>, etc.).
/// </summary>
/// <param name="Name">The name of the type (without generic arguments).</param>
/// <param name="TypeParams">The generic parameters of this type (if it's generic).</param>
Expand Down
4 changes: 2 additions & 2 deletions src/Core/DocTypeDeclaration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Summary;

/// <summary>
/// A <see cref="DocMember" /> that represents a documented type declaration (e.g. `struct`, `class`, etc.)
/// in the parsed source code.
/// A <see cref="DocMember" /> that represents a documented type declaration
/// (e.g. <c>struct</c>, <c>class</c>, etc.) in the parsed source code.
/// </summary>
public record DocTypeDeclaration : DocMember
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/DocTypeParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public record DocTypeParam(string Name)
{
/// <summary>
/// The comment of the parameter (i.e., `&lt;typeparam&gt;` tag).
/// The comment of the parameter (i.e., <c>&lt;typeparam&gt;</c> tag).
/// </summary>
public DocCommentElement? Comment(DocMember parent) =>
parent.Comment.TypeParam(Name);
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Extensions/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public static string Separated<T>(this IEnumerable<T> self, string with) =>
string.Join(with, self);

/// <summary>
/// Filters out all `null` values from the specified sequence.
/// Filters out all <c>null</c> values from the specified sequence.
/// </summary>
public static IEnumerable<T> NonNulls<T>(this IEnumerable<T?> self) =>
self.Where(x => x != null)!;

/// <summary>
/// Applies the specified `map` function on each element in the specified sequence.
/// Applies the specified <c>map</c> function on each element in the specified sequence.
/// Additionally, passes the optional next element.
/// </summary>
public static IEnumerable<V> SelectWithNext<T, V>(this IEnumerable<T> self, Func<T, T?, V> map) =>
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static string AsFullPath(this string self) =>
Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, self));

/// <summary>
/// Converts the given string into the format of `cref` attribute value.
/// Converts the given string into the format of <c>cref</c> attribute value.
/// </summary>
/// <example>
/// In the following example, the <c>"Some&lt;T1, T2&gt;"</c> string
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Pipes/PipeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public static IPipe<I, O> Then<I, O>(this IPipe<I, O> a, IPipe<O, O> b, bool whe
when ? a.Then(b) : a;

/// <summary>
/// Constructs a new pipe that will apply the specified `select` function to the output of the current pipe.
/// Constructs a new pipe that will apply the specified <c>select</c> function to the output of the current pipe.
/// </summary>
public static IPipe<I, O2> Then<I, O1, O2>(this IPipe<I, O1> a, Func<O1, O2> map) =>
a.Then(new FuncPipe<O1, O2>(map));

/// <summary>
/// Constructs a new pipe that will apply the specified `select` function to the output of the current pipe.
/// Constructs a new pipe that will apply the specified <c>select</c> function to the output of the current pipe.
/// </summary>
public static IPipe<I, O> Then<I, O>(this IPipe<I, O> a, Func<O, O> map, bool when) =>
when ? a.Then(map) : a;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Pipes/Unit.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Summary.Pipes;

/// <summary>
/// A void type that is similar to `void` keyword.
/// A void type that is similar to <c>void</c> keyword.
/// </summary>
public class Unit
{
Expand Down
10 changes: 5 additions & 5 deletions src/Core/Samples/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ public event Action Event2
/// <summary>
/// A simple method.
/// It contains two parameters:
/// - <paramref name="x" /> means `x`
/// - <paramref name="y" /> means `y`
/// - <paramref name="x" /> means <c>x</c>
/// - <paramref name="y" /> means <c>y</c>
/// It contains three type parameters:
/// - <typeparamref name="M0" /> is the first one
/// - <typeparamref name="M1" /> is the second one
/// - <typeparamref name="M2" /> is the third one
/// </summary>
/// <param name="x">The `x` of the method.</param>
/// <param name="y">The `y` of the method.</param>
/// <param name="x">The <c>x</c> of the method.</param>
/// <param name="y">The <c>y</c> of the method.</param>
/// <typeparam name="M0">The first type parameter of the method.</typeparam>
/// <typeparam name="M1">The second type parameter of the method.</typeparam>
/// <typeparam name="M2">The third type parameter of the method.</typeparam>
/// <returns>The `TimeSpan` instance.</returns>
/// <returns>The <c>TimeSpan</c> instance.</returns>
public TimeSpan Method<M0, M1, M2>(int x, string y) =>
TimeSpan.Zero;

Expand Down

0 comments on commit bcff8c0

Please sign in to comment.