doc: Fix some example tests indentation
When `DOC_NO_USAGE` is set, the examples need 4 spaces as per the markdown spec.
This commit is contained in:
parent
790d2aa6ee
commit
767cda5830
|
@ -2,9 +2,9 @@ screen[1]._resize {x = 175, width = 128, height = 96} --DOC_NO_USAGE --DOC_HIDE
|
|||
local awful = {placement = require("awful.placement")} --DOC_HIDE
|
||||
local c = client.gen_fake {x = 220, y = 35, width=40, height=30} --DOC_HIDE
|
||||
|
||||
-- "right" will be replaced by "left"
|
||||
local f = (awful.placement.right + awful.placement.left)
|
||||
f(client.focus)
|
||||
-- "right" will be replaced by "left"
|
||||
local f = (awful.placement.right + awful.placement.left)
|
||||
f(client.focus)
|
||||
|
||||
local sg = screen[1].geometry--DOC_HIDE
|
||||
assert(c.x == sg.x and c.y==sg.height/2-30/2-c.border_width--DOC_HIDE
|
||||
|
|
|
@ -2,14 +2,14 @@ screen[1]._resize {x = 175, width = 128, height = 96} --DOC_NO_USAGE --DOC_HIDE
|
|||
local awful = {placement = require("awful.placement")} --DOC_HIDE
|
||||
local c = client.gen_fake {x = 220, y = 35, width=40, height=30} --DOC_HIDE
|
||||
|
||||
-- Simulate Windows 7 "edge snap" (also called aero snap) feature
|
||||
local axis = "vertically"
|
||||
-- Simulate Windows 7 "edge snap" (also called aero snap) feature
|
||||
local axis = "vertically"
|
||||
|
||||
local f = awful.placement.scale
|
||||
+ awful.placement.left
|
||||
+ (axis and awful.placement["maximize_"..axis] or nil)
|
||||
local f = awful.placement.scale
|
||||
+ awful.placement.left
|
||||
+ (axis and awful.placement["maximize_"..axis] or nil)
|
||||
|
||||
local geo = f(client.focus, {honor_workarea=true, to_percent = 0.5})
|
||||
local geo = f(client.focus, {honor_workarea=true, to_percent = 0.5})
|
||||
|
||||
local wa = screen[1].workarea--DOC_HIDE
|
||||
assert(c.x == wa.x and geo.x == wa.x)--DOC_HIDE
|
||||
|
|
|
@ -3,33 +3,31 @@ local wibox = require( "wibox" ) --DOC_HIDE
|
|||
local beautiful = require( "beautiful" ) --DOC_HIDE
|
||||
|
||||
parent:add( --DOC_HIDE
|
||||
wibox.widget {
|
||||
checked = true,
|
||||
color = beautiful.bg_normal,
|
||||
paddings = 2,
|
||||
forced_width = 20, --DOC_HIDE
|
||||
forced_height = 20, --DOC_HIDE
|
||||
check_shape = function(cr, width, height)
|
||||
local rs = math.min(width, height)
|
||||
|
||||
cr:move_to( 0 , 0 )
|
||||
cr:line_to( rs , 0 )
|
||||
cr:move_to( 0 , 0 )
|
||||
cr:line_to( 0 , rs )
|
||||
cr:move_to( 0 , rs )
|
||||
cr:line_to( rs , rs )
|
||||
cr:move_to( rs , 0 )
|
||||
cr:line_to( rs , rs )
|
||||
cr:move_to( 0 , 0 )
|
||||
cr:line_to( rs , rs )
|
||||
cr:move_to( 0 , rs )
|
||||
cr:line_to( rs , 0 )
|
||||
end,
|
||||
check_border_color = "#ff0000",
|
||||
check_color = "#00000000",
|
||||
check_border_width = 1,
|
||||
widget = wibox.widget.checkbox
|
||||
}
|
||||
) --DOC_HIDE
|
||||
|
||||
wibox.widget {
|
||||
checked = true,
|
||||
color = beautiful.bg_normal,
|
||||
paddings = 2,
|
||||
forced_width = 20, --DOC_HIDE
|
||||
forced_height = 20, --DOC_HIDE
|
||||
check_shape = function(cr, width, height)
|
||||
local rs = math.min(width, height)
|
||||
cr:move_to( 0 , 0 )
|
||||
cr:line_to( rs , 0 )
|
||||
cr:move_to( 0 , 0 )
|
||||
cr:line_to( 0 , rs )
|
||||
cr:move_to( 0 , rs )
|
||||
cr:line_to( rs , rs )
|
||||
cr:move_to( rs , 0 )
|
||||
cr:line_to( rs , rs )
|
||||
cr:move_to( 0 , 0 )
|
||||
cr:line_to( rs , rs )
|
||||
cr:move_to( 0 , rs )
|
||||
cr:line_to( rs , 0 )
|
||||
end,
|
||||
check_border_color = "#ff0000",
|
||||
check_color = "#00000000",
|
||||
check_border_width = 1,
|
||||
widget = wibox.widget.checkbox
|
||||
}
|
||||
) --DOC_HIDE
|
||||
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
|
@ -4,24 +4,23 @@ local beautiful = require("beautiful") --DOC_HIDE
|
|||
|
||||
parent:add( --DOC_HIDE
|
||||
|
||||
wibox.widget {
|
||||
{
|
||||
max_value = 1,
|
||||
value = 0.5,
|
||||
forced_height = 20,
|
||||
forced_width = 100,
|
||||
paddings = 1,
|
||||
border_width = 1,
|
||||
border_color = beautiful.border_color,
|
||||
widget = wibox.widget.progressbar,
|
||||
},
|
||||
{
|
||||
text = "50%",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
layout = wibox.layout.stack
|
||||
}
|
||||
|
||||
) --DOC_HIDE
|
||||
wibox.widget {
|
||||
{
|
||||
max_value = 1,
|
||||
value = 0.5,
|
||||
forced_height = 20,
|
||||
forced_width = 100,
|
||||
paddings = 1,
|
||||
border_width = 1,
|
||||
border_color = beautiful.border_color,
|
||||
widget = wibox.widget.progressbar,
|
||||
},
|
||||
{
|
||||
text = "50%",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
layout = wibox.layout.stack
|
||||
}
|
||||
|
||||
) --DOC_HIDE
|
||||
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
|
@ -3,18 +3,17 @@ local wibox = require("wibox") --DOC_HIDE
|
|||
|
||||
parent:add( --DOC_HIDE
|
||||
|
||||
wibox.widget {
|
||||
{
|
||||
max_value = 1,
|
||||
value = 0.33,
|
||||
widget = wibox.widget.progressbar,
|
||||
},
|
||||
forced_height = 100,
|
||||
forced_width = 20,
|
||||
direction = "east",
|
||||
layout = wibox.container.rotate,
|
||||
}
|
||||
|
||||
) --DOC_HIDE
|
||||
wibox.widget {
|
||||
{
|
||||
max_value = 1,
|
||||
value = 0.33,
|
||||
widget = wibox.widget.progressbar,
|
||||
},
|
||||
forced_height = 100,
|
||||
forced_width = 20,
|
||||
direction = "east",
|
||||
layout = wibox.container.rotate,
|
||||
}
|
||||
|
||||
) --DOC_HIDE
|
||||
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
Loading…
Reference in New Issue