editing pass of short descriptions

and fix some short description parsing
develop
myk002 2022-08-05 10:08:23 -07:00
parent 6f48c1f4d0
commit ebfe00b112
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
7 changed files with 31 additions and 18 deletions

@ -7,6 +7,8 @@ Tags:
:dfhack-keybind:`job-duplicate` :dfhack-keybind:`job-duplicate`
:dfhack-keybind:`job-material` :dfhack-keybind:`job-material`
Inspect or modify details of workshop jobs.
Usage: Usage:
``job`` ``job``

@ -1,6 +1,7 @@
pathable pathable
======== ========
Provides a Lua API for marking tiles that are reachable from the cursor. Marks tiles that are reachable from the cursor. This plugin provides a Lua API,
but no direct commands.
See `pathable-api` for details. See `pathable-api` for details.

@ -5,8 +5,8 @@ prospector
Tags: Tags:
:dfhack-keybind:`prospect` :dfhack-keybind:`prospect`
Shows a summary of resources that exist on the map or an estimate of resources Shows a summary of resources that exist on the map. It can also calculate an
available in the selected embark area. estimate of resources available in the selected embark area.
Usage:: Usage::

@ -1,7 +1,7 @@
resume resume
====== ======
Tags: Tags:
:dfhack-keybind:`` :dfhack-keybind:`resume`
Color planned buildings based on their suspend status. When enabled, this plugin Color planned buildings based on their suspend status. When enabled, this plugin
will display a colored 'X' over suspended buildings. When run as a command, it will display a colored 'X' over suspended buildings. When run as a command, it

@ -4,9 +4,10 @@ search
====== ======
Tags: Tags:
The search plugin adds search capabilities to the Stocks, Animals, Trading, Adds search capabilities to the UI. The Stocks, Animals, Trading, Stockpile,
Stockpile, Noble (assignment candidates), Military (position candidates), Noble (assignment candidates), Military (position candidates), Burrows (unit
Burrows (unit list), Rooms, Announcements, Job List, and Unit List screens. list), Rooms, Announcements, Job List, and Unit List screens all get hotkeys
that allow you to dynamically filter the displayed lists.
Usage:: Usage::

@ -1,6 +1,6 @@
xlsxreader xlsxreader
========== ==========
Provides a Lua API for reading .xlsx files. Provides a Lua API for reading xlsx files.
See `xlsxreader-api` for details. See `xlsxreader-api` for details.

@ -142,11 +142,11 @@ end
-- value is the comment character.) -- value is the comment character.)
local function update_entry(entry, iterator, opts) local function update_entry(entry, iterator, opts)
opts = opts or {} opts = opts or {}
local lines = {} local lines, tags = {}, ''
local first_line_is_short_help = opts.first_line_is_short_help local first_line_is_short_help = opts.first_line_is_short_help
local begin_marker_found,header_found = not opts.begin_marker,opts.no_header local begin_marker_found,header_found = not opts.begin_marker,opts.no_header
local tags_found, short_help_found = false, opts.skip_short_help local tags_found, short_help_found = false, opts.skip_short_help
local in_short_help = false local in_tags, in_keybinding, in_short_help = false, false, false
for line in iterator do for line in iterator do
if not short_help_found and first_line_is_short_help then if not short_help_found and first_line_is_short_help then
line = line:trim() line = line:trim()
@ -179,16 +179,21 @@ local function update_entry(entry, iterator, opts)
end end
if not header_found and line:find('%w') then if not header_found and line:find('%w') then
header_found = true header_found = true
elseif not tags_found and line:find('^[*]*Tags:[*]* [%w, ]+$') then elseif in_tags then
local _,_,tags = line:trim():find('[*]*Tags:[*]* *(.*)') if #line == 0 then
entry.tags = {} in_tags = false
for _,tag in ipairs(tags:split('[ ,]+')) do else
entry.tags[tag] = true tags = tags .. line
end end
tags_found = true elseif not tags_found and line:find('^[*]*Tags:[*]*') then
_,_,tags = line:trim():find('[*]*Tags:[*]* *(.*)')
in_tags, tags_found = true, true
elseif in_keybinding then
if #line == 0 then in_keybinding = false end
elseif line:find('^[*]*Keybinding:') then
in_keybinding = true
elseif not short_help_found and elseif not short_help_found and
not line:find('^[*]*Keybinding:') and line:find('^%w') then
line:find('%w') then
if in_short_help then if in_short_help then
entry.short_help = entry.short_help .. ' ' .. line entry.short_help = entry.short_help .. ' ' .. line
else else
@ -205,6 +210,10 @@ local function update_entry(entry, iterator, opts)
table.insert(lines, line) table.insert(lines, line)
::continue:: ::continue::
end end
entry.tags = {}
for _,tag in ipairs(tags:split('[ ,]+')) do
entry.tags[tag] = true
end
if #lines > 0 then if #lines > 0 then
entry.long_help = table.concat(lines, '\n') entry.long_help = table.concat(lines, '\n')
end end