Giter VIP home page Giter VIP logo

mammoth-verbose's Introduction

Mammoth Verbose: Automatic style mapping for Mammoth

This program wraps around the Mammoth python library to convert .docx to HTML, preserving all source style names as classes in the HTML and including original .docx style formatting information as attributes on the output HTML elements.

$ python mammoth-verbose.py [--map] [--verbose] -i _filename_

Options

--map: Map source .docx style names to class names in the output HTML. Default is true.

--verbose: Preserve source .docx style formatting as attributes on the output HTML. Default is false.

-i: Input filename. Required.

For example:

$ python mammoth-verbose.py --map --verbose -i /Users/hederis/Documents/alice.docx

The output html file will be created in the same directory as the input docx file.

To-Do

  • Add some validation to ensure input filename is docx
  • Add some validation to see if styles.xml file exists; if not, fail gracefully.

mammoth-verbose's People

Contributors

nelliemckesson avatar

Stargazers

BigBlueHat avatar

Watchers

 avatar James Cloos avatar Tzviya avatar

mammoth-verbose's Issues

Preserve direct formatting

Currently, the script only preserves formatting added by styles. Add handling to also preserve direct formatting.

Remove style name customization after inserting style info

Once the style info is added as attributes, the style name modifications should be removed. If the entire style name is just the modification suffix (meaning there was no style to begin with), then the class name should be removed entirely.

When the --verbose option is not invoked, then the style names should not be changed to begin with.

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.