···11-## [0.4.1] - 2026-01-05
11+## [0.5.0] - 2026-01-05
22+33+### 🚀 Features
44+55+- Add attribute for hiding fields and enum variants
2637### 🚜 Refactor
48
+21
crates/hierconf-core/src/attrs.rs
···5353 ///
5454 /// Usage: `#[facet(hierconf::type_doc("Custom documentation for this type."))]`
5555 TypeDoc(&'static str),
5656+5757+ /// Hide a struct field or enum variant from man page generation.
5858+ ///
5959+ /// Usage: `#[facet(hierconf::hide)]`
6060+ Hide,
5661 }
5762}
5863···8893 }
8994}
90959696+#[cfg(feature = "mangen")]
9797+fn has_attr(attrs: &[FacetAttr], key: &'static str) -> bool {
9898+ attrs
9999+ .iter()
100100+ .any(|attr| attr.ns == Some("hierconf") && attr.key == key)
101101+}
102102+91103/// Extract the application name from a facet type's attributes.
92104///
93105/// Looks for `#[facet(hierconf::app_name("..."))]` attributes on the struct.
···140152pub fn extract_type_doc(attrs: &[FacetAttr]) -> Result<Option<&'static str>, HierConfError> {
141153 Ok(get_attr_opt::<&str>(attrs, "type_doc")?.cloned())
142154}
155155+156156+/// Check if an item (field or variant) should be hidden from man page generation.
157157+///
158158+/// Looks for `#[facet(hierconf::hide)]` attributes.
159159+/// Returns `true` if the attribute is present, `false` otherwise.
160160+#[cfg(feature = "mangen")]
161161+pub fn is_hidden(attrs: &[FacetAttr]) -> bool {
162162+ has_attr(attrs, "hide")
163163+}
+1-1
crates/hierconf-core/src/lib.rs
···4455pub use attrs::{Attr as HierConfAttr, extract_app_name};
66#[cfg(feature = "mangen")]
77-pub use attrs::{extract_date, extract_synopsis, extract_type_doc, extract_type_name};
77+pub use attrs::{extract_date, extract_synopsis, extract_type_doc, extract_type_name, is_hidden};
88pub use error::HierConfError;
99pub use loader::config_paths;
1010
+4-1
crates/hierconf-mangen/src/description/data.rs
···55//! 2. Rendering: Generate man pages using only these structures
6677use facet::{Def, Shape, StructKind, Type, UserType};
88-use hierconf_core::{HierConfError, extract_type_doc, extract_type_name};
88+use hierconf_core::{HierConfError, extract_type_doc, extract_type_name, is_hidden};
99use std::collections::HashMap;
1010use std::convert::TryFrom;
1111···125125fn fields_to_struct_fields(fields: &'static [facet::Field]) -> Result<Vec<Field>, HierConfError> {
126126 fields
127127 .iter()
128128+ .filter(|field| !is_hidden(field.attributes))
128129 .map(|field| {
129130 let name = field.name.to_string();
130131 let doc = doc_to_string(field.doc);
···145146fn fields_to_tuple_fields(fields: &'static [facet::Field]) -> Result<Vec<TypeRef>, HierConfError> {
146147 fields
147148 .iter()
149149+ .filter(|field| !is_hidden(field.attributes))
148150 .map(|field| {
149151 // Check for type_name override on the field
150152 if let Some(type_name_override) = extract_type_name(field.attributes)? {
···190192 let variants: Result<Vec<Variant>, HierConfError> = enum_type
191193 .variants
192194 .iter()
195195+ .filter(|variant| !is_hidden(variant.attributes))
193196 .map(|variant| {
194197 let name = variant.name.to_string();
195198 let doc = doc_to_string(variant.doc);
···11+.ie \n(.g .ds Aq \(aq
22+.el .ds Aq '
33+.TH HIDETEST 5 2025-01-15 hierconf
44+.SH NAME
55+hidetest \- configuration file format
66+.SH SYNOPSIS
77+Configuration documentation.
88+.PP
99+See \fBDESCRIPTION\fR for configuration parameters and \fBFILES\fR for configuration file locations.
1010+.SH DESCRIPTION
1111+The \fIhidetest\fR configuration file uses the TOML format.
1212+1313+Configuration files are checked in order of precedence, and the first file that exists is loaded. See the \fBFILES\fR section for details.
1414+1515+.SS "Configuration structure"
1616+.TP
1717+\fBtest_enum\fR (\fITestEnum\fR)
1818+Enum field.
1919+2020+See the \fBTypes\fR subsection for details on the \fITestEnum\fR type.
2121+2222+.SS Types
2323+The following types are used in the configuration file:
2424+2525+.TP
2626+\fBTestEnum\fR
2727+Test enum with hidden variant.
2828+2929+Variants:
3030+3131+.RS 4
3232+.IP \(bu 3
3333+\fBVisible\fR
3434+.RS 4
3535+This variant should be visible.
3636+.RE
3737+.IP \(bu 3
3838+\fBAnotherVisible\fR
3939+.RS 4
4040+Another visible variant.
4141+.RE
4242+.RE
4343+4444+.SH FILES
4545+Configuration files are checked in the following order of precedence (highest to lowest). The first file that exists is loaded.
4646+4747+.TP
4848+\fBtests/hidetest/config.toml\fR
4949+Test\-specific configuration file.
5050+5151+.TP
5252+\fB/etc/hidetest/config.toml\fR
5353+System\-wide configuration file.
5454+5555+.TP
5656+\fB/usr/share/etc/hidetest/config.toml\fR
5757+Distribution\-provided defaults.
···11+.ie \n(.g .ds Aq \(aq
22+.el .ds Aq '
33+.TH HIDETEST 5 2025-01-15 hierconf
44+.SH NAME
55+hidetest \- configuration file format
66+.SH SYNOPSIS
77+Configuration documentation.
88+.PP
99+See \fBDESCRIPTION\fR for configuration parameters and \fBFILES\fR for configuration file locations.
1010+.SH DESCRIPTION
1111+The \fIhidetest\fR configuration file uses the TOML format.
1212+1313+Configuration files are checked in order of precedence, and the first file that exists is loaded. See the \fBFILES\fR section for details.
1414+1515+.SS "Configuration structure"
1616+.TP
1717+\fBvisible_field\fR (\fIString\fR)
1818+This field should be visible.
1919+2020+.TP
2121+\fBanother_visible\fR (\fIu16\fR)
2222+Another visible field.
2323+2424+.SH FILES
2525+Configuration files are checked in the following order of precedence (highest to lowest). The first file that exists is loaded.
2626+2727+.TP
2828+\fBtests/hidetest/config.toml\fR
2929+Test\-specific configuration file.
3030+3131+.TP
3232+\fB/etc/hidetest/config.toml\fR
3333+System\-wide configuration file.
3434+3535+.TP
3636+\fB/usr/share/etc/hidetest/config.toml\fR
3737+Distribution\-provided defaults.