ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - f34nk/tidy_ex: Elixir binding to the granddaddy of HTML tools
Elixir binding to the granddaddy of HTML tools. Contribute to f34nk/tidy_ex development by creating an account on GitHub.
Visit Site

GitHub - f34nk/tidy_ex: Elixir binding to the granddaddy of HTML tools

GitHub - f34nk/tidy_ex: Elixir binding to the granddaddy of HTML tools

This project is not maintained anymore.

Build status ModestEx version Hex.pm

Broom by faisalovers from the Noun Project

TidyEx

TidyEx corrects and cleans up HTML content by fixing markup errors.

Elixir/Erlang bindings for htacg's tidy-html5

The granddaddy of HTML tools, with support for modern standards http://www.html-tidy.org

The binding is implemented as a C-Node following the excellent example in Overbryd's package nodex. If you want to learn how to set up bindings to C/C++, you should definitely check it out.

  • nodex
    • distributed Elixir
    • save binding with C-Nodes

C-Nodes are external os-processes that communicate with the Erlang VM through erlang messaging. That way you can implement native code and call into it from Elixir in a safe predictable way. The Erlang VM stays unaffected by crashes of the external process.

Example

For more examples please checkout tests.

test "can parse broken html" do
  result = TidyEx.parse("<div>Hello<span>World")
  assert result == "<div>Hello<span>World</span></div>"
end

test "can clean and repair broken html" do
  result = TidyEx.clean_and_repair("<div>Hello<span>World")
  assert result == "<div>Hello<span>World</span></div>"
end

test "can run diagnostics on invalid html" do
  result = TidyEx.run_diagnostics("<pp>Hello World</p>")
  assert result == "line 1 column 1 - Error: <pp> is not recognized!\nThis document has errors that must be fixed before\nusing HTML Tidy to generate a tidied up version."
end

Installation

Available on hex.

def deps do
  [
    {:tidy_ex, "~> 0.1.0-dev"}
  ]
end

Target dependencies

cmake 3.x
erlang-dev
erlang-xmerl
erlang-parsetools

Compile and test

mix deps.get
mix compile
mix test

Cloning

git clone [email protected]:f34nk/tidy_ex.git
cd tidy_ex

All binding targets are added as submodules in the target/ folder.

git submodule update --init --recursive --remote
mix deps.get
mix compile
mix test
mix test.target

Cleanup

mix clean

Roadmap

See CHANGELOG.

  • Bindings
    • Call as C-Node
    • Call as dirty-nif
  • Tests
    • Call as C-Node
    • Call as dirty-nif
    • Target tests
    • Feature tests
    • Package test
  • Features
    • Set tidy-html5 options
    • Serialize any string with valid or broken html
    • Clean and repair
    • Run diagnostics
  • Documentation
  • Publish as hex package

Icon Credit

Broom by faisalovers from the Noun Project

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory