Difference between revisions of "Template:Function 343"

From NetHackWiki
Jump to navigation Jump to search
(Documentation!)
m (Register in Category:Templates)
 
(One intermediate revision by the same user not shown)
Line 29: Line 29:
  
 
Line numbers work only in some files, mostly data files. Most source files are marked for syntax highlighting and they lose their line number markings (and the syntax highlighting does not work either).
 
Line numbers work only in some files, mostly data files. Most source files are marked for syntax highlighting and they lose their line number markings (and the syntax highlighting does not work either).
 
'''Experimental:'''
 
 
For preview use only. Do not commit any changes that use this (yet).
 
  
 
-- [[User:Furey|Furey]] ([[User talk:Furey|talk]]) 13:31, 27 June 2024 (UTC)
 
-- [[User:Furey|Furey]] ([[User talk:Furey|talk]]) 13:31, 27 June 2024 (UTC)
 +
[[Category:Templates|{{PAGENAME}}]]
 
</noinclude>
 
</noinclude>

Latest revision as of 09:56, 28 June 2024


This template references a named element of a source file in the NetHack 3.4.3 source code.

The restriction to NetHack 3.4.3 is deliberate. Even when new versions of NetHack are released, this template will never change. This template is useful for documenting the NetHack 3.4.3 source code itself, and for discussions that will preserve their meaning over time instead of becoming nonsense as their references quietly shift under them.

Syntax:

  • Basic syntax: {{function_343|filename|elementname}}
  • Hide filename: {{function_343|filename|elementname|x}}

The filename can be of the form src/attrib.c or just attrib.c. src/attrib.c is preferred. Header files such as include/monattk.h and data files such as dat/Valkyrie.des are also supported.

The elementname can be a function name, a line number, or any tag provided by the source file page.

Usually, the output will include filename. If a third argument is given, then the output will omit filename.

Examples:

  Syntax Shown as
Basic syntax {{function_343|src/attrib.c|acurrstr}} acurrstr in src/attrib.c
Hide filename {{function_343|attrib.c|acurrstr|x}} acurrstr
Line number {{function_343|dat/rumors.tru|line232}} line232 in dat/rumors.tru

Bugs:

Line numbers work only in some files, mostly data files. Most source files are marked for syntax highlighting and they lose their line number markings (and the syntax highlighting does not work either).

-- Furey (talk) 13:31, 27 June 2024 (UTC)