Scripts for transforming html, including removing elements by CSS/XPath and transforming Metawiki webpages to epub friendly html with chapters for all the headings.
Ruby Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Readme.md
keep_specifed_elems.rb
keep_specifed_elems_inline.rb
keep_specifed_elems_inline_glob.sh
remove_elems.rb
remove_elems_inline.rb
remove_elems_inline_glob.sh
remove_empty_tags.rb
remove_missing_image_tag.rb
remove_page_images.sh
wiki_to_epub_html.rb

Readme.md

Web Utilities {#readmeTitle}

Scripts for transforming html, including removing elements by CSS/XPath and transforming Metawiki webpages to epub friendly html with chapters for all the headings. {#description}

Usage

remove_elems.rb html {css|xpath}*
Removes the specified elements using css and/or xpath
  
remove_elems_inline.rb html {css|xpath}*
Removes the specified elements using css and/or xpath inplace

remove_elems_inline_glob.sh {glob}
Runs `remove_elems_inline.rb` on each file in the glob

wiki_to_epub_html.rb save_dir base_url url
wiki_to_epub_html.rb config_file
Coverts metawiki webpages to epub friendly html. 

keep_specifed_elems.rb html {css|xpath}*
Keeps only the specified elements using css and/or xpath
  
keep_specifed_elems_inline.rb {css|xpath}*
Keeps only the specified elements using css and/or xpath inlplace

keep_specifed_elems_inline_glob.sh {glob}
Runs `keep_specifed_elems_inline.rb` on each file in the glob

Prerequisites

  • Ruby 1.9 with the nokogiri gem

Install

  • Put the scripts in your $PATH

Options for wiki_to_epub_html

  • base_url is of the form www.example.com
  • A url is either a full or relative url.

###config_file
a config_file is:

save_dir
base_url
{url}+			

In the config_file metadata can be specified using a : e.g.

:author:Urobuchi Gen
:series:Fate/Zero

The follow + and - can be used as true and false or add and remove

  • resize_images
  • numbered number the files from 1
  • css:ele to add/remove css elements
  • xpath:ele to add/remove xpath elements
  • title_gsub:regex Text to remove
  • filename the base filename only used with fmt
  • fmt format for number e.g %2d
  • fullsize_images get full size images

Other options

  • -css to remove all css elements, -xpath remove all xpath element

Issues

None yet

Licence

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License

Authors

  • Bilal Syed Hussain