11178d775b
This is a rather large refactoring of Tidy's messaging system. This was done mostly to allow non-C libraries that cannot adequately take advantage of arg_lists a chance to query report filter information for information related to arguments used in constructing an error message. Three main goals were in mind for this project: - Don't change the contents of Tidy's existing output sinks. This will ensure that changes do no affect console Tidy users, or LibTidy users who use the output sinks directly. This was accomplished 100% other than some improved cosmetics in the output. See tidy-html5-tests repository, the `refactor` and `more_messages_changes` branches for these minor diffs. - Provide an API that is simple and also extensible without having to write new error filters all the time. This was accomplished by adding the new message callback `TidyMessageCallback` that provides callback functions an opaque object representing the message, and an API to query the message for wanted details. With this, we should never have to add a new callback routine again, as additional API can simply be written against the opaque object. - The API should work the same as the rest of LibTidy's API in that it's consistent and only uses simple types with wide interoperability with other languages. Thanks to @gagern who suggested the model for the API in #409. Although the API uses the "Tidy" way off accessing data via an iterator rather than an index, this can be easily abstracted in the target language. There are two *major* API breaking changes: - Removed TidyReportFilter2 - This was only used by one application in the entire world, and was a hacky kludge that served its purpose. TidyReportCallback (né TidyReportFilter3) is much better. If, for some reason, this affects you, I recommend using TidyReportCallback instead. It's a minor change for your application. - Renamed TidyReportFilter3 to TidyReportCallback - This name is much more semantic, and much more sensible in light of improved callback system. As the name implies, it remains capable of *only* receiving callbacks for Tidy "reports." Introducing TidyMessageCallback, and a new message interrogation API. - As its name implies, it is able to capture (and optionally suppress) *all* of Tidy's output, including the dialogue messages that never make it to the existing report filters. - Provides an opaque `TidyMessage` and an API that can be used to query against it to find the juicy goodness inside. - For example, `tidyGetMessageOutput( tmessage )` will return the complete, localized message. - Another example, `tidyGetMessageLine( tmessage )` will return the line the message applies to. - You can also get information about the individual arguments that make up a message. By using the `tidyGetMessageArguments( tmessage )` itorator and `tidyGetNextMessageArgument` you will obtain an opaque `TidyMessageArgument` which has its own interrogation API. For example: - tidyGetArgType( tmessage, &iterator ); - tidyGetArgFormat( tmessage, &iterator ); - tidyGetArgValueString( tmessage, &iterator ); - …and so on. Other major changes include refactoring `messages.c` to use the new message "object" directly when emitting messages to the console or output sinks. This allowed replacement of a lot of specialized functions with generalized ones. Some of this generalizing involved modifications to the `language_xx.h` header files, and these are all positive improvements even without the above changes. |
||
---|---|---|
build | ||
console | ||
experimental | ||
include | ||
localize | ||
man | ||
README | ||
src | ||
.gitignore | ||
CMakeLists.txt | ||
README.md | ||
version.txt |
HTACG HTML Tidy
All other READMEs and related materials can be found in README/. Although all of our materials should be linked in this README, be sure to check this directory for documents we’ve not yet added to this document.
Building HTML Tidy
- For build instructions please see README/BUILD.md.
Branches and Versions
Learn about which branches are available, which branch you should use, and how HTML Tidy’s versioning scheme works.
- Learn about version numbering in README/VERSION.md.
- Learn about our repository branches in README/BRANCHES.md.
Contributing and Development Guides
We gladly accept PRs! Read about some of our contribution guidelines, and check out some of the additional explanatory documents that will aid your understanding of how to accomplish certain things in HTML Tidy.
General Contribution Guidelines
These are some general guidelines that will help you help us when it comes to making your own contributions to HTML Tidy.
- Learn about our contributing guidelines in README/CONTRIBUTING.md.
- Understand HTML Tidy’s source code style in README/CODESTYLE.md.
Adding Features Guides
When you’re ready to add a great new feature, these write-ups may be useful.
- Learn how to add new element attributes to HTML Tidy by reading README/ATTRIBUTES.md.
- Discover how to add new tags to Tidy in README/TAGS.md.
- If you want to add new messages to Tidy, read README/MESSAGE.md.
- Configuration options can be added according to README/OPTIONS.md.
Language Localization Guides
Tidy supports localization, and welcomes translations into various languages. Please read up on how to localize HTML Tidy.
- The general README for localizing can be found in /README/LOCALIZE.md.
- And /localize/README.md contains specific instructions for localizing.
Other Important Links
- site: http://www.html-tidy.org/
- source: https://github.com/htacg/tidy-html5
- binaries: http://binaries.html-tidy.org
- bugs: https://github.com/htacg/tidy-html5/issues
- list: https://lists.w3.org/Archives/Public/html-tidy/
- api and quickref: http://api.html-tidy.org/
History
This repository should be considered canonical for HTML Tidy as of 2015-January-15.
-
This repository originally transferred from w3c.github.com/tidy-html5, now redirected to the current site.
-
First moved to Github from tidy.sourceforge.net. Note, this site is kept only for historic reasons, and is not now well maintained.
Tidy is the granddaddy of HTML tools, with support for modern standards. Have fun...
License
HTML Tidy and LibTidy are free and open source software with a permissive license.
- You can read the complete license in README/LICENSE.md.