Merge pull request #2299 from myk002/myk_die_easter_egg

[helpdb] replace die's underline with tombstones
develop
Myk 2022-09-23 08:45:43 -07:00 committed by GitHub
commit b8a172440f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 61 deletions

@ -321,6 +321,8 @@ local function scan_builtins(old_db)
HELP_SOURCES.RENDERED or HELP_SOURCES.STUB, HELP_SOURCES.RENDERED or HELP_SOURCES.STUB,
{entry_types=entry_types}) {entry_types=entry_types})
end end
-- easter egg: replace underline for 'die' help with tombstones
textdb.die.long_help = textdb.die.long_help:gsub('=', string.char(239))
end end
-- scan for enableable plugins and plugin-provided commands and add their help -- scan for enableable plugins and plugin-provided commands and add their help

@ -42,10 +42,7 @@ local files = {
['hack/docs/docs/Tags.txt']=[[ ['hack/docs/docs/Tags.txt']=[[
* fort: Tools that are useful while in fort mode. * fort: Tools that are useful while in fort mode.
* armok: Tools that give you complete control over * armok: Tools that give you complete control over an aspect of the game or provide access to information that the game intentionally keeps hidden.
an aspect of the game or provide access to
information that the game intentionally keeps
hidden.
* map: Tools that interact with the game map. * map: Tools that interact with the game map.
@ -55,68 +52,65 @@ local files = {
]], ]],
['hack/docs/docs/tools/hascommands.txt']=[[ ['hack/docs/docs/tools/hascommands.txt']=[[
hascommands hascommands
*********** ===========
**Tags:** fort | armok | units Tags: fort | armok | units
Documented a plugin that Documented a plugin that has commands.
has commands.
**Command:** "boxbinders" Command: "boxbinders"
Documented boxbinders. Documented boxbinders.
**Command:** "bindboxers" Command: "bindboxers"
Documented bindboxers. Documented bindboxers.
Documented full help. Documented full help.
]], ]],
['hack/docs/docs/tools/samename.txt']=[[ ['hack/docs/docs/tools/samename.txt']=[[
samename samename
******** ========
**Tags:** fort | armok Tags: fort | armok | units
| units
**Command:** "samename" Command: "samename"
Documented samename. Documented samename.
Documented full help. Documented full help.
]], ]],
['hack/docs/docs/tools/nocommand.txt']=[[ ['hack/docs/docs/tools/nocommand.txt']=[[
nocommand nocommand
********* =========
**Tags:** fort | armok | Tags: fort | armok | units
units
Documented nocommand. Documented nocommand.
Documented full help. Documented full help.
]], ]],
['hack/docs/docs/tools/basic.txt']=[[ ['hack/docs/docs/tools/basic.txt']=[[
basic basic
***** =====
**Tags:** map Tags: map
**Command:** "basic" Command: "basic"
Documented basic. Documented basic.
Documented full help. Documented full help.
]], ]],
['hack/docs/docs/tools/subdir/scriptname.txt']=[[ ['hack/docs/docs/tools/subdir/scriptname.txt']=[[
subdir/scriptname subdir/scriptname
***************** =================
**Tags:** map Tags: map
**Command:** "subdir/scriptname" Command: "subdir/scriptname"
Documented subdir/scriptname. Documented subdir/scriptname.
Documented full help. Documented full help.
]], ]],
@ -126,11 +120,11 @@ Documented full help.
basic basic
===== =====
**Tags:** map Tags: map
**Command:** "basic" Command: "basic"
in-file basic. in-file basic.
Documented full help. Documented full help.
]====] ]====]
@ -142,11 +136,11 @@ script contents
subdir/scriptname subdir/scriptname
================= =================
**Tags:** map Tags: map
**Command:** "subdir/scriptname" Command: "subdir/scriptname"
in-file scriptname. in-file scriptname.
Documented full help. Documented full help.
]====] ]====]
@ -158,11 +152,11 @@ script contents
inscript_docs inscript_docs
============= =============
**Tags:** map | badtag Tags: map | badtag
**Command:** "inscript_docs" Command: "inscript_docs"
in-file inscript_docs. in-file inscript_docs.
Documented full help. Documented full help.
]====] ]====]
@ -182,11 +176,11 @@ script contents
basic basic
===== =====
**Tags:** map Tags: map
**Command:** "basic" Command: "basic"
in-file basic (other). in-file basic (other).
Documented full help. Documented full help.
]====] ]====]
@ -198,11 +192,11 @@ script contents
subdir/scriptname subdir/scriptname
================= =================
**Tags:** map Tags: map
**Command:** "subdir/scriptname" Command: "subdir/scriptname"
in-file scriptname (other). in-file scriptname (other).
Documented full help. Documented full help.
]====] ]====]
@ -214,11 +208,11 @@ script contents
inscript_docs inscript_docs
============= =============
**Tags:** map Tags: map
**Command:** "inscript_docs" Command: "inscript_docs"
in-file inscript_docs (other). in-file inscript_docs (other).
Documented full help. Documented full help.
]====] ]====]
@ -400,15 +394,15 @@ end
function test.get_entry_long_help() function test.get_entry_long_help()
local expected = [[ local expected = [[
basic basic
***** =====
**Tags:** map Tags: map
**Command:** Command:
"basic" "basic"
Documented Documented
basic. basic.
Documented Documented
full help. full help.
@ -432,34 +426,34 @@ full help.
-- plugins/commands that have no doc files get the default template -- plugins/commands that have no doc files get the default template
expect.eq([[ls expect.eq([[ls
** ==
No help available. No help available.
]], h.get_entry_long_help('ls')) ]], h.get_entry_long_help('ls'))
expect.eq([[nodocs_hascommands expect.eq([[nodocs_hascommands
****************** ==================
No help available. No help available.
]], h.get_entry_long_help('nodocs_hascommands')) ]], h.get_entry_long_help('nodocs_hascommands'))
expect.eq([[nodocs_hascommands expect.eq([[nodocs_hascommands
****************** ==================
No help available. No help available.
]], h.get_entry_long_help('nodoc_command')) ]], h.get_entry_long_help('nodoc_command'))
expect.eq([[Nodocs samename. expect.eq([[Nodocs samename.
This command has the same name as its host plugin but no rst docs.]], h.get_entry_long_help('nodocs_samename')) This command has the same name as its host plugin but no rst docs.]], h.get_entry_long_help('nodocs_samename'))
expect.eq([[nodocs_nocommand expect.eq([[nodocs_nocommand
**************** ================
No help available. No help available.
]], h.get_entry_long_help('nodocs_nocommand')) ]], h.get_entry_long_help('nodocs_nocommand'))
expect.eq([[nodocs_script expect.eq([[nodocs_script
************* =============
No help available. No help available.
]], h.get_entry_long_help('nodocs_script')) ]], h.get_entry_long_help('nodocs_script'))
expect.eq([[inscript_short_only expect.eq([[inscript_short_only
******************* ===================
No help available. No help available.
]], h.get_entry_long_help('inscript_short_only')) ]], h.get_entry_long_help('inscript_short_only'))
@ -468,11 +462,11 @@ No help available.
expect.eq([[inscript_docs expect.eq([[inscript_docs
============= =============
**Tags:** map | badtag Tags: map | badtag
**Command:** "inscript_docs" Command: "inscript_docs"
in-file inscript_docs. in-file inscript_docs.
Documented full help.]], h.get_entry_long_help('inscript_docs')) Documented full help.]], h.get_entry_long_help('inscript_docs'))
end end