Removing unwanted markup

From Wiki
Jump to navigation Jump to search

< HTML_to_ConTeXt

Not all the markup in HTML is needed. We need to remove them first. The following is based on the markup used in Informl.

# Function: scrape_page.rb

def scrape_the_page(pagePath,oFile,hFile)
items_to_remove = [
  "#menus",        #menus notice
  "head",          #table of contents

@article = (doc/"#container").each do |content|
  #remove unnecessary content and edit links
  items_to_remove.each { |x| (content/x).remove }