bug: Add workaround for new image paths

This commit is contained in:
Lucas Schwiderski 2021-12-14 11:30:04 +01:00 committed by Emmanuel Lepage Vallee
parent 75ab366769
commit 345de1e9d9
5 changed files with 104 additions and 229 deletions

View File

@ -64,6 +64,10 @@ dd > code {
margin-right: 5px;
}
#main {
display: flex;
}
#navigation {
float: left;
background-color: white;
@ -185,10 +189,6 @@ table.index td {
margin: 0px 3px 0px -1em;
}
#content {
margin-left: 14em;
}
#content p {
padding-left: 15px;
padding-right: 15px;
@ -574,3 +574,49 @@ pre .url { color: #272fc2; text-decoration: underline; }
.svg_stroke, .svg_fill {
color: black;
}
#content > .components-relationship {
margin-left: 15px;
margin-right: 15px;
}
.components-relationship--diagrams {
display: flex;
flex-direction: column;
}
.components-relationship--diagram {
flex-grow: 1;
flex-basis: 100%;
}
.components-relationship--diagram > table {
margin: 0;
width: 100%;
}
.components-relationship--diagram + .components-relationship--diagram {
margin-top: 15px;
}
/* on wide displays, put both diagrams next to each other */
@media all and (min-width: 1100px) {
.components-relationship--diagrams {
flex-direction: row;
}
.components-relationship--diagram {
flex-grow: 1;
flex-basis: 50%;
}
.components-relationship--diagram + .components-relationship--diagram {
margin-top: 0;
margin-left: 15px;
}
}
.components-relationship--legend {
color: #00000044;
margin-top: 15px;
}

View File

@ -3,75 +3,18 @@
Core components relationship
===
<table><tr>
<td valign="top"><table class='widget_list' border=1>
<colgroup span="3"></colgroup>
<tr><th align='center' colspan=3 scope=colgroup>Acquire other objects from a client</th></tr>
<tr style='font-weight: bold;'>
<th align='center'>Class</th>
<th align='center'></th>
<th align='center'>Property</th>
</tr>
<tr>
<td>tag</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client1.svg"></td>
<td>c.tags</td>
</tr>
<tr>
<td>screen</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client2.svg"></td>
<td>c.screen</td>
</tr>
<tr>
<td>awful.key</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client3.svg"></td>
<td>c:keys()</td>
</tr>
<tr>
<td>awful.button</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client4.svg"></td>
<td>c:buttons()</td>
</tr>
</table></td>
<td valign="top"><table class='widget_list' border=1>
<colgroup span="3"></colgroup>
<tr><th align='center' colspan=3 scope=colgroup>Acquire a client from other objects</th></tr>
<tr style='font-weight: bold;'>
<th align='center'>Class</th>
<th align='center'></th>
<th align='center'>Property</th>
</tr>
<tr>
<td>tag</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client5.svg"></td>
<td>t:clients()</td>
</tr>
<tr>
<td>screen</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client6.svg"></td>
<td>s.clients</td>
</tr>
<tr>
<td>screen</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client7.svg"></td>
<td>s.hidden_clients</td>
</tr>
<tr>
<td>screen</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client8.svg"></td>
<td>s.tiled_clients</td>
</tr>
<tr>
<td>mouse</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_client9.svg"></td>
<td>mouse.current_client</td>
</tr>
</table></td>
</tr><tr>
<td colspan=2 style="color:#00000044">
<b>Legend:</b> <i>c</i>: a client object, <i>t</i>: a tag object,
<i>s</i>: a screen object, <i>k</i>: an awful.key object,
<i>b</i>: a awful.button object, <i>n</i>: a naughty.notification object
</td>
</tr>
</table>
<div class="components-relationship"><div class="components-relationship--diagrams">
<div class="components-relationship--diagram"><table class='widget_list' border=1><colgroup span="3"></colgroup><tr><th align='center' colspan=3 scope=colgroup>Acquire other objects from a client</th></tr><tr style='font-weight: bold;'><th align='center'>Class</th><th align='center'></th><th align='center'>Property</th></tr>
<tr><td>tag</td><td><img src="../images/AUTOGEN_uml_nav_tables_client1.svg"></td><td>c.tags</td></tr>
<tr><td>screen</td><td><img src="../images/AUTOGEN_uml_nav_tables_client2.svg"></td><td>c.screen</td></tr>
<tr><td>awful.key</td><td><img src="../images/AUTOGEN_uml_nav_tables_client3.svg"></td><td>c:keys()</td></tr>
<tr><td>awful.button</td><td><img src="../images/AUTOGEN_uml_nav_tables_client4.svg"></td><td>c:buttons()</td></tr>
</table></div>
<div class="components-relationship--diagram"><table class='widget_list' border=1><colgroup span="3"></colgroup><tr><th align='center' colspan=3 scope=colgroup>Acquire a client from other objects</th></tr><tr style='font-weight: bold;'><th align='center'>Class</th><th align='center'></th><th align='center'>Property</th></tr>
<tr><td>tag</td><td><img src="../images/AUTOGEN_uml_nav_tables_client5.svg"></td><td>t:clients()</td></tr>
<tr><td>screen</td><td><img src="../images/AUTOGEN_uml_nav_tables_client6.svg"></td><td>s.clients</td></tr>
<tr><td>screen</td><td><img src="../images/AUTOGEN_uml_nav_tables_client7.svg"></td><td>s.hidden_clients</td></tr>
<tr><td>screen</td><td><img src="../images/AUTOGEN_uml_nav_tables_client8.svg"></td><td>s.tiled_clients</td></tr>
<tr><td>mouse</td><td><img src="../images/AUTOGEN_uml_nav_tables_client9.svg"></td><td>mouse.current_client</td></tr>
</table></div>
</div><div class="components-relationship--legend"><b>Legend:</b> <i>c</i>: a client object, <i>t</i>: a tag object, <i>s</i>: a screen object, <i>k</i>: an awful.key object, <i>b</i>: a awful.button object, <i>n</i>: a naughty.notification object</div></div> <!-- .components-relationship -->

