dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.53k stars 25.3k forks source link

Add [!INCLUDE[](~/includes/not-latest-version.md)] to all non-blazor topics #32886

Open Rick-Anderson opened 2 months ago

Rick-Anderson commented 2 months ago

Add [!INCLUDE[](~/includes/not-latest-version.md)] to all non-blazor topics

Skip What's new and a few others that are not version specific.

Use a regex to do the work. cc @tdykstra @guardrex

Update of instructions by WadePickett: After some discussion, it sounds like there are 3 conditions involved:

If the doc meta data at the top of the page has a monikerRange of: monikerRange: '>= aspnetcore-8.0'

Then insert this just below the H1 (#):

<!-- UPDATE 9.0 Activate after release and INCLUDE is updated

[!INCLUDE[](~/includes/not-latest-version.md)]

-->

If the doc meta data at the top of the page has a monikerRange of: :::moniker range=">= aspnetcore-9.0"

Then insert this just below the H1 (#)

[!INCLUDE[](~/includes/not-ga-yet.md)]

<!-- Uncomment this when 9.0 is the default value in the version selector and delete not-ga-yet.md

[!INCLUDE[](~/includes/not-latest-version.md)] 

-->

If the doc meta data at the top of the page has a monikerRange that is anything <8.0 or no monikerRange at the top of the page at all: Then insert this just below the H1 (#):

[!INCLUDE[](~/includes/not-latest-version.md)]

Other Critera: Only files that meet all of the following conditions receive the inserted text:


Associated WorkItem - 286789

guardrex commented 2 months ago

Confirming AFAIK, the ones in the blazor folder are good, except for new articles that were added this year, which will get the INCLUDE when .NET 9 docs release (I've added a tracking item reminder for myself to those articles).

The three outside of the blazor node ...

... don't have it, and I suppose it's best to let you deal with those in due course of adding the INCLUDE in those folders.

wadepickett commented 2 months ago

Note: This has been added to most of the docs, I am to find the remaining ones that didn't get one.

wadepickett commented 1 month ago

Going through this right now.
@Rick-Anderson, much of the docs in /security are not version specific. No monikerRange in metadata and no ::moniker range inline. For cases like that throughout the repo where neither exist can I assume you do not want to insert [!INCLUDE]?

wadepickett commented 1 month ago

It looks like the include files assume a minimum monikerRange provided in the metadata. Otherwise you get errors. I ran into old topics that do not have a minimum range, I will set those aside for last to review and assign minimum ranges, then apply the includes. That sub-portion will have to be tracked in a new issue. I didn't reserve time to account for that condition, (nor for the other criteria figured out as we went along.)

wadepickett commented 3 weeks ago

There are a fair number of topics that are not compatible with the include as is. Re-sorting through those, and trying again. Will do first the ones that can be without error. The rest are going to require fixes to their moniker ranges, which takes some time to determine what ranges the topics was intended to be targeted for. Most of these problematic ones are topics that that have been around from 1.x through 2.x or have had no minimum range ever declared.