Skip to content

Commit f91a33f

Browse files
authored
Merge pull request #54 from WebFreak001/material-docs
replace everything with mkdocs (customized material theme)
2 parents 29b51e0 + 15337dc commit f91a33f

Some content is hidden

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

88 files changed

+3941
-6251
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
root = true
22

3-
[*.{c,css,h,d,di,dd,dt,js,json}]
3+
[*.md]
44
end_of_line = lf
55
insert_final_newline = true
6-
indent_style = tab
6+
indent_style = space
77
indent_size = 4
88
trim_trailing_whitespace = true
99
charset = utf-8

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
/.project
2-
/.dub
3-
/__test__library__
4-
/dub-docs
5-
*.exe
6-
log.txt
7-
settings.json
1+
site/
2+
docs/cli-reference/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "dub"]
2+
path = dub
3+
url = https://github.com/dlang/dub.git

README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,32 @@ Documentation for [dub](https://github.com/dlang/dub/) packages, see <https://du
55

66
For the package registry, see https://code.dlang.org
77

8-
How to build & run locally
9-
--------------------------
8+
## Contributing
9+
10+
The documentation should be written using clear english, preferably avoiding addressing the reader with `"you"`, but rather using the passive form.
11+
12+
The "dub-guide" folder (called DUB Guide) should contain quick summaries for the experienced user to quickly look up features, but also for the casual user to understand how most things work. Explanation should be kept short and concise. Whenever there are things that might not be completely clear, example images, CLI output or full project file structures should be provided.
13+
14+
The "dub-reference" folder (called DUB Reference) should contain everything there is to know about DUB for the user. Everything should try to contain example recipes, example code, example output, so users know what to expect using things.
15+
16+
Try not to duplicate information from the guide and the reference, but rather give short summaries in the guide and link to the reference for more in-depth explanation.
17+
18+
The CLI reference is auto-generated and can be improved by improving the man page generator in the DUB project. (currently the markdown output is not yet PRd / merged into master there, so try to wait a little bit for this first)
19+
20+
The intro pages should show everything to get started and not much more, to not overwhelm the user.
21+
22+
### Local development
23+
24+
To work on docs locally:
1025

1126
```
12-
dub
27+
# you might want to create a virtualenv if you work with python or other mkdocs sites a lot
28+
python3 -m pip install -r requirements.txt
29+
mkdocs serve
1330
```
1431

15-
Pages
16-
-----
17-
Documentation under `views/` is written in `diet-ng` template format,
18-
see https://code.dlang.org/packages/diet-ng.
32+
and to build static pages to distribute:
33+
34+
```
35+
mkdocs build
36+
```

docs/dub-guide/building.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Building
2+
3+
!!! note "Work-in-Progress Documentation"
4+
5+
The content on this page is not yet fully finished.
6+
7+
Tracking issue: <https://github.com/dlang/dub-docs/issues/57>
8+
9+
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/contributing.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to DUB
2+
3+
## Contributing to the CLI tool
4+
5+
You can find the source code for the DUB CLI tool ([dub(1)](../cli-reference/dub.md)) on GitHub:
6+
7+
[https://github.com/dlang/dub](https://github.com/dlang/dub)
8+
9+
Find the instructions to build from source in the README there or in the [installation](../getting-started/install.md) section in this documentation.
10+
11+
## Contributing to the registry / website
12+
13+
The registry / website source code for DUB ([https://code.dlang.org](https://code.dlang.org)) is available on GitHub:
14+
15+
[https://github.com/dlang/dub-registry](https://github.com/dlang/dub-registry)
16+
17+
For the registry you will need to setup a MongoDB server and setup a GitHub auth token to put into the server config for API requests.
18+
19+
For more information see [Registries](../dub-reference/registries.md).
20+
21+
## Contributing to this documentation
22+
23+
The documentation pages you are reading right now are also available on GitHub:
24+
25+
[https://github.com/dlang/dub-docs](https://github.com/dlang/dub-docs)

docs/dub-guide/plugins_dlls.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Creating shared libraries / DLLs
2+
3+
!!! note "Work-in-Progress Documentation"
4+
5+
The content on this page is not yet fully finished.
6+
7+
Tracking issue: <https://github.com/dlang/dub-docs/issues/62>

docs/dub-guide/publishing.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Publishing packages
2+
3+
## Creating the project
4+
5+
To create a DUB compatible project, the easiest way is to use the dub executable. [`$ dub init myproject`](../cli-reference/dub-init.md) will create a new folder `myproject` that contains the recommended skeleton and a basic `dub.json` or `dub.sdl` file. Running [`$ dub`](../cli-reference/dub.md) from this directory will build and run the empty project.
6+
7+
You should then adjust the package recipe (`dub.json` / `dub.sdl`) to fit the project. Especially the [authors], [copyright], [license] and [description] fields should be properly filled out before publishing. For details about the format of this file, see the [recipe page](../dub-reference/recipe.md).
8+
9+
## Registering with the registry
10+
11+
If you want to publish your project, simply put the contents into a repository and push it to [GitHub](https://github.com/), [GitLab](https://gitlab.com/) or [Bitbucket](https://bitbucket.org/). You can then [register an account](https://code.dlang.org/register) on DUB and register the package using your GitHub/GitLab/Bitbucket user name (or organization) and the project name. Anyone who adds the name of your project as a dependency to his/her package recipe will automatically have the contents of your git repository available to his/her project.
12+
13+
## Version tags
14+
15+
The repository will be monitored for changes and new version tags. To add a new version, just create a [git tag](todo-link-git-tag.md) with a name of the form `v1.2.3`, where `1.2.3` should be changed to the actual version number, following the [SemVer specification](https://semver.org). About twice per hour, the repository will be queried for new tags and any detected version will be made available on the registry.
16+
17+
Furthermore, all named branches will be available as special rolling versions of the form `~master` (in case of the git "master" branch). However, those should never directly be used to refer to dependencies. Use those only in dub.selections.json (see [dub-select(1)](../cli-reference/dub-select.md)) or for version overrides (see [dub-add-override(1)](../cli-reference/dub-add-override.md)).
18+
19+
## Private repositories
20+
21+
The [DUB registry](https://github.com/dlang/dub-registry) project can also be used as a private service. The settings file can be configured with credentials for a private repository hosting service instance, so that packages are fetched from the LAN, or from a private cloud based repository. Once a private instance is set up, all DUB clients need to be configured to make use of it by adding a `"registryUrls": ["http://dubregistry.example.com/"]` field with the appropriate URL(s) to your [dub settings file](../dub-reference/settings.md).
22+
23+
## Package Scoring
24+
25+
Search results are sorted by relevance. Relevance is a combined metric of the package score and the full-text search score, see [searchPackages(query)](https://github.com/dlang/dub-registry/blob/01cc896df7a5fa48cf65/source/dubregistry/dbcontroller.d#L239-L258). At the moment the package score is a number between `0.0` and `5.0` based on the following metrics:
26+
27+
- Recent downloads (~50% weight)
28+
- Repo stars (~25% weight)
29+
- Repo watchers (~25% weight)
30+
- Repo forks (~25% weight)
31+
- Repo open issues (~-25% weight)
32+
33+
Each of those metrics is log-scaled relative to their average before they are combined and capped with a non-linear tanh. See [computeScore()](https://github.com/dlang/dub-registry/blob/01cc896df7a5fa48cf65/source/dubregistry/registry.d#L576-L617) for more details. We appreciate any support in improving the package score.

0 commit comments

Comments
 (0)