Giter Site home page Giter Site logo

odt-html5's Introduction

ODT to HTML5

Convert ODT text document to HTML5.

Fetching

Just get the code and make temporary folder writable by web server. For example:

git clone https://github.com/jroivas/odt-html5.git
cd odt-html5

Converting

To convert ODT to static HTML files do:

python gen_html.py file.odt

Will generate HTML pages with default settings.

Settings

One can define converting and output settings on command line. Most common feature is to define title, it's easy as:

python gen_html.py --title "My example title" file.odt

By default pages are named like page_pagenum.html where pagenum is numbering starting from 1. You may want for example localize the page name or change it. It's easy with prefix option:

python gen_html.py --prefix test file.odt

This will generate now pages named as: test_pagenum.html

Sometimes your document contains index and you want your landing page (from first page to first chapter) contain more stylish info. Index can be generated with:

python gen_html.py --index index file.odt

That will generate index.html with contents from first page till first chapter, and index of all chapters.

In the end you may end up using something like:

python gen_html.py --index frontpage --page p --title "My example" file.odt

This will generate frontpage.html and p_2.html, p_3.html, ...

To see full options:

python gen_html.py -h

Distributing

To distribute your document as HTML, provide following:

  • All generated .html files
  • img folder with extracted images
  • odt.js
  • odt_black.css OR odt_white.css renamed to odt.css
  • jquery.min.js
    • You may download it with script: ./download.sh

Known issues

  • Not fully compatible with ODT spec, only minimal set supported
    • Feel free to improve
  • Tabs does not work properly
    • Mostly because of limitations of HTML
    • Could however handle them slightly better
  • Refactoring needed

odt-html5's People

Contributors

jroivas avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.