Docs: C# spec links in C# reference should point to specific parts of the spec

Created on 25 Sep 2018  Â·  8Comments  Â·  Source: dotnet/docs

Many articles in the C# reference contain the following section:

C# Language Specification

For more information, see the C# Language Specification. The language specification is the definitive source for C# syntax and usage.

While that link is useful, even more useful would be a link to the specific part of the specification that talks about the same topic as the article (e.g. the sizeof article would link to Unsafe code, section The sizeof operator), especially since the spec is large and the location of the right section might not be obvious (e.g. the sizeof operator is not specified along with most operators in Expressions, but is instead in Unsafe Code).

I suspect that this wasn't done in the past, because the spec used to be a Word file. But now that it's a subsection of docs.MS, linking to a specific part is easy.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - C# Guide P1

Most helpful comment

I also think this is a good idea.

Rather than re-open this issue, I'd like to do the following:

  1. Do a quick file search to find all locations with the generic include.
  2. Create an issue that requests the following for each file or folder:

    • Add proper deep links into the spec if they are not already present.

    • Remove the general link, if that's appropriate.

    • Check off that file in the issue.

I'd think one PR per folder would be reasonable.

Thoughts on the plan? If you both approve, I'll create the master issue later today. /cc @svick @pkulikov

All 8 comments

I agree, @svick; the links should point to a specific part of the spec. I've added this issue to the backlog, as well as to the community contributor's project.

Excellent!

I'd be happy to take this one

I think this issue should be reopened, since not all instances were fixed.

As far as I can tell, https://github.com/dotnet/docs/pull/8221 did good work by fixing articles that reference the spec directly. But there are still many articles that use [!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)] to link to it indirectly. I think those should be improved too.

Agree with @svick. These are almost all keyword and operator articles. While I'm going through the operator articles to move snippets to the samples repo, I'll update links to the C# spec as well. So, an update of the keyword articles is up-for-grabs.

I also think this is a good idea.

Rather than re-open this issue, I'd like to do the following:

  1. Do a quick file search to find all locations with the generic include.
  2. Create an issue that requests the following for each file or folder:

    • Add proper deep links into the spec if they are not already present.

    • Remove the general link, if that's appropriate.

    • Check off that file in the issue.

I'd think one PR per folder would be reasonable.

Thoughts on the plan? If you both approve, I'll create the master issue later today. /cc @svick @pkulikov

@BillWagner that sounds like a good plan

@BillWagner Sounds good to me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ite-klass picture ite-klass  Â·  3Comments

Eilon picture Eilon  Â·  3Comments

stanuku picture stanuku  Â·  3Comments

garfbradaz picture garfbradaz  Â·  3Comments

gmatv picture gmatv  Â·  3Comments