User contributions
16 July 2007
The rest of the filters
no edit summary
mTranslating Table markup
no edit summary
mTranslating Figure markup
no edit summary
mSimple replacements
no edit summary
mRemoving unwanted markup
no edit summary
mRemoving unwanted markup
no edit summary
mClick and navigate to chapters and sections
no edit summary
mClick and navigate to chapters and sections
no edit summary
Setting up ConTeXt document
no edit summary
mNavigating to HTML page
no edit summary
mHTML to ConTeXt
no edit summary
Click and navigate to chapters and sections
no edit summary
Setting up ConTeXt document
no edit summary
Setting up ConTeXt document
no edit summary
Navigating to HTML page
no edit summary
mNavigating to HTML page
no edit summary
Navigating to HTML page
no edit summary
HTML and ConTeXt
A Solution
mHTML and ConTeXt
The Problem
The rest of the filters
New page: <pre> # Now we transfer the syntactically altered html to a string Object # and manipulate that object further newdoc=@article.inner_html # remove empty space in the beginning newdoc.g...
Translating Table markup
New page: <pre> # Tables : placing them # replace <p><img> by equivalent command in context (@article/"table").each do |tab| if tab.at("caption") tab.swap(" \\placetable[split]{#{tab.at("capt...
Translating Figure markup
New page: <pre> Let's deal with figure references first # when we encounter a reference to a figure inside the...
Simple replacements
New page: For many elements we need not do nothing more than translating the HTML elements into correspoding ConTeXt elements and filling it up with the "inner html". Elements such as h1, strong etc...
Removing unwanted markup
New page: Not all the markup in HTML is needed. We need to remove them first. The following is based on the markup used in Informl. <pre> # Function: scrape_page.rb def scrape_the_page(pagePath,oF...
HTML to ConTeXt
no edit summary
HTML to ConTeXt
New page: Here is where most of the fun happens. I will try to illustrate the HTML to ConTeXt translation for the various markup elements one by one.
Click and navigate to chapters and sections
New page: In this example, we created new pages for chapters and sections so that each part of the document could be authored by a different person. In Informl new pages are indicated by the CSS cl...
Setting up ConTeXt document
New page: <pre> mainfil="annrep.tex" # open a file to output ConTeXt document `r...
Navigating to HTML page
no edit summary
Navigating to HTML page
New page: The next step is to retrieve the HTML pages created in the step above. Here I have used the ruby library 'open-uri' to retrieve the web-page and another libray 'hpricot' to edit these page...
HTML and ConTeXt
Translating HTML into ConTeXt using Ruby
HTML and ConTeXt
no edit summary
HTML and ConTeXt
no edit summary
HTML and ConTeXt
Filtering HTML into ConTeXt
HTML and ConTeXt
no edit summary
File:Wiki prev2.jpg
Identifying chapter names
File:Wiki prev.jpg
Preview feature of the Wiki page
HTML and ConTeXt
no edit summary
HTML and ConTeXt
no edit summary