diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 00000000..e48d7c43 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,37 @@ +name: build and deploy to netlify +on: + push: + branches: [master] +jobs: + publish-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install the required system libraries + run: sudo apt-get -y install libpango1.0-dev libgtk-3-dev + # run docs generation on nightly rather than stable. This enables features like + # https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an + # API be documented as only available in some specific platforms. + - name: Install nightly + uses: dtolnay/rust-toolchain@nightly + - name: cargo doc + run: cargo +nightly doc --no-deps --all-features --workspace + env: + RUSTDOCFLAGS: -D warnings + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v2.0 + with: + publish-dir: "./target/doc" + production-branch: master + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Deploy from GitHub Actions" + enable-pull-request-comment: false + enable-commit-comment: true + overwrites-pull-request-comment: true + netlify-config-path: "./netlify.toml" + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 1 diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000..2d13573f --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[[redirects]] + from = "/" + to = "/rune" diff --git a/src/buffer.rs b/src/buffer.rs index b1ab5657..fad4843f 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -17,7 +17,7 @@ static BUFFERS: OnceLock>> = OnceLock /// Helper function to avoid calling `get_or_init` on each of the calls to `lock()` on the Mutex. /// -/// TODO: Use `LazyLock`: https://github.com/CeleritasCelery/rune/issues/34 +/// TODO: Use `LazyLock`: fn buffers() -> &'static Mutex> { BUFFERS.get_or_init(Mutex::default) } diff --git a/src/core/env/symbol.rs b/src/core/env/symbol.rs index 444301e7..772951e0 100755 --- a/src/core/env/symbol.rs +++ b/src/core/env/symbol.rs @@ -17,7 +17,8 @@ use std::sync::atomic::{AtomicBool, AtomicPtr, Ordering}; /// will be the same location no matter which thread /// interned it. Functions are safe to share between /// threads because they are marked immutable by -/// [`ObjectMap::set_func`] and they can only be replaced atomically. +/// [`ObjectMap::set_func`](`crate::core::env::ObjectMap::set_func`) +/// and they can only be replaced atomically. /// In order to garbage collect the function we need to /// halt all running threads. This has not been implemented /// yet. diff --git a/src/core/object/cell.rs b/src/core/object/cell.rs index 16ca9382..c40bb602 100644 --- a/src/core/object/cell.rs +++ b/src/core/object/cell.rs @@ -44,7 +44,7 @@ impl fmt::Debug for ObjCell { /// This represents a mutable view into an Object. See [`ObjCell`] for a more /// detailed explanation. Holding this type means that we confirmed that the -/// data stucture is mutable, and we can use the [`set`] method update this +/// data stucture is mutable, and we can use the [`MutObjCell::set`] method update this /// cell. #[derive(PartialEq)] #[repr(transparent)] diff --git a/src/core/object/tagged.rs b/src/core/object/tagged.rs index 319a1c9d..fed1a251 100755 --- a/src/core/object/tagged.rs +++ b/src/core/object/tagged.rs @@ -178,7 +178,7 @@ impl<'new, 'old, T: GcManaged + 'new> WithLifetime<'new> for &'old T { /// Trait for types that can be managed by the GC. This trait is implemented for /// as many types as possible, even for types that are already Gc managed, Like -/// Gc. This makes it easier to write generic code for working with Gc types. +/// `Gc`. This makes it easier to write generic code for working with Gc types. pub(crate) trait IntoObject { type Out<'ob>; @@ -365,7 +365,7 @@ mod private { /// of types that implement this trait. First is "base" types, which are /// pointers to some memory managed by the GC with a unique tag (e.g /// `LispString`, `LispVec`). This may seem stange that we would define a - /// tagged pointer when the type is known (i.e. Gc), but doing so let's + /// tagged pointer when the type is known (i.e. `Gc`), but doing so let's /// us reinterpret bits without changing the underlying memory. Base types /// are untagged into a pointer. /// @@ -400,7 +400,7 @@ mod private { Gc::from_ptr(ptr, Self::TAG) } - /// Remove the tag from the Gc and return the inner type. If it is + /// Remove the tag from the `Gc` and return the inner type. If it is /// base type then it will only have a single possible value and can be /// untagged without checks, but sum types need to create all values /// they can hold. We use tagged base types to let us reinterpret bits diff --git a/src/core/object/vector.rs b/src/core/object/vector.rs index 6db4f697..0c548cef 100644 --- a/src/core/object/vector.rs +++ b/src/core/object/vector.rs @@ -13,7 +13,7 @@ use std::{ /// A lisp vector. Unlike vectors in other languages this is not resizeable. /// This type is represented as slice of [`ObjCell`] which is immutable by -/// default. However with the [`try_mut`] method, you can obtain a mutable view +/// default. However with the [`LispVec::try_mut`] method, you can obtain a mutable view /// into this slice. #[derive(Eq)] pub(crate) struct LispVec { diff --git a/src/data.rs b/src/data.rs index b89e3023..5279f20e 100644 --- a/src/data.rs +++ b/src/data.rs @@ -14,11 +14,11 @@ use std::sync::OnceLock; static FEATURES: OnceLock>>> = OnceLock::new(); /// Rust translation of the `features` variable: A list of symbols are the features -/// of the executing Emacs. Used by [`featurep`] and [`require`], altered by [`provide`]. -/// Vended through a helper function to avoid calling `get_or_init` on each of the calls +/// of the executing Emacs. Used by [`featurep`](`crate::fns::featurep`) and [`require`](`crate::fns::require`), +/// altered by [`provide`]. Vended through a helper function to avoid calling `get_or_init` on each of the calls /// to `lock()` on the Mutex. /// -/// TODO: Use `LazyLock`: https://github.com/CeleritasCelery/rune/issues/34 +/// TODO: Use `LazyLock`: pub(crate) fn features() -> &'static Mutex>> { FEATURES.get_or_init(Mutex::default) } diff --git a/src/fns.rs b/src/fns.rs index ef927a32..037b60f8 100644 --- a/src/fns.rs +++ b/src/fns.rs @@ -487,7 +487,7 @@ pub(crate) fn defvaralias<'ob>( pub(crate) fn featurep(_feature: Symbol, _subfeature: Option) {} #[defun] -fn require<'ob>( +pub(crate) fn require<'ob>( feature: &Rt>, filename: Option<&Rt>>, noerror: Option<()>,