Skip to content

Commit

Permalink
feat(readme): cargo dependency sample line
Browse files Browse the repository at this point in the history
  • Loading branch information
arcnmx committed Oct 16, 2023
1 parent 35357ee commit 91ed6f0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This crate provides a high-level interface to [PipeWire](https://pipewire.org/)'s [API](https://docs.pipewire.org/page_api.html) via [libwireplumber](https://pipewire.pages.freedesktop.org/wireplumber/index.html). Explore the [crate documentation](https://arcnmx.github.io/wireplumber.rs/main/wireplumber/) and the various [modules](https://arcnmx.github.io/wireplumber.rs/main/wireplumber/#modules) for information on how to start using WirePlumber with Rust.

``` toml
[dependencies]
wireplumber = { version = "0.1", features = ["v0_4_12"], git = "https://github.com/arcnmx/wireplumber.rs" }
```

# Examples

Some [examples](../examples/) are provided that can be built and run via Cargo:
Expand Down
3 changes: 3 additions & 0 deletions ci/readme/attrs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
:badge-license: https://img.shields.io/badge/license-MIT-ff69b4.svg?style=flat-square
:relative-tree: {relative-blob}
:release: main
:repository: https://github.com/arcnmx/wireplumber.rs
:source-highlighter: highlight.js
:url-crates: https://crates.io/crates/{crate}
:url-docs: https://arcnmx.github.io/wireplumber.rs/{release}/{crate}/
:url-docs-modules: {url-docs}#modules
:url-pw: https://pipewire.org/
:url-pw-api: https://docs.pipewire.org/page_api.html
:url-wp: https://pipewire.pages.freedesktop.org/wireplumber/index.html
:wprs-versionfeature: v0_4_12
:wprs-versionreq: 0.1
15 changes: 15 additions & 0 deletions ci/readme/content.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
This crate provides a high-level interface to {url-pw}[PipeWire]'s {url-pw-api}[API] via {url-wp}[libwireplumber].
Explore the {url-docs}[crate documentation] and the various {url-docs-modules}[modules] for information on how to start using WirePlumber with Rust.
ifeval::["{profile}" != "github"]
[source,toml,subs=attributes+]
----
[dependencies]
wireplumber = { version = "{wprs-versionreq}", features = ["{wprs-versionfeature}"] }
----
endif::[]
ifeval::["{profile}" == "github"]
[source,toml,subs=attributes+]
----
[dependencies]
wireplumber = { version = "{wprs-versionreq}", features = ["{wprs-versionfeature}"], git = "{repository}" }
----
endif::[]
== Examples
Some link:{relative-tree}examples/[examples] are provided that can be built and run via Cargo:
Expand Down
9 changes: 8 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
readme-inc = "${wpdev-readme-src}/ci/readme/";
# this file ends up in `.github/README.md`, so its relative links must be adjusted to compensate
relative-blob = "../";
profile = "github";
};
};
wpdev-readme-sys-github = { rust'builders, wpdev-readme-src }: rust'builders.adoc2md {
Expand All @@ -338,6 +339,7 @@
readme-inc = "${wpdev-readme-src}/ci/readme/";
# this file ends up in `sys/.github/README.md`, so its relative links must be adjusted to compensate
relative-blob = "../../";
profile = "github";
};
};
wpdev-readme-examples-github = { rust'builders, wpdev-readme-src }: rust'builders.adoc2md {
Expand All @@ -346,13 +348,15 @@
readme-inc = "${wpdev-readme-src}/ci/readme/";
# this file ends up in `examples/.github/README.md`, so its relative links must be adjusted to compensate
relative-blob = "../../";
profile = "github";
};
};
wpdev-readme-package = { rust'builders, wpdev-readme, wpdev-readme-src }: rust'builders.adoc2md {
src = "${wpdev-readme-src}/src/README.adoc";
attributes = let
inherit (self.lib.crate.package) repository;
inherit (self.lib.asciidocAttributes) repository;
in rec {
profile = "package";
readme-inc = "${wpdev-readme-src}/ci/readme/";
release = self.lib.releaseTag;
relative-tree = "${repository}/tree/${release}/";
Expand Down Expand Up @@ -383,6 +387,9 @@
"0.4.11" "0.4.12"
];
asciidocAttributes = {
inherit (self.lib.crate.package) repository;
wprs-versionreq = (if versions.major self.lib.version == "0" then versions.majorMinor else versions.major) self.lib.version;
wprs-versionfeature = self.lib.versionFeatureName (last self.lib.featureVersions);
source-highlighter = "highlight.js";
release = "main";
relative-tree = "{relative-blob}";
Expand Down
5 changes: 5 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This crate provides a high-level interface to [PipeWire](https://pipewire.org/)'s [API](https://docs.pipewire.org/page_api.html) via [libwireplumber](https://pipewire.pages.freedesktop.org/wireplumber/index.html). Explore the [crate documentation](https://arcnmx.github.io/wireplumber.rs/v0.1.0/wireplumber/) and the various [modules](https://arcnmx.github.io/wireplumber.rs/v0.1.0/wireplumber/#modules) for information on how to start using WirePlumber with Rust.

``` toml
[dependencies]
wireplumber = { version = "0.1", features = ["v0_4_12"] }
```

# Examples

Some [examples](https://github.com/arcnmx/wireplumber.rs/tree/v0.1.0/examples/) are provided that can be built and run via Cargo:
Expand Down

0 comments on commit 91ed6f0

Please sign in to comment.