Skip to content

Commit 4c8589f

Browse files
committed
feat: add style_properties module for docs
1 parent 9623a3c commit 4c8589f

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

float-pigment-css-macro/src/property_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ impl ToTokens for PropertiesDefinition {
532532
cur_index += 1;
533533
let invalid_ident =
534534
Ident::new(&format!("Invalid{:X}", cur_index), enum_name.span());
535-
enum_fields.push(quote!(#[serde(rename = "_")] #invalid_ident));
535+
enum_fields.push(quote!(#[doc(hidden)] #[serde(rename = "_")] #invalid_ident));
536536
}
537537
cur_index += 1;
538538
enum_fields.push(quote! {

float-pigment-css-macro/src/style_syntax.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,14 @@ impl Parse for StyleSyntaxDefinition {
737737
impl ToTokens for StyleSyntaxDefinition {
738738
fn to_tokens(&self, tokens: &mut TokenStream) {
739739
let Self { trait_name, items } = self;
740+
741+
// the parser functions
740742
let item_fn_list: Vec<_> = items.iter().map(|x| quote! { #x }).collect();
741743
tokens.append_all(quote! {
742744
#(#item_fn_list)*
743745
});
746+
747+
// the value parser mapping
744748
let map: Vec<_> = items
745749
.iter()
746750
.map(|item| {
@@ -846,6 +850,13 @@ impl ToTokens for StyleSyntaxDefinition {
846850
Ok(false)
847851
}
848852
});
853+
854+
// a pub mod for docs
855+
let mod_doc = format!("!!! TODO");
856+
tokens.append_all(quote! {
857+
#[doc = #mod_doc]
858+
pub mod style_properties {}
859+
});
849860
}
850861
}
851862

float-pigment-css/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
//! 1. Merge the `MatchedRuleList` into `NodeProperties` with `MatchedRuleList::merge_node_properties`.
1515
//!
1616
//! The result `NodeProperties` contains all supported CSS properties.
17+
//!
18+
//! ### Supported CSS Features
19+
//!
20+
//! The supported selectors can be found in [StyleQuery] docs.
21+
//!
22+
//! The supported media features can be found in [MediaQueryStatus] docs.
23+
//!
24+
//! The supported style properties can be found in [style_properties](crate::property::style_properties) module docs.
1725
//!
1826
//! ### The Binary Format
1927
//!

0 commit comments

Comments
 (0)