diff --git a/docs/03-declarative-layout.md b/docs/03-declarative-layout.md index c43dee185..c0b34e5b9 100644 --- a/docs/03-declarative-layout.md +++ b/docs/03-declarative-layout.md @@ -1,13 +1,13 @@ # The declarative layout system -This system provide an alternative to the system used in Awesome 3.5 and is -inspired by the one once used by Awesome 3.2-3.4 and Qt QML system. +The declarative layout system provides an alternative to the imperative system. +It is inspired by the one used by Awesome 3.2-3.4 and the Qt QML style. ## The default widgets ### Widgets -Awesome provide 2 collections of widgets: +Awesome provides 2 collections of widgets: * `wibox.widget`: Generic widgets, containers and layouts * `awful.widget`: The Awesome specific widgets @@ -17,15 +17,15 @@ Awesome provide 2 collections of widgets: ### Containers -Containers are widget wrapping another widget. It can be used to add decorations -or to modify the content of the child widget. +A container is a widget that wraps another widget. It can be used to add +decorations or to modify the content of the child widget. @DOC_container_WIDGET_LIST@ ### Layouts -Layouts are collection of children widgets. They place them according to rules -and usually provide some options. +Layouts are collections of children widgets. They are placed according to +configurable rules. @DOC_layout_WIDGET_LIST@ @@ -52,8 +52,8 @@ Code: In this example `s == 1` is an inline expression. In the default `rc.lua`, -there is an `s` variable represent to define the current screen. Any lua -logic expression can be used as long as it return a valid widget, or a +there is an `s` variable represent to define the current screen. Any Lua +logic expression can be used as long as it returns a valid widget or a declarative layout, or `nil`. @@ -106,10 +106,10 @@ Result: ![Example2 screenshot](../images/widgetlayout1.png) -### Use an `wibox.layout.align` layout +### Use a `wibox.layout.align` layout The `wibox.layout.align` is a little different. While most layouts will -ignore any `nil` lines, the `align` layout rely on them so `left`, `middle` -and `right` can be defined +ignore any `nil` lines, the `align` layout relies on them so `left`, `middle` +and `right` can be defined. Code: @@ -144,7 +144,7 @@ Code: Result: ![Example4 screenshot](../images/widgetlayout2.png) -For more information about how to draw widgets, refer to the `Cairo` api: +For more information about how to draw widgets, refer to the `Cairo` API: * [Path](http://cairographics.org/manual/cairo-Paths.html) * [Context](http://cairographics.org/manual/cairo-cairo-t.html) @@ -177,24 +177,24 @@ Code: ### Accessing widgets For each widget or container, it is possible to add an `identifier` attribute -so the widget can be accessed later. +so that it can be accessed later. -Widgets defined using `setup` can be access by 3 means: +Widgets defined using `setup` can be accessed using these methods: -* Avoid the issue by using externally created widgets -* Use `my_wibox.my_first_widget.my_second_widget` style access -* Use JavaScript like `my_wibox:get_children_by_id("my_second_widget")[1]` +* Avoiding the issue by using externally created widgets +* Using `my_wibox.my_first_widget.my_second_widget` style access +* Using JavaScript like `my_wibox:get_children_by_id("my_second_widget")[1]` -The first method mixes the imperative and declarative syntax, but makes the code +The first method mixes the imperative and declarative syntax, and makes the code less readable. The second is a little verbose and only works if every node in -the chain have a valid identifier. The last one doesn't require long paths, +the chain has a valid identifier. The last one doesn't require long paths, but it is not easy to get a specific instance if multiple widgets have the same identifier. -WARNING: The widget identifier must not use reseved name. This include all +WARNING: The widget identifier must not use a reserved name. This includes all method names, existing widget attributes, `layout` and `widget`. Names should -also respect the lua variable name policies (case sensitive, alphanumeric and -underscore characters and non-numeric first character) +also respect the Lua variable conventions (case-sensitive, alphanumeric, +underscore characters and non-numeric first character). Code: @@ -220,10 +220,10 @@ Code: This system is very flexible. Each section attribute (the entries with string keys) is directly linked to the layout or widget API. When setting the -imaginary `myproperty`, it will first check if `set_myproperty` exist. If it +imaginary `myproperty`, it will first check if `set_myproperty` exists. If it doesn't, it will check if there is a `myproperty` method. Finally, it will just set the `mywidget.myproperty` directly in case it is used later or -catched by a lua `metatable` (operator overload). +caught by a Lua `metatable` (operator overload). Code: diff --git a/docs/05-awesomerc.md.lua b/docs/05-awesomerc.md.lua index 9e41f88b6..139dfb817 100644 --- a/docs/05-awesomerc.md.lua +++ b/docs/05-awesomerc.md.lua @@ -4,7 +4,7 @@ local f = io.open(filename, "w") f:write[[# Default configuration file documentation -This document explain the default `rc.lua` file provided by Awesome. +This document explains the default `rc.lua` file provided by Awesome. ]] @@ -13,9 +13,9 @@ This document explain the default `rc.lua` file provided by Awesome. local sections = {} sections.DOC_REQUIRE_SECTION = [[ -Awesome API is distributed across many libraries (also called modules). +The Awesome API is distributed across many libraries (also called modules). -Here is the modules being imported: +Here are the modules that we import:
`gears` | Utilities such as color parsing and objects |