allow building docs with stable rust compiler

This commit is contained in:
Connor Skees 2023-06-30 06:22:21 +00:00
parent 8b34d0ee2a
commit 346b8c127b
7 changed files with 18 additions and 5 deletions

View File

@ -11,6 +11,7 @@
- fix various module system bugs when combined with `@import` - fix various module system bugs when combined with `@import`
- expose more AST internals in `grass_compiler` - expose more AST internals in `grass_compiler`
- allow building docs with stable/beta rust compiler
# 0.12.4 # 0.12.4

View File

@ -16,6 +16,12 @@ path = "src/lib.rs"
# crate-type = ["cdylib", "rlib"] # crate-type = ["cdylib", "rlib"]
bench = false bench = false
[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open
all-features = true
rustdoc-args = ["--cfg", "doc_cfg"]
[dependencies] [dependencies]
# todo: use lazy_static # todo: use lazy_static
once_cell = "1.15.0" once_cell = "1.15.0"

View File

@ -522,6 +522,7 @@ pub enum AstSupportsCondition {
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct AstSupportsRule { pub struct AstSupportsRule {
pub condition: AstSupportsCondition, pub condition: AstSupportsCondition,
// todo: rename body
pub children: Vec<AstStmt>, pub children: Vec<AstStmt>,
pub span: Span, pub span: Span,
} }

View File

@ -32,7 +32,7 @@ grass input.scss
``` ```
*/ */
#![cfg_attr(doc, feature(doc_cfg))] #![cfg_attr(doc_cfg, feature(doc_cfg))]
#![warn(clippy::all, clippy::cargo, clippy::dbg_macro)] #![warn(clippy::all, clippy::cargo, clippy::dbg_macro)]
#![deny(missing_debug_implementations)] #![deny(missing_debug_implementations)]
#![allow( #![allow(

View File

@ -160,9 +160,8 @@ impl<'a> Options<'a> {
/// See the [`Builtin`] documentation for additional information /// See the [`Builtin`] documentation for additional information
#[must_use] #[must_use]
#[inline] #[inline]
#[cfg(feature = "custom-builtin-fns")]
#[cfg(any(feature = "custom-builtin-fns", doc))] #[cfg(any(feature = "custom-builtin-fns", doc))]
#[cfg_attr(doc, doc(cfg(feature = "custom-builtin-fns")))] #[cfg_attr(doc_cfg, doc(cfg(feature = "custom-builtin-fns")))]
pub fn add_custom_fn<S: Into<String>>(mut self, name: S, func: Builtin) -> Self { pub fn add_custom_fn<S: Into<String>>(mut self, name: S, func: Builtin) -> Self {
self.custom_fns.insert(name.into(), func); self.custom_fns.insert(name.into(), func);
self self

View File

@ -23,6 +23,12 @@ path = "src/lib.rs"
# crate-type = ["cdylib", "rlib"] # crate-type = ["cdylib", "rlib"]
bench = false bench = false
[package.metadata.docs.rs]
# To build locally:
# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open
all-features = true
rustdoc-args = ["--cfg", "doc_cfg"]
[dependencies] [dependencies]
grass_compiler = { path = "../compiler", version = "0.12.4", default-features = false } grass_compiler = { path = "../compiler", version = "0.12.4", default-features = false }
include_sass = { path = "../include_sass", version = "0.12.4", optional = true } include_sass = { path = "../include_sass", version = "0.12.4", optional = true }

View File

@ -31,7 +31,7 @@ grass input.scss
``` ```
*/ */
#![cfg_attr(doc, feature(doc_cfg))] #![cfg_attr(doc_cfg, feature(doc_cfg))]
#![warn(clippy::all, clippy::cargo, clippy::dbg_macro)] #![warn(clippy::all, clippy::cargo, clippy::dbg_macro)]
#![deny(missing_debug_implementations)] #![deny(missing_debug_implementations)]
#![allow( #![allow(
@ -107,7 +107,7 @@ pub use grass_compiler::{
/// for all options are used, except for output style, which is compressed. /// for all options are used, except for output style, which is compressed.
#[macro_export] #[macro_export]
#[cfg(any(feature = "macro", doc))] #[cfg(any(feature = "macro", doc))]
#[cfg_attr(doc, doc(cfg(feature = "macro")))] #[cfg_attr(doc_cfg, doc(cfg(feature = "macro")))]
macro_rules! include { macro_rules! include {
($path:literal) => { ($path:literal) => {
$crate::__internal::include_sass::include_sass!($path); $crate::__internal::include_sass::include_sass!($path);