Skip to content

Commit cc08bae

Browse files
committed
Documentation updates.
1 parent 6ffb71c commit cc08bae

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

include/tidy.h

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extern "C" {
8484
** public API function internally. In most cases, the public API
8585
** functions simply call an internal function.
8686
** - - -
87-
** @note This documention _is not_ a substitute for browsing the source
87+
** @note This documentation _is not_ a substitute for browsing the source
8888
** code. Although the public API is fairly well documented, the
8989
** internal API is a very long, very slow, work-in-progress.
9090
******************************************************************************/
@@ -410,7 +410,7 @@ TIDY_EXPORT ctmbstr TIDY_CALL tidyPlatform(void);
410410
/** Get status of current document.
411411
** @param tdoc An instance of a TidyDoc to query.
412412
** @result Returns the highest of `2` indicating that errors were present in
413-
** the docment, `1` indicating warnings, and `0` in the case of
413+
** the document, `1` indicating warnings, and `0` in the case of
414414
** everything being okay.
415415
*/
416416
TIDY_EXPORT int TIDY_CALL tidyStatus( TidyDoc tdoc );
@@ -493,7 +493,7 @@ TIDY_EXPORT int TIDY_CALL tidyLoadConfig(TidyDoc tdoc, /**< The Tid
493493
*/
494494
TIDY_EXPORT int TIDY_CALL tidyLoadConfigEnc(TidyDoc tdoc, /**< The TidyDoc to which to apply the configuration. */
495495
ctmbstr configFile, /**< The complete path to the file to load. */
496-
ctmbstr charenc /**< The encodingto use. See the _enc2iana struct for valid values. */
496+
ctmbstr charenc /**< The encoding to use. See the _enc2iana struct for valid values. */
497497
);
498498

499499
/** Determine whether or not a particular file exists. On Unix systems, the use
@@ -543,6 +543,14 @@ TIDY_EXPORT int TIDY_CALL tidySetOutCharEncoding(TidyDoc tdoc, /**< The
543543
** @defgroup Configuration Configuration Options
544544
**
545545
** Functions for getting and setting Tidy configuration options.
546+
**
547+
** @note In general, you should expect that options you set should stay set.
548+
** This isn't always the case, though, because Tidy will adjust options
549+
** for internal use during the lexing, parsing, cleaning, and printing
550+
** phases, but will restore them after the printing process. If you
551+
** require access to user configuration values at any time between the
552+
** tidyParseXXX() process and the tidySaveXXX() process, make sure to
553+
** keep your own copy.
546554
** @{
547555
******************************************************************************/
548556

@@ -815,15 +823,17 @@ TIDY_EXPORT Bool TIDY_CALL tidyOptResetToDefault(TidyDoc tdoc, /**<
815823
*/
816824
TIDY_EXPORT Bool TIDY_CALL tidyOptResetAllToDefault( TidyDoc tdoc );
817825

818-
/** Take a snapshot of current config settings.
826+
/** Take a snapshot of current config settings. These settings are stored
827+
** within the tidy document. Note, however, that snapshots do not reliably
828+
** survive the tidyParseXXX() process, as Tidy uses the snapshot mechanism
829+
** in order to store the current configuration right at the beginning of the
830+
** parsing process.
819831
** @param tdoc The tidy document for which to take a snapshot.
820832
** @result Returns a bool indicating success or failure.
821833
*/
822834
TIDY_EXPORT Bool TIDY_CALL tidyOptSnapshot( TidyDoc tdoc );
823835

824-
/** Apply a snapshot of config settings to a document, such as after document
825-
** processing. This will ensure that any values which Tidy may have changed
826-
** are back to the intended configuration.
836+
/** Apply a snapshot of config settings to a document.
827837
** @param tdoc The tidy document for which to apply a snapshot.
828838
** @result Returns a bool indicating success or failure.
829839
*/
@@ -841,7 +851,10 @@ TIDY_EXPORT Bool TIDY_CALL tidyOptDiffThanDefault( TidyDoc tdoc );
841851
*/
842852
TIDY_EXPORT Bool TIDY_CALL tidyOptDiffThanSnapshot( TidyDoc tdoc );
843853

844-
/** Copy current configuration settings from one document to another.
854+
/** Copy current configuration settings from one document to another. Note
855+
** that the destination document's existing settings will be stored as that
856+
** document's snapshot prior to having its option values overwritten by the
857+
** source document's settings.
845858
** @result Returns a bool indicating success or failure.
846859
*/
847860
TIDY_EXPORT Bool TIDY_CALL tidyOptCopyConfig(TidyDoc tdocTo, /**< The destination tidy document. */
@@ -1459,7 +1472,7 @@ TIDY_EXPORT Bool TIDY_CALL tidySetPrettyPrinterCallback(TidyDoc tdoc,
14591472

14601473
/** Parse markup in named file.
14611474
** @result Returns the highest of `2` indicating that errors were present in
1462-
** the docment, `1` indicating warnings, and `0` in the case of
1475+
** the document, `1` indicating warnings, and `0` in the case of
14631476
** everything being okay.
14641477
*/
14651478
TIDY_EXPORT int TIDY_CALL tidyParseFile(TidyDoc tdoc, /**< The tidy document to use for parsing. */
@@ -1469,14 +1482,14 @@ TIDY_EXPORT int TIDY_CALL tidyParseFile(TidyDoc tdoc, /**< The tidy d
14691482
/** Parse markup from the standard input.
14701483
** @param tdoc The tidy document to use for parsing.
14711484
** @result Returns the highest of `2` indicating that errors were present in
1472-
** the docment, `1` indicating warnings, and `0` in the case of
1485+
** the document, `1` indicating warnings, and `0` in the case of
14731486
** everything being okay.
14741487
*/
14751488
TIDY_EXPORT int TIDY_CALL tidyParseStdin( TidyDoc tdoc );
14761489

14771490
/** Parse markup in given string.
14781491
** @result Returns the highest of `2` indicating that errors were present in
1479-
** the docment, `1` indicating warnings, and `0` in the case of
1492+
** the document, `1` indicating warnings, and `0` in the case of
14801493
** everything being okay.
14811494
*/
14821495
TIDY_EXPORT int TIDY_CALL tidyParseString(TidyDoc tdoc, /**< The tidy document to use for parsing. */
@@ -1485,7 +1498,7 @@ TIDY_EXPORT int TIDY_CALL tidyParseString(TidyDoc tdoc, /**< The tidy
14851498

14861499
/** Parse markup in given buffer.
14871500
** @result Returns the highest of `2` indicating that errors were present in
1488-
** the docment, `1` indicating warnings, and `0` in the case of
1501+
** the document, `1` indicating warnings, and `0` in the case of
14891502
** everything being okay.
14901503
*/
14911504
TIDY_EXPORT int TIDY_CALL tidyParseBuffer(TidyDoc tdoc, /**< The tidy document to use for parsing. */
@@ -1494,7 +1507,7 @@ TIDY_EXPORT int TIDY_CALL tidyParseBuffer(TidyDoc tdoc, /**< The tidy
14941507

14951508
/** Parse markup in given generic input source.
14961509
** @result Returns the highest of `2` indicating that errors were present in
1497-
** the docment, `1` indicating warnings, and `0` in the case of
1510+
** the document, `1` indicating warnings, and `0` in the case of
14981511
** everything being okay.
14991512
*/
15001513
TIDY_EXPORT int TIDY_CALL tidyParseSource(TidyDoc tdoc, /**< The tidy document to use for parsing. */

0 commit comments

Comments
 (0)