Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Documentation site for all LinqToDB projects, hosted at [linq2db.github.io](https://linq2db.github.io). Built with a **custom DocFX binary** (`docfx/docfx`) — not the standard NuGet/dotnet tool version. The custom build adds `globalPrefix` support to handle namespace conflicts across EF Core versions (dotnet/docfx#8966).

## Build Commands

```bash
# Update submodules to latest release (required before first build)
./submodules.cmd # runs: git submodule update --remote --merge

# Local build — generates static site in _site/
./local.cmd # runs build.ps1 with deploy=$false

# Manual build
powershell ./build.ps1 -deploy $false # build only
powershell ./build.ps1 -deploy $true # build + deploy (needs GITHUB_PAT env var)
```

Requires **.NET SDK 10.0** (see `global.json`). The build pre-compiles `LinqToDB.FSharp` as a DocFX workaround before running `./docfx/docfx source/docfx.json`.

## Documentation Structure

- **`source/index.md`** — Landing page with hero, interactive SQL demo, navigation cards
- **`source/documentation/`** — Structured guides (Markdown + `toc.yml` per section)
- `get-started/` — Installation and setup guides
- `general/` — Core concepts (connections, interceptors, metrics, database support)
- `sql/` — SQL features (bulk copy, CTEs, MERGE, joins, window functions)
- `how-to/` — Task-oriented guides
- `project/` — Contributing, issue reporting
- **`source/articles/`** — Blog/news content (release notes)
- **`source/api/`** — Auto-generated API docs (output of DocFX metadata extraction, not hand-edited)
- **`source/templates/custom/`** — CSS/JS overrides for DocFX modern template
- **`_site/`** — Generated static HTML output (gitignored)

## Landing Page SQL Demo

The landing page has a tabbed demo showing C# LINQ → generated SQL. See **`tools/sql-demo/README.md`** for full maintenance guide. Key points:

- SQL is pre-generated using `ToSqlQuery()` from the linq2db library
- Test file: `tools/sql-demo/SqlDemoGenerator.cs` — copy to `linq2db/Tests/Tests.Playground/` to run
- Tabs are pure CSS (radio inputs + `:checked` selectors), no JavaScript
- Use `&#10;` instead of blank lines inside `<pre>` blocks (DocFX wraps blank lines in `<p>` tags)

## Key Configuration Files

- **`source/docfx.json`** — Main DocFX config: 17 metadata sources (API namespaces) + build settings
- **`source/toc.yml`** — Top-level navigation (Documentation, Articles, API)
- **`source/filter.yml`** — API filtering rules

## Submodules

Source code for API documentation lives in `submodules/`:
- **`linq2db`** (release branch) — Main ORM library, F# extensions, tools, scaffold, remote packages
- **`LinqToDB.Identity`** (master) — ASP.NET Identity provider
- **`linq2db.EntityFrameworkCore`** — EF Core 3/8/9/10 integration
- **`IdentityServer4.LinqToDB`** — IdentityServer4 integration

Run `./submodules.cmd` after cloning or when API docs need updating.

## CI/CD (Azure Pipelines)

- **`azure-pipelines.yml`** — Triggers on master push: builds and deploys to linq2db.github.io
- **`azure-pipelines.build.yml`** — Triggers on PRs: build-only validation

Both use Windows 2022 VM with .NET SDK 10.x.

## Editor Conventions

Per `.editorconfig`: tab indentation (size 4), CRLF line endings, final newline required.
19 changes: 19 additions & 0 deletions source/articles/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Articles
_disableAffix: true
_disableNextArticle: true
---

# Articles

<div class="row g-4 my-4">
<div class="col-md-6 col-lg-4">
<div class="card h-100 doc-card">
<div class="card-body">
<h4 class="card-title"><i class="bi bi-megaphone"></i> Release Notes</h4>
<p class="card-text">Release history, changelogs, and project roadmap.</p>
<a href="https://github.com/linq2db/linq2db/wiki/Releases-and-Roadmap" class="stretched-link"></a>
</div>
</div>
</div>
</div>
16 changes: 0 additions & 16 deletions source/articles/toc.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
- name: Release Notes
href: https://github.com/linq2db/linq2db/wiki/Releases-and-Roadmap
- name: Get Started
href: get-started/toc.yml
- name: General Topics
href: general/toc.yml
- name: SQL
href: sql/toc.yml
- name: How To
href: how-to/toc.yml
- name: CLI Scaffold Tool
href: CLI.md
- name: T4 Templates (Obsoleted)
href: T4.md
- name: FAQ
href: FAQ.md
- name: Project
href: project/toc.yml
13 changes: 11 additions & 2 deletions source/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"files": [
"api/**/*.{md,yml}",
"articles/**/*.{md,yml}",
"documentation/**/*.{md,yml}",
"toc.yml",
"*.md"
]
Expand All @@ -231,7 +232,7 @@
"images/**",
"**.png",
"**.jpg",
"articles/cli-help.txt",
"documentation/cli-help.txt",
".nojekyll"
]
}
Expand All @@ -247,7 +248,15 @@
"_appFaviconPath": "images/icon.ico",
"_enableSearch": true,
"_disableNewTab": false,
"_disableContribution": true
"_gitContribute": {
"repo": "https://github.com/linq2db/docs",
"branch": "master"
}
},
"fileMetadata": {
"_disableContribution": {
"api/**/**.yml": true
}
},
"fileMetadataFiles": [],
"template": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
69 changes: 69 additions & 0 deletions source/documentation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: Documentation
_disableAffix: true
_disableNextArticle: true
---

