Ociaw.VersionedDocs
0.1.0-beta.1
dotnet add package Ociaw.VersionedDocs --version 0.1.0-beta.1
NuGet\Install-Package Ociaw.VersionedDocs -Version 0.1.0-beta.1
<PackageReference Include="Ociaw.VersionedDocs" Version="0.1.0-beta.1" />
paket add Ociaw.VersionedDocs --version 0.1.0-beta.1
#r "nuget: Ociaw.VersionedDocs, 0.1.0-beta.1"
// Install Ociaw.VersionedDocs as a Cake Addin #addin nuget:?package=Ociaw.VersionedDocs&version=0.1.0-beta.1&prerelease // Install Ociaw.VersionedDocs as a Cake Tool #tool nuget:?package=Ociaw.VersionedDocs&version=0.1.0-beta.1&prerelease
VersionedDocs
VersionDocs builds on top of Statiq Docs to add support for versioned APIs. This allows documentation for
multiple API versions to exist on the same site at once. For example, two separate library versions can be documented independently at
/api/v1.0
and /api/v2.0
.
Usage
Instead of calling .CreateDocs()
, call .CreateVersionedDocs()
:
using using Ociaw.VersionedDocs;
await Bootstrapper.Factory
.CreateVersionedDocs(args)
.RunAsync();
You'll also need a theme supporting versioning, such as Verdoct or a modified Docable.
In your settings.yml file you'll need to define several settings - RepositoryType, RepositoryPath, and Versions.
Git Example:
RepositoryType: Git # Optional since git is the default
RepositoryPath: https://github.com/ociaw/RandN.git
Versions:
master: master
v0.3.0: v0.3.0
Mercurial Example:
RepositoryType: Hg
RepositoryPath: https://hg.sr.ht/~ociaw/RandN
Versions:
master: bookmark(master)
v0.3.0: tag(v0.3.0)
Settings
- Versions - a map of RevisionNames to RevisionSelectors
- RepositoryType:
string
- the type of repository used, can either beHg
orGit
; defaults to "Git" - RepositoryPath:
string
- the path of the repository to clone - GitExecutable:
string
- the path to the git executable; defaults to "git" - HgExecutable:
string
- the path to the hg executable; defaults to "hg"
Revision Selectors
Revision selector syntax varies by VCS type. For mercurial, revset syntax can be used. Git accepts the name of branches and tags.
Document Keys
These keys are added to API symbol documents and can be used in themes.
- RevisionName:
string
- The name of the revision that the document is from - RevisionId:
string
- The ID, or commit hash, of the selected revision - RevisionTimestamp:
DateTimeOffset
- The timestamp at which the selected revision was committed
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Statiq.Docs (>= 1.0.0-beta.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.0-beta.1 | 157 | 3/2/2023 |
Initial release