Skip to content

sharpred/ti-html2label

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ti-html2native

convert html to titanium object

##Note This project is a work in progress, so use advisedly. Raise an issue for any problems or suggestions you have.

Note this project now uses attributed strings on iOS and Android, so must be built using Ti SDK 4.0.0 or above.

This project was inspired by Fokke Zandberg's HTML 2 AttributedString converter for Titanium and uses some code/ideas from that project.

##Installation

  1. Open a terminal prompt
  2. Type npm install
  3. Then type grunt This will build the module and run the example project in the iOS simulator. Run grunt android to run on a connected Android device or emulator.

##How it works ###Components The module is built using titaniumifier and uses the following npm components;

###Process

  1. Create a whitelist of html tags and attributes that you wish to support in your app. See here for information on how to create a whitelist or look at the example project for details.
  2. Note that embedded tags are currently styled as the parent. Embedded tag styling will be added when attributed strings is supported for Android in Titanium 4.x
  3. Save the whitelist as a JSON document or JSON object in your app.
  4. Create a .tss file that defines the tags you have whitelisted, plus the following;
  • label
  • tableView
  • tableViewSection
  • tableViewRow
  • imageView
  1. Look at the example app for details of how to use the module. Note the module uses $.createStyle extensively, so you need to use .call($) when invoking the createHTML function.

About

convert html to titanium label

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published