# Linq To DB Documentation

<div class="row g-4 my-4">
<div class="col-md-6 col-lg-4">
<div class="card h-100 doc-card">
<div class="card-body">
<h4 class="card-title"><i class="bi bi-rocket-takeoff"></i> Get Started</h4>
<p class="card-text">Install Linq To DB and create your first project. Guides for ASP.NET Core and existing databases.</p>
<a href="get-started/install/index.md" class="stretched-link"></a>
</div>
</div>
</div>

<div class="col-md-6 col-lg-4">
<div class="card h-100 doc-card">
<div class="card-body">
<h4 class="card-title"><i class="bi bi-book"></i> General Topics</h4>
<p class="card-text">Database support, managing connections, interceptors, metrics, and core concepts.</p>
<a href="general/databases.md" class="stretched-link"></a>
</div>
</div>
</div>

<div class="col-md-6 col-lg-4">
<div class="card h-100 doc-card">
<div class="card-body">
<h4 class="card-title"><i class="bi bi-database"></i> SQL</h4>
<p class="card-text">Join operators, CTEs, Bulk Copy, Window Functions, MERGE operations, and Query Extensions.</p>
<a href="sql/Join-Operators.md" class="stretched-link"></a>
</div>
</div>
</div>

<div class="col-md-6 col-lg-4">
<div class="card h-100 doc-card">
<div class="card-body">
<h4 class="card-title"><i class="bi bi-tools"></i> How-To Guides</h4>
<p class="card-text">Practical guides for custom SQL conversions, attribute mapping, and common tasks.</p>
<a href="how-to/teach-linq2db-convert-custom-net-code-to-sql.md" class="stretched-link"></a>
</div>
</div>
</div>

<div class="col-md-6 col-lg-4">
<div class="card h-100 doc-card">
<div class="card-body">
<h4 class="card-title"><i class="bi bi-terminal"></i> CLI Scaffold Tool</h4>
<p class="card-text">Generate data model from existing database using the command-line scaffold tool.</p>
<a href="CLI.md" class="stretched-link"></a>
</div>
</div>
</div>

<div class="col-md-6 col-lg-4">
<div class="card h-100 doc-card">
<div class="card-body">
<h4 class="card-title"><i class="bi bi-question-circle"></i> FAQ</h4>
<p class="card-text">Frequently asked questions and common issues.</p>
<a href="FAQ.md" class="stretched-link"></a>
</div>
</div>
</div>
</div>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions source/documentation/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: Get Started
href: get-started/toc.yml
- name: General Topics
href: general/toc.yml
- name: SQL
href: sql/toc.yml
- name: How To
href: how-to/toc.yml
- name: CLI Scaffold Tool
href: CLI.md
- name: T4 Templates (Obsoleted)
href: T4.md
- name: FAQ
href: FAQ.md
- name: Project
href: project/toc.yml
Loading