Gromacs
2024.3
|
#include <gromacs/onlinehelp/helpwritercontext.h>
Hyperlink data for writing out help.
This class is separate from HelpWriterContext to allow constructing the list of links once and reusing them across multiple help writer contexts. This is used when exporting all the help from the wrapper binary to avoid repeatedly constructing the same data structure for each help item.
While the links are in principle independent of the output format, the constructor takes the output format to be able to preformat the links, avoiding repeated processing during markup substitution. Could be hidden behind the scenes in HelpWriterContext, but that would complicate the implementation.
Public Member Functions | |
HelpLinks (HelpOutputFormat format) | |
Initializes an empty links collection for the given output format. | |
void | addLink (const std::string &linkName, const std::string &targetName, const std::string &displayName) |
Adds a link. More... | |
Friends | |
class | HelpWriterContext |
Allows the context to use the links. | |
void gmx::HelpLinks::addLink | ( | const std::string & | linkName, |
const std::string & | targetName, | ||
const std::string & | displayName | ||
) |
Adds a link.
[in] | linkName | Name of the link in input text. |
[in] | targetName | Hyperlink target. |
[in] | displayName | Text to show as the link. |
Any occurrence of linkName
in the text passed to markup substitution methods in HelpWriterContext is made into a hyperlink to targetName
if the markup format supports that.