Skip to content

Commit 81909d2

Browse files
authored
Merge pull request #455 from control-toolbox/move-ctsolvers-to-ctbase
Move CTSolvers core infrastructure to CTBase
2 parents 3d703d7 + 04fbb0d commit 81909d2

70 files changed

Lines changed: 18685 additions & 14 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/SpellCheck.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ on:
77
jobs:
88
call:
99
uses: control-toolbox/CTActions/.github/workflows/spell-check.yml@main
10+
with:
11+
config-path: '_typos.toml'

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "CTBase"
22
uuid = "54762871-cc72-4466-b8e8-f6c8b58076cd"
3-
version = "0.20.0-beta"
3+
version = "0.21.0-beta"
44
authors = ["Olivier Cots <olivier.cots@irit.fr>", "Jean-Baptiste Caillau <caillau@univ-cotedazur.fr>"]
55

66
[deps]

_typos.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[default]
2+
locale = "en"
3+
extend-ignore-re = [
4+
"adnlp_backen",
5+
"ipopt_backen",
6+
# Common variable names in our codebase
7+
"strat",
8+
"Strat",
9+
]
10+
11+
[files]
12+
extend-exclude = [
13+
"*.json",
14+
"*.toml",
15+
"*.svg",
16+
]

docs/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,22 @@ Preview after build: `npx serve docs/build/1 --listen 5173`
1313

