Skip to content

Commit

Permalink
Merge pull request #2 from CatalaLang/feat-tab
Browse files Browse the repository at this point in the history
Feat: support Tabs
  • Loading branch information
EmileRolley authored Sep 14, 2023
2 parents 9c50116 + 5e88478 commit d7fc0f0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ List of supported features:
* ✅ Hyperlinks
* ✅ Numbering
* ✅ Tables
* Tabs
* Table Of Contents
* Tabs
* Table Of Contents
* ✅ Page Numbers
* ❌ Change Tracking
* ❌ Math
Expand Down
8 changes: 8 additions & 0 deletions src/LeaderType.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @see https://docx.js.org/api/enums/LeaderType.html */
type t = [
| #dot
| #hyphen
| #middleDot
| #none
| #underscore
]
9 changes: 9 additions & 0 deletions src/PositionalTab.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @see https://docx.js.org/api/classes/PositionalTab.html */
type option = {
alignment: [#left | #center | #right],
relativeTo: [#margin | #indent],
leader: LeaderType.t,
}

@module("docx") @new
external make: option => TextRun.children = "PositionalTab"
4 changes: 4 additions & 0 deletions src/Tab.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @see https://docx.js.org/api/classes/Tab.html */
@module("docx")
@new
external make: unit => TextRun.children = "Tab"
9 changes: 3 additions & 6 deletions src/TabStopDefinition.res
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
type tabStopPosition = | @as("9026") Max

@unwrap
type numberOrTabStopPosition = Number(float) | TabStopPosition(tabStopPosition)
let maxPosition = 9026

type t = {
@as("type") type_: [#left | #right | #center | #bar | #clear | #decimal | #end | #num | #start],
position: numberOrTabStopPosition,
leader?: [#dot | #hyphen | #middleDot | #none | #underscore],
position: int,
leader?: LeaderType.t,
}

0 comments on commit d7fc0f0

Please sign in to comment.