View File

@ -3,75 +3,18 @@
Core components relationship
===
<table><tr>
<td valign="top"><table class='widget_list' border=1>
<colgroup span="3"></colgroup>
<tr><th align='center' colspan=3 scope=colgroup>Acquire other objects from a screen</th></tr>
<tr style='font-weight: bold;'>
<th align='center'>Class</th>
<th align='center'></th>
<th align='center'>Property</th>
</tr>
<tr>
<td>tag</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen1.svg"></td>
<td>s.tags</td>
</tr>
<tr>
<td>tag</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen2.svg"></td>
<td>s.selected_tag</td>
</tr>
<tr>
<td>tag</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen3.svg"></td>
<td>s.selected_tags</td>
</tr>
<tr>
<td>client</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen4.svg"></td>
<td>s.clients</td>
</tr>
<tr>
<td>client</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen5.svg"></td>
<td>s.hidden_clients</td>
</tr>
<tr>
<td>client</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen6.svg"></td>
<td>s.tiled_clients</td>
</tr>
</table></td>
<td valign="top"><table class='widget_list' border=1>
<colgroup span="3"></colgroup>
<tr><th align='center' colspan=3 scope=colgroup>Acquire a screen from other objects</th></tr>
<tr style='font-weight: bold;'>
<th align='center'>Class</th>
<th align='center'></th>
<th align='center'>Property</th>
</tr>
<tr>
<td>tag</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen7.svg"></td>
<td>t.screen</td>
</tr>
<tr>
<td>client</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen8.svg"></td>
<td>c.screen</td>
</tr>
<tr>
<td>naughty.notification</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_screen9.svg"></td>
<td>n.screen</td>
</tr>
</table></td>
</tr><tr>
<td colspan=2 style="color:#00000044">
<b>Legend:</b> <i>c</i>: a client object, <i>t</i>: a tag object,
<i>s</i>: a screen object, <i>k</i>: an awful.key object,
<i>b</i>: a awful.button object, <i>n</i>: a naughty.notification object
</td>
</tr>
</table>
<div class="components-relationship"><div class="components-relationship--diagrams">
<div class="components-relationship--diagram"><table class='widget_list' border=1><colgroup span="3"></colgroup><tr><th align='center' colspan=3 scope=colgroup>Acquire other objects from a screen</th></tr><tr style='font-weight: bold;'><th align='center'>Class</th><th align='center'></th><th align='center'>Property</th></tr>
<tr><td>tag</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen1.svg"></td><td>s.tags</td></tr>
<tr><td>tag</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen2.svg"></td><td>s.selected_tag</td></tr>
<tr><td>tag</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen3.svg"></td><td>s.selected_tags</td></tr>
<tr><td>client</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen4.svg"></td><td>s.clients</td></tr>
<tr><td>client</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen5.svg"></td><td>s.hidden_clients</td></tr>
<tr><td>client</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen6.svg"></td><td>s.tiled_clients</td></tr>
</table></div>
<div class="components-relationship--diagram"><table class='widget_list' border=1><colgroup span="3"></colgroup><tr><th align='center' colspan=3 scope=colgroup>Acquire a screen from other objects</th></tr><tr style='font-weight: bold;'><th align='center'>Class</th><th align='center'></th><th align='center'>Property</th></tr>
<tr><td>tag</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen7.svg"></td><td>t.screen</td></tr>
<tr><td>client</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen8.svg"></td><td>c.screen</td></tr>
<tr><td>naughty.notification</td><td><img src="../images/AUTOGEN_uml_nav_tables_screen9.svg"></td><td>n.screen</td></tr>
</table></div>
</div><div class="components-relationship--legend"><b>Legend:</b> <i>c</i>: a client object, <i>t</i>: a tag object, <i>s</i>: a screen object, <i>k</i>: an awful.key object, <i>b</i>: a awful.button object, <i>n</i>: a naughty.notification object</div></div> <!-- .components-relationship -->

