djplaner / word-to-canvas-module

A userscript that will create a Canvas Module (including all module items) from a Word document (using special styles)

Home Page:https://djplaner.github.io/word-to-canvas-module/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Explore using a leading tab in headings for Canvas indent

djplaner opened this issue · comments

Check each heading, if there are leading tabs before the actual content - give the option for this to indent the heading/item in the Canvas module.

Tasks

  • Update code to handle all conversions
  • Update the documentation
  • Update the sample Word doc

Status

Currently w2c is getting rid of the tab characters in the HTML. However, mammoth should be converting them to a tab character.

It clears tab characters in headings, but within the text it will show tab characters (multiple spaces) but showing it in the browser they'll disappear

Re-design

Can't use tab characters, what other options exist that someone could type meaningfully into a Word document

Canvas module items can be indented up to 5 levels in

Define additional styles

Heading 1 is the normal and then Heading 1 - indent 1, Heading 1 - indent 2 etc are defined as the further indents.

w2c then handles this by

  • Mammoth adds a span.w2c-indentX inside the original heading
  • wordConverter checks and extracts the indentX and adds it to item definition
  • canvas::c2m_Modules::addItem looks for that indent