File: README.md

package info (click to toggle)
rust-gtk-rs-lgpl-docs 0.1.12-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 3,788 kB
  • sloc: makefile: 2
file content (59 lines) | stat: -rw-r--r-- 1,425 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# lgpl-docs

LGPL-licensed docs for Gtk-rs crates.

## Structure

The docs for each library come from two files:

 * `docs.rs` is maintained manually, its entries take precedence over the
   `vendor.rs` file. PRs should normally target this file.

 * `vendor.rs` is generated by [gir] via simple transformation of the upstream
   docs found in [GIR definitions]. It serves as a fallback, the docs in it are
   tailored for C not Rust. This file should not be hand-edited.

You can generate it as follows:

```
cd gir
cargo run --release -- -c ../your-repo/Gir.toml -d ../gir-files/ -o ../your-repo/ -m doc
```

Cairo, which lacks GIR definitions, doesn't have a `vendor.rs` file.

[GIR definitions]: https://github.com/gtk-rs/gir-files
[gir]: https://github.com/gtk-rs/gir

## Format

The format of the files is Markdown with extra metadata in HTML-like comments,
which ties each entry to a specific Rust item. For example, this rustdoc
snippet:

```rust
impl Button {
    /// Creates a new `Button` widget. To add a child widget to the button,
    /// use `Container::add`.
    ///
    /// # Returns
    ///
    /// The newly created `Button` widget.
    pub fn new() -> Button {
```

corresponds to this entry in `gtk/vendor.md`:

```
<!-- impl Button::fn new -->
Creates a new `Button` widget. To add a child widget to the button,
use `Container::add`.

# Returns

The newly created `Button` widget.
```

## License

LGPL