From de97628f8fa2248f36db41fc0f509becd98ba609 Mon Sep 17 00:00:00 2001 From: Jim Derry Date: Sun, 1 Feb 2015 14:20:41 +0800 Subject: [PATCH] Deprecated tidyReleaseDate(). Returns epoch time (tdb). Removed dates from help, manpage, output, cmake, etc. --- CMakeLists.txt | 13 +------------ console/tidy.c | 25 ++++++++++++------------- htmldoc/tidy1.xsl | 17 +++++++++-------- include/tidy.h | 6 +++++- src/localize.c | 5 ++--- src/version.h | 2 +- version.txt | 3 +-- 7 files changed, 31 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2489ce0..429bbfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,22 +9,12 @@ file(READ version.txt versionFile) if (NOT versionFile) message(FATAL_ERROR "Unable to determine libtidy version. version.txt file is missing.") endif() -string(STRIP "${versionFile}" versionFile) -string(REGEX REPLACE "(.*)[\r\n|\n](.*)" "\\1" LIBTIDY_VERSION ${versionFile}) -string(REGEX REPLACE "(.*)[\r\n|\n](.*)" "\\2" LIBTIDY_DATE ${versionFile}) - -# establish version number +string(STRIP "${versionFile}" LIBTIDY_VERSION) string(REPLACE "." ";" VERSION_LIST ${LIBTIDY_VERSION}) list(GET VERSION_LIST 0 TIDY_MAJOR_VERSION) list(GET VERSION_LIST 1 TIDY_MINOR_VERSION) list(GET VERSION_LIST 2 TIDY_POINT_VERSION) -# establish version date -string(REPLACE "." ";" VERSION_LIST ${LIBTIDY_DATE}) -list(GET VERSION_LIST 0 tidy_YEAR) -list(GET VERSION_LIST 1 tidy_MONTH) -list(GET VERSION_LIST 2 tidy_DAY) - # Allow developer to select is Dynamic or static library built set( LIB_TYPE STATIC ) # set default static option( BUILD_SHARED_LIB "Set ON to build Shared (DLL) Library" OFF ) @@ -77,7 +67,6 @@ add_definitions ( -DHAVE_CONFIG_H ) add_definitions ( -DSUPPORT_UTF16_ENCODINGS=1 ) add_definitions ( -DSUPPORT_ASIAN_ENCODINGS=1 ) add_definitions ( -DSUPPORT_ACCESSIBILITY_CHECKS=1 ) -add_definitions ( -DRELEASE_DATE="${tidy_YEAR}/${tidy_MONTH}/${tidy_DAY}" ) add_definitions ( -DLIBTIDY_VERSION="${LIBTIDY_VERSION}" ) if(BUILD_SHARED_LIB) diff --git a/console/tidy.c b/console/tidy.c index ff0f9a8..430df55 100644 --- a/console/tidy.c +++ b/console/tidy.c @@ -412,7 +412,7 @@ static void print_xml_help_option( void ) static void xml_help( void ) { printf( "\n" - "\n", tidyReleaseDate()); + "\n", tidyLibraryVersion()); print_xml_help_option(); printf( "\n" ); } @@ -434,11 +434,10 @@ static void help( ctmbstr prog ) { printf( "\n"); printf( "%s [options...] [file...] [options...] [file...]\n", get_final_name(prog) ); - printf( "Utility to clean up and pretty print HTML/XHTML/XML\n"); + printf( "Utility to clean up and pretty print HTML/XHTML/XML.\n"); printf( "\n"); - printf( "This is an HTML5-aware experimental fork of HTML Tidy. Date %s. Version %s\n", - tidyReleaseDate(), tidyLibraryVersion() ); + printf( "This is modern HTML Tidy version %s.\n", tidyLibraryVersion() ); printf( "\n"); #ifdef PLATFORM_NAME @@ -459,8 +458,8 @@ static void help( ctmbstr prog ) printf( "Single letter options apart from -f may be combined\n"); printf( "as in: tidy -f errs.txt -imu foo.html\n"); printf( "\n"); - printf( "For more information on this HTML5-aware experimental fork of Tidy,\n" ); - printf( "see http://w3c.github.com/tidy-html5/\n" ); + printf( "For more information about HTML Tidy, see\n" ); + printf( " http://www.html-tidy.org/\n" ); printf( "\n"); printf( "For more information on HTML, see the following:\n" ); printf( "\n"); @@ -470,13 +469,13 @@ static void help( ctmbstr prog ) printf( " HTML: The Markup Language (an HTML language reference)\n" ); printf( " http://dev.w3.org/html5/markup/\n" ); printf( "\n"); - printf( "File bug reports at https://github.com/w3c/tidy-html5/issues/\n" ); - printf( "or send questions and comments to html-tidy@w3.org\n" ); + printf( "File bug reports at https://github.com/htacg/tidy-html5/issues/\n" ); + printf( "or send questions and comments to public-htacg@w3.org.\n" ); printf( "\n"); printf( "Validate your HTML documents using the W3C Nu Markup Validator:\n" ); printf( "\n"); printf( " http://validator.w3.org/nu/" ); - printf( "\n"); + printf( "\n\n"); } static Bool isAutoBool( TidyOption topt ) @@ -782,7 +781,7 @@ void printXMLOption( TidyDoc tdoc, TidyOption topt, OptionDesc *d ) static void XMLoptionhelp( TidyDoc tdoc ) { printf( "\n" - "\n", tidyReleaseDate(), tidyLibraryVersion()); + "\n", tidyLibraryVersion()); ForEachOption( tdoc, printXMLOption ); printf( "\n" ); } @@ -943,10 +942,10 @@ static void optionvalues( TidyDoc tdoc ) static void version( void ) { #ifdef PLATFORM_NAME - printf( "HTML Tidy for HTML5 (experimental) for %s %s, version %s\n", - PLATFORM_NAME, tidyReleaseDate(), tidyLibraryVersion() ); + printf( "HTML Tidy for %s version %s\n", + PLATFORM_NAME, tidyLibraryVersion() ); #else - printf( "HTML Tidy for HTML5 (experimental) %s\n", tidyReleaseDate() ); + printf( "HTML Tidy version %s\n", tidyLibraryVersion() ); #endif } diff --git a/htmldoc/tidy1.xsl b/htmldoc/tidy1.xsl index 414eb53..5058b97 100644 --- a/htmldoc/tidy1.xsl +++ b/htmldoc/tidy1.xsl @@ -41,7 +41,7 @@ - .\" tidy man page for the HTML5 fork of Tidy + .\" tidy man page for the HTML Tidy .TH TIDY 1 "" "HTML Tidy" "" @@ -56,7 +56,7 @@ .SH SYNOPSIS \fBtidy\fR [option ...] [file ...] [option ...] [file ...] .SH DESCRIPTION -Tidy reads HTML(5), XHTML(5) and XML files and writes cleaned-up markup. For HTML variants, it detects, reports, and corrects many common coding errors and strives to produce visually equivalent markup that is both conformant to the HTML specifications and that works in most browsers. +Tidy reads HTML, XHTML, and XML files and writes cleaned-up markup. For HTML variants, it detects, reports, and corrects many common coding errors and strives to produce visually equivalent markup that is both conformant to the HTML specifications and that works in most browsers. .LP A common use of Tidy is to convert plain HTML to XHTML. For generic XML files, Tidy is limited to correcting basic well-formedness errors and pretty printing. .LP @@ -348,10 +348,10 @@ appearing in content with another backslash. .SH SEE ALSO -For more information about the experimental HTML5 fork of Tidy: +For more information about HTML Tidy: .RS 4 .LP -http://w3c.github.com/tidy-html5/ +http://www.html-tidy.org/ .RE .LP For more information on HTML: @@ -369,10 +369,10 @@ http://dev.w3.org/html5/markup/ For bug reports and comments: .RS 4 .LP -https://github.com/w3c/tidy-html5/issues/ +https://github.com/htacg/tidy-html5/issues/ .RE .LP -Or send questions and comments to \fBhtml-tidy@w3.org\fR +Or send questions and comments to \fBpublic-htacg@w3.org\fR. .LP Validate your HTML documents using the \fBW3C Nu Markup Validator\fR: .RS 4 @@ -380,9 +380,10 @@ Validate your HTML documents using the \fBW3C Nu Markup Validator\fR: http://validator.w3.org/nu/ .RE .SH AUTHOR -\fBTidy\fR was written by \fBDave Raggett\fR <dsr@w3.org>, and subsequently maintained by a team at http://tidy.sourceforge.net/ +\fBTidy\fR was written by \fBDave Raggett\fR <dsr@w3.org>, and subsequently maintained by a team at http://tidy.sourceforge.net/, +and now maintained by \fBHTACG\fR (http://www.htacg.org). .LP -The sources for the HTML5 fork of \fBTidy\fR are available at https://github.com/w3c/tidy-html5/ under the MIT Licence. +The sources for \fBHTML Tidy\fR are available at https://github.com/htacg/tidy-html5/ under the MIT Licence. diff --git a/include/tidy.h b/include/tidy.h index 0bf8cb1..87d5453 100755 --- a/include/tidy.h +++ b/include/tidy.h @@ -324,7 +324,11 @@ TIDY_EXPORT void TIDY_CALL tidySetAppData( TidyDoc tdoc, void* appData ); /** Get application data set previously */ TIDY_EXPORT void* TIDY_CALL tidyGetAppData( TidyDoc tdoc ); -/** Get release date (version) for current library */ +/** Get release date (version) for current library + ** @deprecated tidyReleaseDate() is deprecated in favor of semantic + ** versioning and should be replaced with tidyLibraryVersion(). + */ + TIDY_EXPORT ctmbstr TIDY_CALL tidyReleaseDate(void); /** Get version number for the current library */ diff --git a/src/localize.c b/src/localize.c index bcf0414..bf49eeb 100755 --- a/src/localize.c +++ b/src/localize.c @@ -1868,12 +1868,11 @@ void TY_(NeedsAuthorIntervention)( TidyDocImpl* doc ) void TY_(GeneralInfo)( TidyDocImpl* doc ) { if (!cfgBool(doc, TidyShowInfo)) return; - tidy_out(doc, "About this fork of Tidy: https://github.com/htacg/tidy-html5/tree/develop-500\n"); + tidy_out(doc, "About HTML Tidy: https://github.com/htacg/tidy-html5/tree/develop-500\n"); tidy_out(doc, "Bug reports and comments: https://github.com/htacg/tidy-html5/issues\n"); tidy_out(doc, "Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/\n"); - tidy_out(doc, "HTML5 language tutorial: http://www.w3schools.com/html/html5_intro.asp\n"); tidy_out(doc, "Latest HTML specification: http://dev.w3.org/html5/spec-author-view/\n"); - tidy_out(doc, "Validate your HTML5 documents: http://validator.w3.org/nu/\n"); + tidy_out(doc, "Validate your HTML documents: http://validator.w3.org/nu/\n"); tidy_out(doc, "Lobby your company to join the W3C: http://www.w3.org/Consortium\n"); } diff --git a/src/version.h b/src/version.h index ac2d85d..e4e9d97 100644 --- a/src/version.h +++ b/src/version.h @@ -8,7 +8,7 @@ #ifdef RELEASE_DATE static const char TY_(release_date)[] = RELEASE_DATE; #else -static const char TY_(release_date)[] = "2014/08/03"; +static const char TY_(release_date)[] = "1970/01/01"; #endif #ifdef LIBTIDY_VERSION static const char TY_(library_version)[] = LIBTIDY_VERSION; diff --git a/version.txt b/version.txt index 7ac679f..e94f14f 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1 @@ -4.9.3 -2015.01.31 \ No newline at end of file +4.9.3 \ No newline at end of file