diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9610098..b3e6a60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,4 +52,15 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - run: cargo build --features ${{ matrix.api_level }} --features ${{ matrix.component }} - name: Build minimal features \ No newline at end of file + name: Build minimal features + + rustdoc: + name: Build Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - name: Build docs + run: cargo doc --all-features --workspace --no-deps + env: + RUSTDOCFLAGS: "--cfg=docsrs" diff --git a/components/drawing/src/lib.rs b/components/drawing/src/lib.rs index 53189ee..b9c2d58 100644 --- a/components/drawing/src/lib.rs +++ b/components/drawing/src/lib.rs @@ -1,3 +1,21 @@ +//! FFI Bindings for `native_drawing` on OpenHarmony +//! +//! The native drawing module provides APIs for drawing 2D graphics and text. +//! The graphics and text drawn by using the APIs cannot be directly displayed on the screen. +//! To display the drawn graphics and text, you'll need the capabilities provided by the and native window module. +//! +//! Please consult the official documentation for more details: [English docs], [Chinese docs] +//! +//! [English docs]: https://docs.openharmony.cn/pages/v5.0/en/application-dev/graphics/drawing-guidelines.md +//! [Chinese docs]: https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/graphics/drawing-guidelines.md +//! +//! ## Feature flags +#![cfg_attr( + feature = "document-features", + cfg_attr(doc, doc = ::document_features::document_features!()) +)] +#![cfg_attr(docsrs, feature(doc_cfg))] + #[link(name = "native_drawing")] extern "C" {} diff --git a/src/lib.rs b/src/lib.rs index 57bd01c..938c12d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,8 @@ feature = "document-features", cfg_attr(doc, doc = ::document_features::document_features!()) )] -#[cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] + #[cfg(feature = "drawing")] #[cfg_attr(docsrs, doc(cfg(feature = "drawing")))] pub mod drawing {