View File

@ -3,60 +3,15 @@
Core components relationship
===
<table><tr>
<td valign="top"><table class='widget_list' border=1>
<colgroup span="3"></colgroup>
<tr><th align='center' colspan=3 scope=colgroup>Acquire other objects from a tag</th></tr>
<tr style='font-weight: bold;'>
<th align='center'>Class</th>
<th align='center'></th>
<th align='center'>Property</th>
</tr>
<tr>
<td>client</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_tag1.svg"></td>
<td>t:clients()</td>
</tr>
<tr>
<td>screen</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_tag2.svg"></td>
<td>t.screen</td>
</tr>
</table></td>
<td valign="top"><table class='widget_list' border=1>
<colgroup span="3"></colgroup>
<tr><th align='center' colspan=3 scope=colgroup>Acquire a tag from other objects</th></tr>
<tr style='font-weight: bold;'>
<th align='center'>Class</th>
<th align='center'></th>
<th align='center'>Property</th>
</tr>
<tr>
<td>client</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_tag3.svg"></td>
<td>c.tags</td>
</tr>
<tr>
<td>screen</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_tag4.svg"></td>
<td>s.tags</td>
</tr>
<tr>
<td>screen</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_tag5.svg"></td>
<td>s.selected_tag</td>
</tr>
<tr>
<td>screen</td>
<td><img src="../images/AUTOGEN_uml_nav_tables_tag6.svg"></td>
<td>s.selected_tags</td>
</tr>
</table></td>
</tr><tr>
<td colspan=2 style="color:#00000044">
<b>Legend:</b> <i>c</i>: a client object, <i>t</i>: a tag object,
<i>s</i>: a screen object, <i>k</i>: an awful.key object,
<i>b</i>: a awful.button object, <i>n</i>: a naughty.notification object
</td>
</tr>
</table>
<div class="components-relationship"><div class="components-relationship--diagrams">
<div class="components-relationship--diagram"><table class='widget_list' border=1><colgroup span="3"></colgroup><tr><th align='center' colspan=3 scope=colgroup>Acquire other objects from a tag</th></tr><tr style='font-weight: bold;'><th align='center'>Class</th><th align='center'></th><th align='center'>Property</th></tr>
<tr><td>client</td><td><img src="../images/AUTOGEN_uml_nav_tables_tag1.svg"></td><td>t:clients()</td></tr>
<tr><td>screen</td><td><img src="../images/AUTOGEN_uml_nav_tables_tag2.svg"></td><td>t.screen</td></tr>
</table></div>
<div class="components-relationship--diagram"><table class='widget_list' border=1><colgroup span="3"></colgroup><tr><th align='center' colspan=3 scope=colgroup>Acquire a tag from other objects</th></tr><tr style='font-weight: bold;'><th align='center'>Class</th><th align='center'></th><th align='center'>Property</th></tr>
<tr><td>client</td><td><img src="../images/AUTOGEN_uml_nav_tables_tag3.svg"></td><td>c.tags</td></tr>
<tr><td>screen</td><td><img src="../images/AUTOGEN_uml_nav_tables_tag4.svg"></td><td>s.tags</td></tr>
<tr><td>screen</td><td><img src="../images/AUTOGEN_uml_nav_tables_tag5.svg"></td><td>s.selected_tag</td></tr>
<tr><td>screen</td><td><img src="../images/AUTOGEN_uml_nav_tables_tag6.svg"></td><td>s.selected_tags</td></tr>
</table></div>
</div><div class="components-relationship--legend"><b>Legend:</b> <i>c</i>: a client object, <i>t</i>: a tag object, <i>s</i>: a screen object, <i>k</i>: an awful.key object, <i>b</i>: a awful.button object, <i>n</i>: a naughty.notification object</div></div> <!-- .components-relationship -->

