From ac29cab8e41f976f2f3528f216318a6605924146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?joseLu=C3=ADs?= Date: Sun, 6 Dec 2020 17:59:32 +0100 Subject: [PATCH] rust: fix documentation building; #1125 - Preparing to host the documentation in the github pages, at least until - libnotcurses-sys can get into Ubuntu 20. - fix Cargo.toml, add documentation link. - update documentation link in README. - improve lib doc comment, among others. --- rust/Cargo.toml | 6 +----- rust/README.md | 2 +- rust/src/lib.rs | 13 +++++++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 3096d6279..c3a6039a4 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -5,6 +5,7 @@ authors = ["nick black "] license = "Apache-2.0" edition = "2018" description = "Low-level Rust bindings for the notcurses C library." +documentation = "https://dankamongmen.github.io/notcurses/rustdoc/libnotcurses_sys/" repository = "https://github.com/dankamongmen/notcurses" homepage = "https://nick-black.com/dankwiki/index.php/Notcurses" links = "notcurses" @@ -29,8 +30,3 @@ pkg-config = ">= 0.3.18" [dev-dependencies] serial_test = ">= 0.5.0" serial_test_derive = ">= 0.5.0" -rand = "0.7.3" - - -[lib] -doctest = false diff --git a/rust/README.md b/rust/README.md index 359b2d5ce..8a3a8f6e7 100644 --- a/rust/README.md +++ b/rust/README.md @@ -1,6 +1,6 @@ # libnotcurses-sys [![Crate](https://img.shields.io/crates/v/libnotcurses-sys.svg)](https://crates.io/crates/libnotcurses-sys) -[![API](https://docs.rs/libnotcurses-sys/badge.svg)](https://docs.rs/libnotcurses-sys) +[![API](https://docs.rs/libnotcurses-sys/badge.svg)](https://dankamongmen.github.io/notcurses/rustdoc/libnotcurses_sys/) [![dependency status](https://deps.rs/crate/libnotcurses-sys/2.0.7/status.svg)](https://deps.rs/crate/libnotcurses-sys/2.0.7) [![MSRV: 1.40.0](https://flat.badgen.net/badge/MSRV/1.40.0/purple)](https://blog.rust-lang.org/2019/12/19/Rust-1.40.0.html) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 80dd286f6..1fee3bd1c 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,8 +1,11 @@ //! `libnotcurses-sys` is a *close to the metal* Rust wrapper for the [notcurses //! C library](https://www.github.com/dankamongmen/notcurses/) //! +//! The bindings are still incomplete, and a work in progress. +//! //! There is also the [notcurses](https://crates.io/crates/notcurses) crate, -//! for a more idiomatic wrapper, which should be safer and more higher level. +//! for a safer, more idiomatic wrapper, and with higher level abstractions, +//! but also still very much more incomplete. //! //! # Ways of using this library //! @@ -78,9 +81,9 @@ //! each context before it goes out of scope ([Notcurses], [NcDirect]), and //! should manually destroy [NcPlane]s, [NcMenu]s… when no longer needed. //! -//! 2. Instead of handling errors with `Result` (as is customary in Rust), +//! 2. Instead of handling errors with `Result` (as customary in Rust), //! several functions return an [NcResult] with a value of [NCRESULT_ERR], -//! (as is customary in C), or [NCRESULT_OK]. +//! (as customary in C), or [NCRESULT_OK]. //! //! The [notcurses]() crate overcomes this limitations by using higher level //! abstractions, while pulling itself apart from the C API, in ways this @@ -92,7 +95,9 @@ //! - Renames types to enforce regularity and consistency. (e.g. [NcCell]) //! - Has handy macros like [sleep], [rsleep] & [cstring]. //! -//! ## notcurses C API docs: +//! ## The `notcurses` C API docs +//! +//! For reference: //! //! - [Doxygen Documentation](https://nick-black.com/notcurses/html/index.html) //! - [API reference (man pages)](https://nick-black.com/notcurses/)