Skip to content

Commit ae76117

Browse files
committed
add old site redirects
1 parent 488bb45 commit ae76117

File tree

8 files changed

+246
-6
lines changed

8 files changed

+246
-6
lines changed

docs/dub-guide/building.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,41 @@
77
Tracking issue: <https://github.com/WebFreak001/dub-docs-v2/issues/4>
88

99
For the command to build your application, see [`dub build`](../cli-reference/dub-build.md) and [`dub run`](../cli-reference/dub-run.md)
10+
11+
```
12+
dub build
13+
```
14+
15+
If you have multiple [configurations](../dub-reference/configurations.md) defined in your recipe, you might need to specify which configuration to build:
16+
17+
```
18+
dub build --config=server
19+
```
20+
21+
Or if you want to build a [sub-package](../dub-reference/subpackages.md), you can do so from the root package as well:
22+
23+
```
24+
dub build :mysubpackage
25+
```
26+
27+
## Running
28+
29+
For all of the samples above, you can swap out `dub build` with [`dub run`](../cli-reference/dub-run.md) to both **build and run** your application in a single command line call.
30+
31+
This only works for packages that have an `executable` [target type](../dub-reference/target_types.md), which may be [automatically inferred](../dub-reference/configurations.md#default-configuration) by `autodetect`.
32+
33+
```
34+
dub run
35+
dub run --config=server
36+
dub run :mysubpackage
37+
```
38+
39+
### Passing arguments to the application
40+
41+
For any of the above `dub run` calls you can also specify your own command line arguments by separating DUB's arguments from your own using `--` between them:
42+
43+
```
44+
dub run -- my app args
45+
dub run --config=server -- --config=ignored-by-dub
46+
dub run :mysubpackage -- works universally
47+
```

docs/dub-guide/recipe.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ In all documents in the documentation you can switch between dub.json and dub.sd
4747

4848
Please keep the description concise (not more than 100 characters) and avoid including unspecific information such as the fact that the package is written in D. The same goes for the package name - since all DUB packages are written in D, it's usually better to avoid mentioning D explicitly, unless the package is for example a high-level wrapper around a C/C++ library.
4949

50-
!!! hint "Just an excerpt"
51-
These are just the boiled down documentation of the available fields, refer to the [recipe](../dub-reference/recipe.md) page in the DUB reference for details to any given field.
52-
5350
## Package settings
5451

5552
Package settings (top-level settings) such as name, description, homepage,
@@ -98,6 +95,9 @@ See also: [Platform specifications](../dub-reference/platform_specifications.md)
9895

9996
## Build settings
10097

98+
!!! hint "Just an excerpt"
99+
These are just the boiled down documentation of the available fields, refer to the [recipe](../dub-reference/recipe.md) page in the DUB reference for details to any given field.
100+
101101
Build settings influence the command line options passed to the compiler and linker. All settings are optional.
102102

103103
=== "dub.sdl"

docs/dub-reference/dependencies.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,25 @@ See [version specifiers](./build_settings.md#version-specifiers).
4040
### `version` + `optional` + `default=false`
4141
### `path`
4242

43-
Note: this is best used in sub-packages, avoid going outside of repository bounds for public projects.
43+
!!! note
44+
45+
For public projects, avoid leaving your package root, so that users can build your package without needing to manage external dependencies.
46+
47+
Inside sub-packages you can refer to the parent package using `path=".."` (or elsewhere, depending on folder structure), to avoid DUB accidentally looking up a different package location whenever you run DUB from inside the sub-package folder.
4448

4549
### `repository`
4650
#### Git repositories
4751

4852
### `dflags`
4953
## `dub.selections.json`
5054
## `dub add-path`
55+
56+
CLI docs: [`dub add-path`](../cli-reference/dub-add-path.md)
57+
5158
## `dub add-local`
59+
60+
CLI docs: [`dub add-local`](../cli-reference/dub-add-local.md)
61+
5262
## Dependency/version resolution
5363
## Per-configuration dependencies
5464

@@ -60,4 +70,39 @@ Note: this is best used in sub-packages, avoid going outside of repository bound
6070

6171
Tracking issue: <https://github.com/WebFreak001/dub-docs-v2/issues/2>
6272

63-
Upstream documentation: <https://dub.pm/advanced_usage>
73+
Projects can have additional special dependencies for specific configurations.
74+
75+
```json
76+
"configurations": [
77+
{
78+
"name": "myconfig",
79+
"dependencies": {
80+
"mydep": { "version": "*" }
81+
}
82+
}
83+
]
84+
```
85+
86+
DUB provides version identifier of dependencies for conditional compilation with [version conditions](https://dlang.org/spec/version.html#version). `Have_<dependency>` version identifier can be used for conditional compilation.
87+
88+
!!! note
89+
90+
Special characters other than identifier characters (`[a-z, A-Z, 0-9, _]`) in dependency name are replaced with an underscore (`_`) character in their version identifier.
91+
92+
```d
93+
version (Have_mydep) {
94+
// dependency "mydep" is being included
95+
import mydep;
96+
}
97+
version (Have_vibe_d_http) {
98+
// dependency "vibe-d:http" is being included
99+
}
100+
```
101+
102+
Note that your package has to somehow depend on the package for it to get these `Have_*` version identifiers. If you want to query for it without pulling in a new dependency, use optional dependencies:
103+
104+
```json
105+
"dependencies": {
106+
"vibe-d:http": { "optional": true, "version": "*" }
107+
}
108+
```

docs/dub-reference/subpackages.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66

77
Tracking issue: <https://github.com/WebFreak001/dub-docs-v2/issues/20>
88

9-
Upstream documentation: <https://dub.pm/advanced_usage>
9+
For adding sub-packages from the registry as a dependency, execute `dub add <packagename>:<subpackage>`
10+
11+
If you need to compile a sub-package only, use `dub build :<subpackage>`
12+

docs/link-upgrades.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
hide:
3+
- navigation
4+
- toc
5+
search:
6+
exclude: true
7+
---
8+
9+
10+
# Old Links
11+
12+
<a id="own-projects"></a>
13+
## Starting a new project
14+
15+
A tutorial how to create projects is available in the [Getting Started / First Steps](./getting-started/first-steps.md) section.
16+
17+
<a id="adding-deps"></a>
18+
## Adding a dependency
19+
20+
This was moved to [Getting Started / First Steps](./getting-started/first-steps.md#adding-a-dependency)
21+
22+
<a id="foreign-projects"></a>
23+
## Building a third-party project
24+
25+
This was moved to [Getting Started / First Steps](./getting-started/first-steps.md#building-a-third-party-project)
26+
27+
<a id="app-arguments"></a>
28+
## Pass commandline arguments to application
29+
30+
This was moved to [DUB Guide / Building](./dub-guide/building.md#passing-arguments-to-the-application)
31+
32+
<a id="single-file"></a>
33+
## Single-file packages
34+
35+
This was moved to [DUB Guide / Single-file packages](./dub-guide/single.md)
36+
37+
<a id="local-deps"></a>
38+
## Using dependencies not published on the registry
39+
40+
This was moved to [DUB Reference / Dependencies](./dub-reference/dependencies.md)
41+
42+
<a id="subpkg"></a>
43+
## Managing subpackages
44+
45+
This was moved to [DUB Reference / Sub-Packages](./dub-reference/subpackages.md)
46+
47+
<a id="have-version"></a>
48+
## Conditional compilation according to dependency presence
49+
50+
This was moved to [DUB Reference / Dependencies / Have_xyz](./dub-reference/dependencies.md#have_xyz)
51+
52+
<a id="advanced-usage"></a>
53+
## Advanced usage
54+
55+
This has been split up into [DUB Guide](./dub-guide/recipe.md) for overview about features and [DUB Reference](./dub-reference/recipe.md) for detailed information about each functionality.
56+
57+
<a id="standard-settings"></a>
58+
## Package settings (previously called: Global settings)
59+
60+
This has been moved into [DUB Reference / Package Settings](./dub-reference/package_settings.md)
61+
62+
<a id="build-settings"></a>
63+
## Build settings
64+
65+
This has been moved into [DUB Reference / Build Settings](./dub-reference/build_settings.md)
66+
67+
<a id="configurations"></a>
68+
## Configurations
69+
70+
This has been moved into [DUB Reference / Configurations](./dub-reference/configurations.md)
71+
72+
<a id="build-types"></a>
73+
## Build types
74+
75+
This has been moved into [DUB Reference / Build types](./dub-reference/buildtypes.md)
76+
77+
<a id="toolchain-requirements"></a>
78+
## Toolchain requirements
79+
80+
This has been moved into [DUB Reference / Package Settings / `toolchainRequirements`](./dub-reference/package_settings.md#toolchainrequirements)
81+
82+
<a id="project-creation"></a>
83+
## Creating the project (publishing)
84+
85+
This has been moved into [DUB Guide / Publishing](./dub-guide/publishing.md)
86+
87+
<a id="register"></a>
88+
## Registering with the registry (publishing)
89+
90+
This has been moved into [DUB Guide / Publishing](./dub-guide/publishing.md#registering-with-the-registry)
91+
92+
<a id="versions"></a>
93+
## Version tags (publishing)
94+
95+
This has been moved into [DUB Guide / Publishing](./dub-guide/publishing.md#version-tags)
96+
97+
<a id="private-repositories"></a>
98+
## Private repositories (publishing)
99+
100+
This has been moved into [DUB Guide / Publishing](./dub-guide/publishing.md#private-repositories)
101+
102+
<a id="package-scoring"></a>
103+
## Package Scoring
104+
105+
This has been moved into [DUB Guide / Publishing](./dub-guide/publishing.md#package-scoring)
106+
107+
<a id="publishing-packages"></a>
108+
## Publishing packages
109+
110+
This has been moved into [DUB Guide / Publishing](./dub-guide/publishing.md)
111+
112+
<a id="help-with-dub"></a>
113+
## Help with DUB"s development
114+
115+
This has been moved into [DUB Guide / Contributing](./dub-guide/contributing.md)
116+
117+
<a id="development-focus"></a>
118+
## Development focus
119+
120+
This page has been dropped and can be considered superseded by [DUB Guide / Contributing](./dub-guide/contributing.md)

docs/package-format-upgrades.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
hide:
3+
- navigation
4+
- toc
5+
search:
6+
exclude: true
7+
---
8+
9+
10+
# Migrate to new Recipe Documentation
11+
12+
The package format documentation has been split up into multiple pages that each more precisely document each individual setting with examples.
13+
14+
- General layout: [DUB Reference / Recipe](./dub-reference/recipe.md)
15+
- Package settings: [DUB Reference / Package settings](./dub-reference/package_settings.md)
16+
- **Build settings:** [DUB Reference / Build Settings](./dub-reference/build_settings.md)
17+
- Configurations: [DUB Reference / Configurations](./dub-reference/configurations.md)
18+
- Build types: [DUB Reference / Build Types](./dub-reference/buildtypes.md)
19+
20+
## Introducing **DUB Guide**
21+
22+
If you want to learn about the concepts first before diving into the detailed documentation, take a look at the [DUB Guide](./dub-guide/recipe.md) for a more gentle introduction into the package recipes, as well as tutorials that are made by use-case that will link to the reference page.

mkdocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ plugins:
3939
- search
4040
- git-revision-date-localized:
4141
enable_creation_date: true
42+
- redirects:
43+
redirect_maps:
44+
'getting_started.md': 'link-upgrades.md'
45+
'advanced_usage.md': 'link-upgrades.md'
46+
'develop.md': 'dub-guide/contributing.md'
47+
'package-suppliers.md': 'dub-reference/suppliers.md'
48+
'publish.md': 'dub-guide/publishing.md'
49+
'settings.md': 'dub-reference/settings.md'
50+
'commandline.md': 'cli-reference/dub.md'
51+
'package-format-json.md': 'package-format-upgrades.md'
52+
'package-format-sdl.md': 'package-format-upgrades.md'
4253

4354
markdown_extensions:
4455
- admonition

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
mkdocs~=1.3.1
22
mkdocs-material~=8.4.0
33
mkdocs-git-revision-date-localized-plugin~=1.1.0
4+
mkdocs-redirects~=1.2.1

0 commit comments

Comments
 (0)