View File

@ -6,7 +6,11 @@ local wibox = require("wibox")
local beautiful = require("beautiful")
-- Make the path relative.
local relative_image_path = "../" .. image_path:match("/(images/[^/]+)$")
local path = image_path:match("/(images/[^/]+)$")
if not path then
path = image_path:match("/(raw_images/[^/]+)$"):gsub("raw_", "")
end
local relative_image_path = "../" .. path
-- This template generates an HTML table with how other classes are associated
-- with a given class.
@ -162,27 +166,16 @@ local map = {
}
local function gen_table_header(title, o)
print([[<td valign="top"><table class='widget_list' border=1>
<colgroup span="3"></colgroup>
<tr><th align='center' colspan=3 scope=colgroup>]]..map[title](o)..[[</th></tr>
<tr style='font-weight: bold;'>
<th align='center'>Class</th>
<th align='center'></th>
<th align='center'>Property</th>
</tr>]])
print([[<div class="components-relationship--diagram"><table class='widget_list' border=1><colgroup span="3"></colgroup><tr><th align='center' colspan=3 scope=colgroup>]]..map[title](o)..[[</th></tr><tr style='font-weight: bold;'><th align='center'>Class</th><th align='center'></th><th align='center'>Property</th></tr>]])
end
local function get_table_row(path, class, prop)
print([[<tr>
<td>]].. class ..[[</td>
<td><img src="]]..path..[["></td>
<td>]].. prop ..[[</td>
</tr>]])
print([[<tr><td>]].. class ..[[</td><td><img src="]]..path..[["></td><td>]].. prop ..[[</td></tr>]])
end
local function get_table_footer()
print '</table></td>'
print '</table></div>'
end
local module = {}
@ -193,7 +186,7 @@ function module.generate_nav_table(t)
assert(t.content and t.class)
print("\n\nCore components relationship\n===\n")
print '<table><tr>'
print('<div class="components-relationship"><div class="components-relationship--diagrams">')
-- Validate early to avoid debugging cryptic backtraces.
for _, tab in ipairs {"to", "from"} do
@ -214,14 +207,9 @@ function module.generate_nav_table(t)
end
get_table_footer()
end
print([[</tr><tr>
<td colspan=2 style="color:#00000044">
<b>Legend:</b> <i>c</i>: a client object, <i>t</i>: a tag object,
<i>s</i>: a screen object, <i>k</i>: an awful.key object,
<i>b</i>: a awful.button object, <i>n</i>: a naughty.notification object
</td>
</tr>
</table>]])
-- End the last section and add a footer
print([[</div><div class="components-relationship--legend"><b>Legend:</b> <i>c</i>: a client object, <i>t</i>: a tag object, <i>s</i>: a screen object, <i>k</i>: an awful.key object, <i>b</i>: a awful.button object, <i>n</i>: a naughty.notification object</div></div> <!-- .components-relationship -->]])
end
loadfile(file_path)(module)