1414
Documentation conventions and build workflow:
1515
[control-toolbox Handbook](https://github.com/control-toolbox/Handbook).
16+
17+
## `@repl` vs `@example` — ANSI color rule
18+
19+
DocumenterVitepress processes code block output differently depending on how it is produced:
20+
21+
| Block type | Output fence | ANSI codes | Result |
22+
| --- | --- | --- | --- |
23+
| `@example` | ` ```ansi ` | processed by Shiki | **colors render correctly** |
24+
| `@repl` | ` ```julia ` | parsed as Julia syntax | **raw escape sequences — ugly** |
25+
26+
**Rules:**
27+
28+
- Use **`@example`** when the output comes from a `show` method that uses ANSI colors
29+
(strategy instances, `StrategyOptions`, `StrategyMetadata`, `StrategyRegistry`, …).
30+
- Use **`@repl`** only when the output is a plain scalar value with no custom colored `show`
31+
(integers, booleans, symbols, plain strings, tuples of symbols, types).
32+
- Use **`@repl` + `try/catch # hide` + `showerror(IOContext(stdout, :color => false), e) # hide`**
33+
to display exceptions — the `showerror` call produces plain text that renders cleanly inside a
34+
`julia`-fenced block.

docs/api_reference.jl

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,56 @@ function generate_api_reference(src_dir::String)
2323
joinpath("Core", "types.jl"), joinpath("Core", "matrix_utils.jl"),
2424
joinpath("Core", "function_utils.jl"), joinpath("Core", "macros.jl"),
2525
)),
26-
(mod=CTBase.Interpolation, title="Interpolation", filename="interpolation", files=src(
27-
joinpath("Interpolation", "Interpolation.jl"), joinpath("Interpolation", "types.jl"),
28-
joinpath("Interpolation", "ctinterpolate.jl"), joinpath("Interpolation", "display.jl"),
29-
)),
3026
(mod=CTBase.Descriptions, title="Descriptions", filename="descriptions", files=src(
3127
joinpath("Descriptions", "Descriptions.jl"), joinpath("Descriptions", "types.jl"),
3228
joinpath("Descriptions", "similarity.jl"), joinpath("Descriptions", "display.jl"),
3329
joinpath("Descriptions", "catalog.jl"), joinpath("Descriptions", "complete.jl"),
3430
joinpath("Descriptions", "remove.jl"),
3531
)),
32+
(mod=CTBase.DevTools, title="DevTools", filename="devtools", files=src(
33+
joinpath("DevTools", "DevTools.jl"), joinpath("DevTools", "coverage_postprocessing.jl"),
34+
joinpath("DevTools", "documenter_reference.jl"), joinpath("DevTools", "test_runner.jl"),
35+
)),
3636
(mod=CTBase.Exceptions, title="Exceptions", filename="exceptions", files=src(
3737
joinpath("Exceptions", "Exceptions.jl"), joinpath("Exceptions", "types.jl"),
3838
joinpath("Exceptions", "display.jl"),
3939
)),
40+
(mod=CTBase.Interpolation, title="Interpolation", filename="interpolation", files=src(
41+
joinpath("Interpolation", "Interpolation.jl"), joinpath("Interpolation", "types.jl"),
42+
joinpath("Interpolation", "ctinterpolate.jl"), joinpath("Interpolation", "display.jl"),
43+
)),
44+
(mod=CTBase.Options, title="Options", filename="options", files=src(
45+
joinpath("Options", "Options.jl"), joinpath("Options", "not_provided.jl"),
46+
joinpath("Options", "option_value.jl"), joinpath("Options", "option_definition.jl"),
47+
joinpath("Options", "extraction.jl"),
48+
)),
49+
(mod=CTBase.Orchestration, title="Orchestration", filename="orchestration", files=src(
50+
joinpath("Orchestration", "Orchestration.jl"),
51+
joinpath("Orchestration", "disambiguation.jl"),
52+
joinpath("Orchestration", "builders.jl"),
53+
joinpath("Orchestration", "routing.jl"),
54+
)),
55+
(mod=CTBase.Strategies, title="Strategies", filename="strategies", files=src(
56+
joinpath("Strategies", "Strategies.jl"),
57+
joinpath("Strategies", "display_formatting.jl"),
58+
joinpath("Strategies", "contract", "abstract_strategy.jl"),
59+
joinpath("Strategies", "contract", "metadata.jl"),
60+
joinpath("Strategies", "contract", "strategy_options.jl"),
61+
joinpath("Strategies", "contract", "parameters.jl"),
62+
joinpath("Strategies", "api", "registry.jl"),
63+
joinpath("Strategies", "api", "describe_registry.jl"),
64+
joinpath("Strategies", "api", "introspection.jl"),
65+
joinpath("Strategies", "api", "bypass.jl"),
66+
joinpath("Strategies", "api", "builders.jl"),
67+
joinpath("Strategies", "api", "configuration.jl"),
68+
joinpath("Strategies", "api", "utilities.jl"),
69+
joinpath("Strategies", "api", "validation_helpers.jl"),
70+
joinpath("Strategies", "api", "disambiguation.jl"),
71+
)),
4072
(mod=CTBase.Unicode, title="Unicode", filename="unicode", files=src(
4173
joinpath("Unicode", "Unicode.jl"), joinpath("Unicode", "subscripts.jl"),
4274
joinpath("Unicode", "superscripts.jl"),
4375
)),
44-
(mod=CTBase.DevTools, title="DevTools", filename="devtools", files=src(
45-
joinpath("DevTools", "DevTools.jl"), joinpath("DevTools", "coverage_postprocessing.jl"),
46-
joinpath("DevTools", "documenter_reference.jl"), joinpath("DevTools", "test_runner.jl"),
47-
)),
4876
]
4977

5078
pages = [

docs/make.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,17 @@ with_api_reference(src_dir) do api_pages
6969
),
7070
pages=[
7171
"Getting Started" => "getting-started.md",
72-
"User Guides" => [
72+
"Core Concepts" => [
7373
"Descriptions" => joinpath("guide", "descriptions.md"),
7474
"Exceptions" => joinpath("guide", "exceptions.md"),
75+
],
76+
"Strategies & Options" => [
77+
"Options System" => joinpath("guide", "options-system.md"),
78+
"Implementing a Strategy" => joinpath("guide", "implementing-a-strategy.md"),
79+
"Strategy Parameters" => joinpath("guide", "strategy-parameters.md"),
80+
"Orchestration & Routing" => joinpath("guide", "orchestration-and-routing.md"),
81+
],
82+
"Developer Tools" => [
7583
"Test Runner" => joinpath("guide", "test-runner.md"),
7684
"Coverage" => joinpath("guide", "coverage.md"),
7785
"API Documentation" => joinpath("guide", "api-documentation.md"),

0 commit comments

Comments
 (0)