diff --git a/docs/API/renoise/renoise.ViewBuilder.md b/docs/API/renoise/renoise.ViewBuilder.md index 65966df..46b4454 100644 --- a/docs/API/renoise/renoise.ViewBuilder.md +++ b/docs/API/renoise/renoise.ViewBuilder.md @@ -72,14 +72,6 @@ The default height for mini-sliders `->`[`renoise.Views.Bitmap`](../../API/renoise/renoise.Views.Bitmap.md) See: [renoise.Views.Bitmap](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/bitmap.lua#63#10) -### `bitmap`([*self*](../../API/builtins/self.md), properties : [`BitmapViewProperties`](#bitmapviewproperties)[`?`](../../API/builtins/nil.md)) {#bitmap} -`->`[`renoise.Views.Bitmap`](../../API/renoise/renoise.Views.Bitmap.md) - -See: [renoise.Views.Bitmap](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/bitmap.lua#63#10) -### `button`([*self*](../../API/builtins/self.md), properties : [`ButtonProperties`](#buttonproperties)[`?`](../../API/builtins/nil.md)) {#button} -`->`[`renoise.Views.Button`](../../API/renoise/renoise.Views.Button.md) - -See: [renoise.Views.Button](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/button.lua#40#10) ### `button`([*self*](../../API/builtins/self.md), properties : [`ButtonProperties`](#buttonproperties)[`?`](../../API/builtins/nil.md)) {#button} `->`[`renoise.Views.Button`](../../API/renoise/renoise.Views.Button.md) @@ -87,35 +79,11 @@ See: [renoise.Views.Button](file:///c%3A/Users/emuell/Development/Renoise-XRNX/d ### `checkbox`([*self*](../../API/builtins/self.md), properties : [`CheckBoxProperties`](#checkboxproperties)[`?`](../../API/builtins/nil.md)) {#checkbox} `->`[`renoise.Views.CheckBox`](../../API/renoise/renoise.Views.CheckBox.md) -See: [renoise.Views.CheckBox](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/checkbox.lua#28#10) -### `checkbox`([*self*](../../API/builtins/self.md), properties : [`CheckBoxProperties`](#checkboxproperties)[`?`](../../API/builtins/nil.md)) {#checkbox} -`->`[`renoise.Views.CheckBox`](../../API/renoise/renoise.Views.CheckBox.md) - See: [renoise.Views.CheckBox](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/checkbox.lua#28#10) ### `chooser`([*self*](../../API/builtins/self.md), properties : [`ChooserProperties`](#chooserproperties)[`?`](../../API/builtins/nil.md)) {#chooser} `->`[`renoise.Views.Chooser`](../../API/renoise/renoise.Views.Chooser.md) See: [renoise.Views.Chooser](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/chooser.lua#19#10) -### `chooser`([*self*](../../API/builtins/self.md), properties : [`ChooserProperties`](#chooserproperties)[`?`](../../API/builtins/nil.md)) {#chooser} -`->`[`renoise.Views.Chooser`](../../API/renoise/renoise.Views.Chooser.md) - -See: [renoise.Views.Chooser](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/chooser.lua#19#10) -### `column`([*self*](../../API/builtins/self.md), properties : [`RackViewProperties`](#rackviewproperties)) {#column} -You can add nested child views when constructing a column or row -by including them in the constructor table in the views property. - -### example: -```lua -vb:column { - margin = 1, - vb:text { - text = "Text1" - }, - vb:text { - text = "Text2" - } -} -``` ### `column`([*self*](../../API/builtins/self.md), properties : [`RackViewProperties`](#rackviewproperties)) {#column} You can add nested child views when constructing a column or row by including them in the constructor table in the views property. @@ -136,22 +104,6 @@ vb:column { You can add nested child views when constructing aligners by including them in the constructor table. -### example: -```lua -vb:horizontal_aligner { - mode = "center", - vb:text { - text = "Text1" - }, - vb:text { - text = "Text2" - } -} -``` -### `horizontal_aligner`([*self*](../../API/builtins/self.md), properties : [`AlignerViewProperties`](#alignerviewproperties)) {#horizontal_aligner} -You can add nested child views when constructing aligners by including them -in the constructor table. - ### example: ```lua vb:horizontal_aligner { @@ -167,39 +119,19 @@ vb:horizontal_aligner { ### `minislider`([*self*](../../API/builtins/self.md), properties : [`MiniSliderProperties`](#minisliderproperties)[`?`](../../API/builtins/nil.md)) {#minislider} `->`[`renoise.Views.MiniSlider`](../../API/renoise/renoise.Views.MiniSlider.md) -See: [renoise.Views.MiniSlider](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/minislider.lua#18#10) -### `minislider`([*self*](../../API/builtins/self.md), properties : [`MiniSliderProperties`](#minisliderproperties)[`?`](../../API/builtins/nil.md)) {#minislider} -`->`[`renoise.Views.MiniSlider`](../../API/renoise/renoise.Views.MiniSlider.md) - See: [renoise.Views.MiniSlider](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/minislider.lua#18#10) ### `multiline_text`([*self*](../../API/builtins/self.md), properties : [`MultilineTextViewProperties`](#multilinetextviewproperties)[`?`](../../API/builtins/nil.md)) {#multiline_text} `->`[`renoise.Views.MultiLineText`](../../API/renoise/renoise.Views.MultiLineText.md) -See: [renoise.Views.MultiLineText](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/multiline_text.lua#44#10) -### `multiline_text`([*self*](../../API/builtins/self.md), properties : [`MultilineTextViewProperties`](#multilinetextviewproperties)[`?`](../../API/builtins/nil.md)) {#multiline_text} -`->`[`renoise.Views.MultiLineText`](../../API/renoise/renoise.Views.MultiLineText.md) - See: [renoise.Views.MultiLineText](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/multiline_text.lua#44#10) ### `multiline_textfield`([*self*](../../API/builtins/self.md), properties : [`MultilineTextFieldProperties`](#multilinetextfieldproperties)[`?`](../../API/builtins/nil.md)) {#multiline_textfield} `->`[`renoise.Views.MultiLineTextField`](../../API/renoise/renoise.Views.MultiLineTextField.md) -See: [renoise.Views.MultiLineTextField](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/multiline_textfield.lua#22#10) -### `multiline_textfield`([*self*](../../API/builtins/self.md), properties : [`MultilineTextFieldProperties`](#multilinetextfieldproperties)[`?`](../../API/builtins/nil.md)) {#multiline_textfield} -`->`[`renoise.Views.MultiLineTextField`](../../API/renoise/renoise.Views.MultiLineTextField.md) - See: [renoise.Views.MultiLineTextField](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/multiline_textfield.lua#22#10) ### `popup`([*self*](../../API/builtins/self.md), properties : [`PopUpMenuProperties`](#popupmenuproperties)[`?`](../../API/builtins/nil.md)) {#popup} `->`[`renoise.Views.Popup`](../../API/renoise/renoise.Views.Popup.md) See: [renoise.Views.Popup](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/popup.lua#25#10) -### `popup`([*self*](../../API/builtins/self.md), properties : [`PopUpMenuProperties`](#popupmenuproperties)[`?`](../../API/builtins/nil.md)) {#popup} -`->`[`renoise.Views.Popup`](../../API/renoise/renoise.Views.Popup.md) - -See: [renoise.Views.Popup](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/popup.lua#25#10) -### `rotary`([*self*](../../API/builtins/self.md), properties : [`RotaryEncoderProperties`](#rotaryencoderproperties)[`?`](../../API/builtins/nil.md)) {#rotary} -`->`[`renoise.Views.RotaryEncoder`](../../API/renoise/renoise.Views.RotaryEncoder.md) - -See: [renoise.Views.RotaryEncoder](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/rotary.lua#23#10) ### `rotary`([*self*](../../API/builtins/self.md), properties : [`RotaryEncoderProperties`](#rotaryencoderproperties)[`?`](../../API/builtins/nil.md)) {#rotary} `->`[`renoise.Views.RotaryEncoder`](../../API/renoise/renoise.Views.RotaryEncoder.md) @@ -208,22 +140,6 @@ See: [renoise.Views.RotaryEncoder](file:///c%3A/Users/emuell/Development/Renoise You can add nested child views when constructing a column or row by including them in the constructor table in the views property. -### example: -```lua -vb:column { - margin = 1, - vb:text { - text = "Text1" - }, - vb:text { - text = "Text2" - } -} -``` -### `row`([*self*](../../API/builtins/self.md), properties : [`RackViewProperties`](#rackviewproperties)) {#row} -You can add nested child views when constructing a column or row -by including them in the constructor table in the views property. - ### example: ```lua vb:column { @@ -239,32 +155,10 @@ vb:column { ### `slider`([*self*](../../API/builtins/self.md), properties : [`SliderProperties`](#sliderproperties)[`?`](../../API/builtins/nil.md)) {#slider} `->`[`renoise.Views.Slider`](../../API/renoise/renoise.Views.Slider.md) -See: [renoise.Views.Slider](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/slider.lua#42#10) -### `slider`([*self*](../../API/builtins/self.md), properties : [`SliderProperties`](#sliderproperties)[`?`](../../API/builtins/nil.md)) {#slider} -`->`[`renoise.Views.Slider`](../../API/renoise/renoise.Views.Slider.md) - See: [renoise.Views.Slider](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/slider.lua#42#10) ### `space`([*self*](../../API/builtins/self.md), properties : [`ViewProperties`](#viewproperties)) {#space} You can create an empty space in layouts with a space. -### example: -```lua ---Empty space in layouts -vb:row { - vb:button { - text = "Some Button" - }, - vb:space { -- extra spacing between buttons - width = 8 - }, - vb:button { - text = "Another Button" - }, -} -``` -### `space`([*self*](../../API/builtins/self.md), properties : [`ViewProperties`](#viewproperties)) {#space} -You can create an empty space in layouts with a space. - ### example: ```lua --Empty space in layouts @@ -284,14 +178,6 @@ vb:row { `->`[`renoise.Views.Switch`](../../API/renoise/renoise.Views.Switch.md) See: [renoise.Views.Switch](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/switch.lua#30#10) -### `switch`([*self*](../../API/builtins/self.md), properties : [`ButtonSwitchProperties`](#buttonswitchproperties)[`?`](../../API/builtins/nil.md)) {#switch} -`->`[`renoise.Views.Switch`](../../API/renoise/renoise.Views.Switch.md) - -See: [renoise.Views.Switch](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/switch.lua#30#10) -### `text`([*self*](../../API/builtins/self.md), properties : [`TextViewProperties`](#textviewproperties)[`?`](../../API/builtins/nil.md)) {#text} -`->`[`renoise.Views.Text`](../../API/renoise/renoise.Views.Text.md) - -See: [renoise.Views.Text](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/text.lua#48#10) ### `text`([*self*](../../API/builtins/self.md), properties : [`TextViewProperties`](#textviewproperties)[`?`](../../API/builtins/nil.md)) {#text} `->`[`renoise.Views.Text`](../../API/renoise/renoise.Views.Text.md) @@ -300,14 +186,6 @@ See: [renoise.Views.Text](file:///c%3A/Users/emuell/Development/Renoise-XRNX/def `->`[`renoise.Views.TextField`](../../API/renoise/renoise.Views.TextField.md) See: [renoise.Views.TextField](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/textfield.lua#41#10) -### `textfield`([*self*](../../API/builtins/self.md), properties : [`TextFieldProperties`](#textfieldproperties)[`?`](../../API/builtins/nil.md)) {#textfield} -`->`[`renoise.Views.TextField`](../../API/renoise/renoise.Views.TextField.md) - -See: [renoise.Views.TextField](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/textfield.lua#41#10) -### `value`([*self*](../../API/builtins/self.md), properties : [`ValueViewProperties`](#valueviewproperties)[`?`](../../API/builtins/nil.md)) {#value} -`->`[`renoise.Views.Value`](../../API/renoise/renoise.Views.Value.md) - -See: [renoise.Views.Value](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/value.lua#20#10) ### `value`([*self*](../../API/builtins/self.md), properties : [`ValueViewProperties`](#valueviewproperties)[`?`](../../API/builtins/nil.md)) {#value} `->`[`renoise.Views.Value`](../../API/renoise/renoise.Views.Value.md) @@ -315,18 +193,10 @@ See: [renoise.Views.Value](file:///c%3A/Users/emuell/Development/Renoise-XRNX/de ### `valuebox`([*self*](../../API/builtins/self.md), properties : [`ValueBoxProperties`](#valueboxproperties)[`?`](../../API/builtins/nil.md)) {#valuebox} `->`[`renoise.Views.ValueBox`](../../API/renoise/renoise.Views.ValueBox.md) -See: [renoise.Views.ValueBox](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/valuebox.lua#51#10) -### `valuebox`([*self*](../../API/builtins/self.md), properties : [`ValueBoxProperties`](#valueboxproperties)[`?`](../../API/builtins/nil.md)) {#valuebox} -`->`[`renoise.Views.ValueBox`](../../API/renoise/renoise.Views.ValueBox.md) - See: [renoise.Views.ValueBox](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/valuebox.lua#51#10) ### `valuefield`([*self*](../../API/builtins/self.md), properties : [`ValueFieldProperties`](#valuefieldproperties)[`?`](../../API/builtins/nil.md)) {#valuefield} `->`[`renoise.Views.ValueField`](../../API/renoise/renoise.Views.ValueField.md) -See: [renoise.Views.ValueField](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/valuefield.lua#20#10) -### `valuefield`([*self*](../../API/builtins/self.md), properties : [`ValueFieldProperties`](#valuefieldproperties)[`?`](../../API/builtins/nil.md)) {#valuefield} -`->`[`renoise.Views.ValueField`](../../API/renoise/renoise.Views.ValueField.md) - See: [renoise.Views.ValueField](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/valuefield.lua#20#10) ### `vertical_aligner`([*self*](../../API/builtins/self.md), properties : [`AlignerViewProperties`](#alignerviewproperties)) {#vertical_aligner} You can add nested child views when constructing aligners by including them @@ -344,26 +214,6 @@ vb:horizontal_aligner { } } ``` -### `vertical_aligner`([*self*](../../API/builtins/self.md), properties : [`AlignerViewProperties`](#alignerviewproperties)) {#vertical_aligner} -You can add nested child views when constructing aligners by including them -in the constructor table. - -### example: -```lua -vb:horizontal_aligner { - mode = "center", - vb:text { - text = "Text1" - }, - vb:text { - text = "Text2" - } -} -``` -### `xypad`([*self*](../../API/builtins/self.md), properties : [`XYPadProperties`](#xypadproperties)[`?`](../../API/builtins/nil.md)) {#xypad} -`->`[`renoise.Views.XYPad`](../../API/renoise/renoise.Views.XYPad.md) - -See: [renoise.Views.XYPad](file:///c%3A/Users/emuell/Development/Renoise-XRNX/definitions/library/renoise/views/xypad.lua#64#10) ### `xypad`([*self*](../../API/builtins/self.md), properties : [`XYPadProperties`](#xypadproperties)[`?`](../../API/builtins/nil.md)) {#xypad} `->`[`renoise.Views.XYPad`](../../API/renoise/renoise.Views.XYPad.md) diff --git a/generate/src/library.rs b/generate/src/library.rs index 55a55bf..0f7329a 100644 --- a/generate/src/library.rs +++ b/generate/src/library.rs @@ -233,7 +233,16 @@ impl Library { } } + // extract constants, make functions, fields and constants unique and sort them for (_, c) in l.classes.iter_mut() { + let mut functions = c + .functions + .iter() + .unique_by(|f| f.to_string()) + .cloned() + .collect::>(); + functions.sort_by(|a, b| a.name.cmp(&b.name)); + let mut fields = c .fields .clone() @@ -245,6 +254,14 @@ impl Library { .collect::>(); fields.sort_by(|a, b| a.name.cmp(&b.name)); + let mut enums = c + .enums + .clone() + .into_iter() + .unique_by(|e| e.name.clone()) + .collect::>(); + enums.sort_by(|a, b| a.name.cmp(&b.name)); + let mut constants = c .fields .clone() @@ -252,10 +269,11 @@ impl Library { .filter(Var::is_constant) .unique_by(|f| f.name.clone()) .collect::>(); - constants.sort_by(|a, b| a.name.cmp(&b.name)); + c.functions = functions; c.fields = fields; + c.enums = enums; c.constants = constants; } diff --git a/generate/src/render.rs b/generate/src/render.rs index e20101c..fd0846c 100644 --- a/generate/src/render.rs +++ b/generate/src/render.rs @@ -288,10 +288,8 @@ impl Class { } if !self.enums.is_empty() || !self.constants.is_empty() { - let mut enums = self.enums.clone(); - enums.sort_by(|a, b| a.name.cmp(&b.name)); - let mut constants = self.constants.clone(); - constants.sort_by(|a, b| a.name.cmp(&b.name)); + let enums = &self.enums; + let constants = &self.constants; m.push(format!( "{}\n{}\n{}", h2("Constants"), @@ -325,8 +323,7 @@ impl Class { )) } - let mut functions = self.functions.clone(); - functions.sort_by(|a, b| a.name.cmp(&b.name)); + let functions = &self.functions; if !functions.is_empty() { m.push("\n---".to_string()); m.push(format!(