dotnet / dotnet/dotnet-api-docs

Consider formatting code for viewability

Open
#8,374 1 comment 0 reactions 0 assignees View on GitHub
area-Meta Pri3
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

We have a rule that snippets shouldn't require a horizontal scroll bar on tablet sized devices. We simulate tablet size by making the widest browser window that doesn't have a left or right TOC. There are obvious exceptions, but in general the snippets in the ASP.NET Core docs rarely need a horizontal scroll bar for tablet sized displays. Consider [this sample](https://docs.microsoft.com/en-us/dotnet/api/system.stringcomparison?view=net-6.0#examples) with [this snippet](https://github.com/dotnet/dotnet-api-docs/blob/main/snippets/csharp/System/String/Equals/equals_ex3.cs) on even a large monitor. The sample is so long you don't even get to the horizontal scroll bar. I can't see the code and can't even scroll. The new namespace syntax in C# 10 helps, but often you need to break up long horizontal lines.

![image](https://user-images.githubusercontent.com/3605364/189444654-12014650-82f9-4490-9c3c-49ebdf745d14.png)

cc @gewarren @BillWagner

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.