diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index f096636..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index 807ea25..9727938 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store .Rproj.user .Rhistory .RData diff --git a/.travis.yml b/.travis.yml index 0fff519..b79e15a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,6 @@ language: r warnings_are_errors: true sudo: required -apt_packages: - - libtidy-dev - env: global: - CRAN: http://cran.rstudio.com diff --git a/NAMESPACE b/NAMESPACE index 557df98..6cc908c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,5 @@ # Generated by roxygen2: do not edit by hand export(tidy_html) -export(tidy_options) importFrom(Rcpp,sourceCpp) useDynLib(htmltidy) diff --git a/R/aaa.r b/R/aaa.r deleted file mode 100644 index 2daa840..0000000 --- a/R/aaa.r +++ /dev/null @@ -1,53 +0,0 @@ -#' @title HTML, XHTML & XML Options for tidy_html -#' @description This dataset contains the options (and their default settings) for -#' tidy_html. They are passed in a named-list to tidy_html -#' -#' \itemize{ -#' \item \code{Option}: Option name -#' \item \code{Type}: Option value type -#' \item \code{Default}: Is it the default for tidy_html? -#' } -#' -#' @docType data -#' @keywords datasets -#' @name tidy_options -#' -#' @references The \href{http://api.html-tidy.org/tidy/quickref_5.1.25.html}{ -#' HTML Tidy Options Quick Reference} -#' -#' @export -#' @usage tidy_options -#' @note Last updated 2016-09-09. -#' @format A data frame with 55 rows and 3 variables -NULL - -tidy_options <- structure(list(Option = c("add-xml-decl", "add-xml-space", "alt-text", -"anchor-as-name", "assume-xml-procins", "bare", "clean", "coerce-endtags", -"css-prefix", "decorate-inferred-ul", "doctype", "drop-empty-elements", -"drop-empty-paras", "drop-font-tags", "drop-proprietary-attributes", -"enclose-block-text", "enclose-text", "escape-cdata", "fix-backslash", -"fix-bad-comments", "fix-uri", "gdoc", "hide-comments", "hide-endtags", -"indent-cdata", "input-xml", "join-classes", "join-styles", "literal-attributes", -"logical-emphasis", "lower-literals", "merge-divs", "merge-emphasis", -"merge-spans", "ncr", "new-blocklevel-tags", "new-empty-tags", -"new-inline-tags", "new-pre-tags", "numeric-entities", "omit-optional-tags", -"output-html", "output-xhtml", "output-xml", "preserve-entities", -"quote-ampersand", "quote-marks", "quote-nbsp", "repeated-attributes", -"replace-color", "show-body-only", "skip-nested", "uppercase-attributes", -"uppercase-tags", "word-2000"), Type = c("Boolean", "Boolean", -"String", "Boolean", "Boolean", "Boolean", "Boolean", "Boolean", -"String", "Boolean", "DocType", "Boolean", "Boolean", "Boolean", -"Boolean", "Boolean", "Boolean", "Boolean", "Boolean", "Boolean", -"Boolean", "Boolean", "Boolean", "Boolean", "Boolean", "Boolean", -"Boolean", "Boolean", "Boolean", "Boolean", "Boolean", "AutoBool", -"Boolean", "AutoBool", "Boolean", "Tag names", "Tag names", "Tag names", -"Tag names", "Boolean", "Boolean", "Boolean", "Boolean", "Boolean", -"Boolean", "Boolean", "Boolean", "Boolean", "enum", "Boolean", -"AutoBool", "Boolean", "Boolean", "Boolean", "Boolean"), Default = c("no", -"no", "-", "yes", "no", "no", "no", "yes", "-", "no", "auto", -"yes", "yes", "no", "no", "no", "no", "no", "yes", "yes", "yes", -"no", "no", "no", "no", "no", "no", "yes", "no", "no", "yes", -"auto", "yes", "auto", "yes", "-", "-", "-", "-", "no", "no", -"no", "no", "no", "no", "yes", "no", "yes", "keep-last", "no", -"no", "yes", "no", "no", "no")), .Names = c("Option", "Type", -"Default"), row.names = 3:57, class = "data.frame") diff --git a/R/tidy.r b/R/tidy.r index 3e34576..6ebefd3 100644 --- a/R/tidy.r +++ b/R/tidy.r @@ -15,6 +15,8 @@ #' @param content atomic character or raw vector of content to tidy #' @param options named list of options #' @return Atomic character vector of tidy HTML/XML/XHTML content +#' @references \url{https://github.com/htacg/tidy-html5/blob/master/include/tidyenum.h} +#' (for definitions of the options supported above). #' @export tidy_html <- function(content, options=list(TidyXhtmlOut=TRUE)) { .Call('htmltidy_tidy_html_int', PACKAGE='htmltidy', source=content, options=options) diff --git a/man/tidy_html.Rd b/man/tidy_html.Rd index 7bd2c48..278cd45 100644 --- a/man/tidy_html.Rd +++ b/man/tidy_html.Rd @@ -27,4 +27,8 @@ Currently supported options: \code{TidyAltText}, \code{TidyBodyOnly}, \code{TidyWrapLen}, \code{TidyXhtmlOut}, \code{TidyXmlDecl}, \code{TidyXmlOut}, \code{TidyXmlTags}. } +\references{ +\url{https://github.com/htacg/tidy-html5/blob/master/include/tidyenum.h} + (for definitions of the options supported above). +} diff --git a/man/tidy_options.Rd b/man/tidy_options.Rd deleted file mode 100644 index d79e832..0000000 --- a/man/tidy_options.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/aaa.r -\docType{data} -\name{tidy_options} -\alias{tidy_options} -\title{HTML, XHTML & XML Options for tidy_html} -\format{A data frame with 55 rows and 3 variables} -\usage{ -tidy_options -} -\description{ -This dataset contains the options (and their default settings) for -tidy_html. They are passed in a named-list to tidy_html - -\itemize{ - \item \code{Option}: Option name - \item \code{Type}: Option value type - \item \code{Default}: Is it the default for tidy_html? -} -} -\note{ -Last updated 2016-09-09. -} -\references{ -The \href{http://api.html-tidy.org/tidy/quickref_5.1.25.html}{ - HTML Tidy Options Quick Reference} -} -\keyword{datasets} - diff --git a/src/htmltidy.cpp b/src/htmltidy.cpp index a405560..3e2ec27 100644 --- a/src/htmltidy.cpp +++ b/src/htmltidy.cpp @@ -1,20 +1,8 @@ #include + #include #include -// #ifdef __linux__ -// #include -// #include -// #endif -// -// #ifdef __APPLE__ -// #include -// #include -// #endif - -// libtidy docs: -// http://api.html-tidy.org/tidy/tidylib_api_5.2.0/tidyenum_8h.html#a3a1401652599150188a168dade7dc150 - // NOTE: cannot do "using namespace Rcpp;" b/c of annoying warnings about the // ambiguity of 'yes'. diff --git a/src/tidylib.c b/src/tidylib.c index e77f701..cca3685 100755 --- a/src/tidylib.c +++ b/src/tidylib.c @@ -1079,8 +1079,8 @@ int tidyDocSaveStdout( TidyDocImpl* doc ) #endif int status = 0; - uint outenc = cfg( doc, TidyOutCharEncoding ); - uint nl = cfg( doc, TidyNewline ); +// uint outenc = cfg( doc, TidyOutCharEncoding ); +// uint nl = cfg( doc, TidyNewline ); // StreamOut* out = TY_(FileOutput)( doc, stdout, outenc, nl ); // if ( 0 == status )