Gromacs  2020.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions | Variables | Directories | Files
Help Formatting for Online Help (onlinehelp)
+ Collaboration diagram for Help Formatting for Online Help (onlinehelp):

Description

Provides functionality for formatting help text for console and reStructuredText.

This module provides helper functions and classes for formatting text to the console and as reStructuredText through a single interface. The main components of the module are:

The formatting syntax for strings accepted by this module is described in Help formatting. The module is currently exposed outside GROMACS only through this formatting syntax, not any API calls.

Author
Teemu Murtola teemu.nosp@m..mur.nosp@m.tola@.nosp@m.gmai.nosp@m.l.com

Classes

class  gmx::GlobalCommandLineHelpContext
 Helper for passing CommandLineHelpContext into parse_common_args(). More...
 
class  gmx::TextTableFormatter::Impl
 Private implementation class for TextTableFormatter. More...
 
struct  gmx::TextTableFormatter::Impl::ColumnData
 Manages a single column for TextTableFormatter. More...
 
class  gmx::TextTableFormatter
 Formats rows of a table for text output. More...
 
class  gmx::HelpManager
 Helper for providing interactive online help. More...
 
class  gmx::AbstractSimpleHelpTopic
 Abstract base class for help topics that have simple text and no subtopics. More...
 
class  gmx::AbstractCompositeHelpTopic
 Abstract base class for help topics that have simple text and subtopics. More...
 
class  gmx::SimpleHelpTopic< HelpText >
 Template for simple implementation of AbstractSimpleHelpTopic. More...
 
class  gmx::CompositeHelpTopic< HelpText >
 Template for simple implementation of AbstractCompositeHelpTopic. More...
 
class  gmx::anonymous_namespace{helpwritercontext.cpp}::IWrapper
 Custom output interface for HelpWriterContext::Impl::processMarkup(). More...
 
class  gmx::anonymous_namespace{helpwritercontext.cpp}::WrapperToString
 Wraps markup output into a single string. More...
 
class  gmx::anonymous_namespace{helpwritercontext.cpp}::WrapperToVector
 Wraps markup output into a vector of string (one line per element). More...
 
class  gmx::HelpWriterContext::Impl::SharedState
 Shared, non-modifiable state for context objects. More...
 
class  gmx::HelpLinks
 Hyperlink data for writing out help. More...
 
class  gmx::HelpWriterContext
 Context information for writing out help. More...
 
class  gmx::IHelpTopic
 Provides a single online help topic. More...
 
class  gmx::RstParagraphIterator
 Iterator over reStructuredText paragraphs. More...
 

Functions

std::string gmx::anonymous_namespace{helpwritercontext.cpp}::repall (const std::string &s, int nsr, const t_sandr sa[])
 Replaces all entries from a list of replacements.
 
template<size_t nsr>
std::string gmx::anonymous_namespace{helpwritercontext.cpp}::repall (const std::string &s, const t_sandr(&sa)[nsr])
 Replaces all entries from a list of replacements.
 
std::string gmx::anonymous_namespace{helpwritercontext.cpp}::toUpperCase (const std::string &text)
 Makes the string uppercase. More...
 
std::string gmx::anonymous_namespace{helpwritercontext.cpp}::removeExtraNewlinesRst (const std::string &text)
 Removes extra newlines from reStructuredText. More...
 

Variables

const char gmx::anonymous_namespace{helpwritercontext.cpp}::g_titleChars [] = "=-^*~+#'_."
 Characters used for reStructuredText title underlining.
 
const t_sandr gmx::anonymous_namespace{helpwritercontext.cpp}::sandrTty []
 List of replacements for console output. More...
 
const t_sandr gmx::anonymous_namespace{helpwritercontext.cpp}::sandrRst []
 List of replacements for reStructuredText output. More...
 

Directories

directory onlinehelp
 Help Formatting for Online Help (onlinehelp)
 
directory tests
 Unit tests for Help Formatting for Online Help (onlinehelp).
 

Files

file  helpformat.cpp
 Implements functions in helpformat.h.
 
file  helpformat.h
 Declares common string formatting routines for online help.
 
file  helpmanager.cpp
 Implements gmx::HelpManager.
 
file  helpmanager.h
 Declares gmx::HelpManager.
 
file  helptopic.cpp
 Implements classes and functions from helptopic.h.
 
file  helptopic.h
 Declares helper classes for implementing gmx::IHelpTopic.
 
file  helpwritercontext.cpp
 Implements gmx::HelpWriterContext.
 
file  helpwritercontext.h
 Declares gmx::HelpWriterContext.
 
file  ihelptopic.h
 Declares gmx::IHelpTopic.
 
