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-material`
Inspect or modify details of workshop jobs.
Usage:
``job``

@ -1,6 +1,7 @@
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.

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

@ -1,7 +1,7 @@
resume
======
Tags:
:dfhack-keybind:``
:dfhack-keybind:`resume`
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

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

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

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