Skip to content

Commit 115e46c

Browse files
authored
Fix doc visibility issues. (#2356)
1 parent a2f1a9c commit 115e46c

File tree

10 files changed

+25
-37
lines changed

10 files changed

+25
-37
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ You can find its changes [documented below](#082---2023-01-27).
2525

2626
### Docs
2727

28+
- `Widget`, `WidgetExt`, `WidgetId`, `Lens` and `LensExt` docs are visible again. ([#2356] by [@xStrom])
29+
- Deprecated items are now hidden. ([#2356] by [@xStrom])
2830
- Fixed `rustdoc` example scraping configuration. ([#2353] by [@xStrom])
2931
- Added info about git symlinks to `CONTRIBUTING.md`. ([#2349] by [@xStrom])
3032

@@ -1207,6 +1209,7 @@ Last release without a changelog :(
12071209
[#2351]: https://github.com/linebender/druid/pull/2351
12081210
[#2352]: https://github.com/linebender/druid/pull/2352
12091211
[#2353]: https://github.com/linebender/druid/pull/2353
1212+
[#2356]: https://github.com/linebender/druid/pull/2356
12101213

12111214
[Unreleased]: https://github.com/linebender/druid/compare/v0.8.2...master
12121215
[0.8.2]: https://github.com/linebender/druid/compare/v0.8.1...v0.8.2

druid-shell/src/mouse.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ pub enum Cursor {
255255
Pointer,
256256
Crosshair,
257257

258+
#[doc(hidden)]
258259
#[deprecated(
259260
since = "0.8.0",
260261
note = "This will be removed because it is not available on Windows."

druid-shell/src/region.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ impl Region {
5959
}
6060
}
6161

62+
#[doc(hidden)]
6263
#[deprecated(since = "0.7.0", note = "Use bounding_box() instead")]
6364
// this existed on the previous Region type, and I've bumped into it
6465
// a couple times while updating

druid/src/app.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ impl<T: Data> AppLauncher<T> {
172172
/// # Panics
173173
///
174174
/// Panics if the logger fails to initialize.
175+
#[doc(hidden)]
175176
#[deprecated(since = "0.8.0", note = "Use log_to_console instead")]
176177
pub fn use_simple_logger(self) -> Self {
177178
self.log_to_console()

druid/src/lens/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@
5252
#[allow(clippy::module_inception)]
5353
#[macro_use]
5454
mod lens;
55-
pub use lens::{Constant, Deref, Field, Identity, InArc, Index, Map, Ref, Then, Unit};
56-
#[doc(hidden)]
57-
pub use lens::{Lens, LensExt};
55+
pub use lens::{
56+
Constant, Deref, Field, Identity, InArc, Index, Lens, LensExt, Map, Ref, Then, Unit,
57+
};

druid/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,7 @@
135135
//! the console to be shown, use `#![windows_subsystem = "windows"]` at the beginning of your
136136
//! crate.
137137
//!
138-
//! [`Widget`]: trait.Widget.html
139-
//! [`Data`]: trait.Data.html
140-
//! [`Lens`]: trait.Lens.html
141-
//! [`widget`]: ./widget/index.html
142-
//! [`Event`]: enum.Event.html
143138
//! [`druid-shell`]: druid_shell
144-
//! [`piet`]: piet
145139
//! [`druid/examples`]: https://github.com/linebender/druid/tree/v0.8.2/druid/examples
146140
//! [Druid book]: https://linebender.org/druid/
147141
//! [`im` crate]: https://crates.io/crates/im
@@ -231,13 +225,15 @@ pub use app_delegate::{AppDelegate, DelegateCtx};
231225
pub use box_constraints::BoxConstraints;
232226
pub use command::{sys as commands, Command, Notification, Selector, SingleUse, Target};
233227
pub use contexts::{EventCtx, LayoutCtx, LifeCycleCtx, PaintCtx, UpdateCtx};
234-
pub use data::Data;
228+
pub use data::*; // Wildcard because rustdoc has trouble inlining docs of two things called Data
235229
pub use dialog::FileDialogOptions;
230+
#[doc(inline)]
236231
pub use env::{Env, Key, KeyOrValue, Value, ValueType, ValueTypeError};
237232
pub use event::{Event, InternalEvent, InternalLifeCycle, LifeCycle, ViewContext};
238233
pub use ext_event::{ExtEventError, ExtEventSink};
239234
pub use lens::{Lens, LensExt};
240235
pub use localization::LocalizedString;
236+
#[doc(inline)]
241237
pub use menu::{sys as platform_menus, Menu, MenuItem};
242238
pub use mouse::MouseEvent;
243239
pub use util::Handled;
@@ -248,8 +244,10 @@ pub use window::{Window, WindowId};
248244
#[cfg(not(target_arch = "wasm32"))]
249245
pub(crate) use event::{DebugStateCell, StateCell, StateCheckFn};
250246

247+
#[doc(hidden)]
251248
#[deprecated(since = "0.8.0", note = "import from druid::text module instead")]
252249
pub use piet::{FontFamily, FontStyle, FontWeight, TextAlignment};
250+
#[doc(hidden)]
253251
#[deprecated(since = "0.8.0", note = "import from druid::text module instead")]
254252
pub use text::{ArcStr, FontDescriptor, TextLayout};
255253

@@ -261,9 +259,11 @@ pub use text::{ArcStr, FontDescriptor, TextLayout};
261259
/// alias is provided to make that transition easy, but in any case make
262260
/// an explicit choice whether to use meaning or physical location and
263261
/// use the appropriate type.
262+
#[doc(hidden)]
264263
#[deprecated(since = "0.7.0", note = "Use KbKey instead")]
265264
pub type KeyCode = KbKey;
266265

266+
#[doc(hidden)]
267267
#[deprecated(since = "0.7.0", note = "Use Modifiers instead")]
268268
/// See [`Modifiers`](struct.Modifiers.html).
269269
pub type KeyModifiers = Modifiers;

druid/src/theme.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use crate::{Env, FontDescriptor, FontFamily, FontStyle, FontWeight, Insets, Key}
2525
pub const WINDOW_BACKGROUND_COLOR: Key<Color> =
2626
Key::new("org.linebender.druid.theme.window_background_color");
2727

28+
#[doc(hidden)]
2829
#[deprecated(since = "0.8.0", note = "renamed to TEXT_COLOR")]
2930
pub const LABEL_COLOR: Key<Color> = TEXT_COLOR;
3031
pub const TEXT_COLOR: Key<Color> = Key::new("org.linebender.druid.theme.label_color");
@@ -56,6 +57,7 @@ pub const BUTTON_BORDER_WIDTH: Key<f64> =
5657
Key::new("org.linebender.druid.theme.button_border_width");
5758
pub const BORDER_DARK: Key<Color> = Key::new("org.linebender.druid.theme.border_dark");
5859
pub const BORDER_LIGHT: Key<Color> = Key::new("org.linebender.druid.theme.border_light");
60+
#[doc(hidden)]
5961
#[deprecated(since = "0.8.0", note = "use SELECTED_TEXT_BACKGROUND_COLOR instead")]
6062
pub const SELECTION_COLOR: Key<Color> = SELECTED_TEXT_BACKGROUND_COLOR;
6163
pub const SELECTED_TEXT_BACKGROUND_COLOR: Key<Color> =

druid/src/widget/mod.rs

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -106,41 +106,19 @@ pub use tabs::{AddTab, TabInfo, Tabs, TabsEdge, TabsPolicy, TabsState, TabsTrans
106106
pub use textbox::TextBox;
107107
pub use value_textbox::{TextBoxEvent, ValidationDelegate, ValueTextBox};
108108
pub use view_switcher::ViewSwitcher;
109-
#[doc(hidden)]
110109
pub use widget::{Widget, WidgetId};
111-
#[doc(hidden)]
112110
pub use widget_ext::WidgetExt;
113111
pub use widget_wrapper::WidgetWrapper;
114112
pub use z_stack::ZStack;
115113

116114
/// The types required to implement a [`Widget`].
117-
///
118-
/// # Structs
119-
/// [`BoxConstraints`](crate::BoxConstraints)\
120-
/// [`Env`](crate::Env)\
121-
/// [`EventCtx`](crate::EventCtx)\
122-
/// [`LayoutCtx`](crate::LayoutCtx)\
123-
/// [`LifeCycleCtx`](crate::LifeCycleCtx)\
124-
/// [`PaintCtx`](crate::PaintCtx)\
125-
/// [`Size`](crate::Size)\
126-
/// [`UpdateCtx`](crate::UpdateCtx)\
127-
/// [`WidgetId`](crate::WidgetId)\
128-
///
129-
/// # Enums
130-
/// [`Event`](crate::Event)\
131-
/// [`LifeCycle`](crate::LifeCycle)\
132-
///
133-
/// # Traits
134-
/// [`Data`](crate::Data)\
135-
/// [`RenderContext`](crate::RenderContext)\
136-
/// [`Widget`]
137-
///
138-
/// [`Widget`]: crate::Widget
139-
// NOTE: \ at the end works as a line break, but skip on last line!
140115
pub mod prelude {
141-
#[doc(hidden)]
116+
// Wildcard because rustdoc has trouble inlining docs of two things called Data
117+
pub use crate::data::*;
118+
119+
#[doc(inline)]
142120
pub use crate::{
143-
BoxConstraints, Data, Env, Event, EventCtx, LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx,
121+
BoxConstraints, Env, Event, EventCtx, LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx,
144122
RenderContext, Size, UpdateCtx, Widget, WidgetId,
145123
};
146124
}

druid/src/widget/parse.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use crate::widget::prelude::*;
2626
use crate::Data;
2727

2828
/// Converts a `Widget<String>` to a `Widget<Option<T>>`, mapping parse errors to None
29+
#[doc(hidden)]
2930
#[deprecated(since = "0.7.0", note = "Use the Formatter trait instead")]
3031
pub struct Parse<T> {
3132
widget: T,

druid/src/widget/widget_ext.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ pub trait WidgetExt<T: Data>: Widget<T> + Sized + 'static {
218218
}
219219

220220
/// Parse a `Widget<String>`'s contents
221+
#[doc(hidden)]
221222
#[deprecated(since = "0.7.0", note = "Use TextBox::with_formatter instead")]
222223
#[allow(deprecated)]
223224
fn parse(self) -> Parse<Self>

0 commit comments

Comments
 (0)