file  rstparser.cpp
 Implements classes from rstparser.h.
 
file  rstparser.h
 Declares classes for (partial) parsing of reStructuredText.
 
file  helpformat.cpp
 Tests for help string formatting functions and classes.
 
file  helpmanager.cpp
 Tests for help topic management and help topic formatting.
 
file  helpwritercontext.cpp
 Tests for help text formatting.
 
file  mock_helptopic.cpp
 Implements classes in mock_helptopic.h.
 
file  mock_helptopic.h
 Declares mock implementation of gmx::IHelpTopic.
 

Function Documentation

std::string gmx::anonymous_namespace{helpwritercontext.cpp}::removeExtraNewlinesRst ( const std::string &  text)

Removes extra newlines from reStructuredText.

Parameters
[in]textInput text.
Returns
text with all sequences of more than two newlines replaced with just two newlines.
Exceptions
std::bad_allocif out of memory.
std::string gmx::anonymous_namespace{helpwritercontext.cpp}::toUpperCase ( const std::string &  text)

Makes the string uppercase.

Parameters
[in]textInput text.
Returns
text with all characters transformed to uppercase.
Exceptions
std::bad_allocif out of memory.

Variable Documentation

const t_sandr gmx::anonymous_namespace{helpwritercontext.cpp}::sandrRst[]
Initial value:
= {
{ "[TT]", "``" }, { "[tt]", "``" }, { "[BB]", "**" }, { "[bb]", "**" },
{ "[IT]", "*" }, { "[it]", "*" }, { "[MATH]", "" }, { "[math]", "" },
{ "[CHEVRON]", "<" }, { "[chevron]", ">" }, { "[MAG]", "\\|" }, { "[mag]", "\\|" },
{ "[INT]", "integral" }, { "[FROM]", " from " }, { "[from]", "" }, { "[TO]", " to " },
{ "[to]", " of" }, { "[int]", "" }, { "[SUM]", "sum" }, { "[sum]", "" },
{ "[SUB]", "_" }, { "[sub]", "" }, { "[SQRT]", "sqrt(" }, { "[sqrt]", ")" },
{ "[EXP]", "exp(" }, { "[exp]", ")" }, { "[LN]", "ln(" }, { "[ln]", ")" },
{ "[LOG]", "log(" }, { "[log]", ")" }, { "[COS]", "cos(" }, { "[cos]", ")" },
{ "[SIN]", "sin(" }, { "[sin]", ")" }, { "[TAN]", "tan(" }, { "[tan]", ")" },
{ "[COSH]", "cosh(" }, { "[cosh]", ")" }, { "[SINH]", "sinh(" }, { "[sinh]", ")" },
{ "[TANH]", "tanh(" }, { "[tanh]", ")" }, { "[PAR]", "\n\n" }, { "[GRK]", "" },
{ "[grk]", "" }
}

List of replacements for reStructuredText output.

const t_sandr gmx::anonymous_namespace{helpwritercontext.cpp}::sandrTty[]
Initial value:
= {
{ "\\*", "*" }, { "\\=", "=" }, { "[REF]", "" }, { "[ref]", "" },
{ "[TT]", "" }, { "[tt]", "" }, { "[BB]", "" }, { "[bb]", "" },
{ "[IT]", "" }, { "[it]", "" }, { "[MATH]", "" }, { "[math]", "" },
{ "[CHEVRON]", "<" }, { "[chevron]", ">" }, { "[MAG]", "|" }, { "[mag]", "|" },
{ "[INT]", "integral" }, { "[FROM]", " from " }, { "[from]", "" }, { "[TO]", " to " },
{ "[to]", " of" }, { "[int]", "" }, { "[SUM]", "sum" }, { "[sum]", "" },
{ "[SUB]", "_" }, { "[sub]", "" }, { "[SQRT]", "sqrt(" }, { "[sqrt]", ")" },
{ "[EXP]", "exp(" }, { "[exp]", ")" }, { "[LN]", "ln(" }, { "[ln]", ")" },
{ "[LOG]", "log(" }, { "[log]", ")" }, { "[COS]", "cos(" }, { "[cos]", ")" },
{ "[SIN]", "sin(" }, { "[sin]", ")" }, { "[TAN]", "tan(" }, { "[tan]", ")" },
{ "[COSH]", "cosh(" }, { "[cosh]", ")" }, { "[SINH]", "sinh(" }, { "[sinh]", ")" },
{ "[TANH]", "tanh(" }, { "[tanh]", ")" }, { "[PAR]", "\n\n" }, { "[GRK]", "" },
{ "[grk]", "" }
}

List of replacements for console output.