html application doc,GitHub - metanorma/html2doc: Ruby gem that converts an HTML page/document into ...

Convert any AsciiMath and MathML to Word’s native mathematical formatting language, OOXML. Word supports copy-pasting MathML into Word and converting it into OOXML; however the conversion is not infallible (we have in the past found problems with \sum: Word claims parameters were missing, and inserting dotted squares to indicate as much), and you may need to post-edit the OOXML.

The gem does attempt to repair the MathML input, to bring it in line with Word’s OOXML’s expectations. If you find any issues with AsciiMath or MathML input, please raise an issue.

Identify any footnotes in the document (defined as hyperlinks with attributes class = "Footnote" or epub:type = "footnote"), and render them as Microsoft Word footnotes.

The corresponding footnote content is any div or aside element with the same @id attribute as the footnote points to; e.g. 3, pointing to .

By default, the footnote hyperlink contents are overwritten with the autonumbering element: 1 is replaced with

If the footnote hyperlink already contains (as a child) an element marked up as , only that span is replaced by the Microsoft autonumber element; any text surrounding it is preserved in both the footnote reference and the footnote target. For example, 1) will render as the footnote 1), both in the link and the target.

Resize any local images in the HTML file to fit within the maximum page size. (Word will otherwise crash on reading the document.)

Optionally apply list styles with predefined bullet and numbering from a Word CSS to the unordered and ordered lists in the document, restarting numbering for each ordered list.

Convert all lists to native Word HTML rendering (using paragraphs with MsoListParagraphCxSpFirst, MsoListParagraphCxSpMiddle, MsoListParagraphCxSpLast styles)

Convert any internal @id anchors to a@name anchors; Word only hyperlinks to the latter.

Generate a filelist.xml listing of all files to be bundled into the Word document.

Assign the class MsoNormal to any paragraphs that do not have a class, so that they can be treated as Normal Style when editing the Word document.

Inject Microsoft Word-specific CSS into the HTML document. If a CSS file is not supplied, the CSS file used is at lib/html2doc/wordstyle.css is used by default. Microsoft Word HTML has particular requirements from its CSS, and you should review the sample CSS before replacing it with your own. (This generic CSS can be overridden by CSS already in the HTML document, since the generic CSS is injected at the top of the document.)

Bundle up the local images, the HTML file of the document proper, and the header.html file representing header/footer information, into a MIME file, and save that file to disk (so that Microsoft Word can deal with it as a Word file.)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值