Use absolute path rather than silly relative path
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
"description": "Generate .docx documents with JavaScript (formerly Office-Clippy)",
|
||||
"main": "build/index.js",
|
||||
"scripts": {
|
||||
"pretest": "rimraf ./build",
|
||||
"test": "mocha-webpack \"src/**/*.ts\"",
|
||||
"prepublishOnly": "npm run build",
|
||||
"lint": "tslint --project .",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { BaseXmlComponent } from "../file/xml-components";
|
||||
import { IXmlableObject } from "../file/xml-components/xmlable-object";
|
||||
import { BaseXmlComponent } from "file/xml-components";
|
||||
import { IXmlableObject } from "file/xml-components/xmlable-object";
|
||||
|
||||
export class Formatter {
|
||||
public format(input: BaseXmlComponent): IXmlableObject {
|
||||
|
@ -4,7 +4,7 @@ import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import * as xml from "xml";
|
||||
|
||||
import { File } from "../../file";
|
||||
import { File } from "file";
|
||||
import { Formatter } from "../formatter";
|
||||
|
||||
const TEMPLATE_PATH = path.resolve(__dirname, "../../../template");
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as express from "express";
|
||||
|
||||
import { File } from "../../file";
|
||||
import { File } from "file";
|
||||
import { Compiler } from "./compiler";
|
||||
import { IPacker } from "./packer";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class Body extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class Columns extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class DocumentGrid extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class PageMargin extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class PageSize extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
import { Columns } from "./columns";
|
||||
import { DocumentGrid } from "./doc-grid";
|
||||
import { PageMargin } from "./page-margin";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent } from "../xml-components";
|
||||
import { XmlAttributeComponent } from "file/xml-components";
|
||||
|
||||
export interface IDocumentAttributesProperties {
|
||||
wpc?: string;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// http://officeopenxml.com/WPdocument.php
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { Paragraph } from "../paragraph";
|
||||
import { Table } from "../table";
|
||||
import { XmlComponent } from "../xml-components";
|
||||
import { Body } from "./body";
|
||||
import { DocumentAttributes } from "./document-attributes";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { IData } from "../media";
|
||||
import { XmlComponent } from "../xml-components";
|
||||
import { IData } from "file/media";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { Inline } from "./inline";
|
||||
|
||||
export class Drawing extends XmlComponent {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { Pic } from "./pic";
|
||||
|
||||
export class GraphicData extends XmlComponent {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../../../../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { Blip } from "./blip";
|
||||
import { SourceRectangle } from "./source-rectangle";
|
||||
import { Stretch } from "./stretch";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../../../../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
interface IBlipProperties {
|
||||
embed: string;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../../../../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class SourceRectangle extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../../../../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
class FillRectangle extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../../../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { BlipFill } from "./blip/blip-fill";
|
||||
|
||||
export class Pic extends XmlComponent {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
import { GraphicData } from "./graphic-data";
|
||||
|
||||
interface IGraphicProperties {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { Graphic } from "./graphic";
|
||||
|
||||
export class Inline extends XmlComponent {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
import { Level } from "./level";
|
||||
import { MultiLevelType } from "./multi-level-type";
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Attributes, XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
import * as paragraph from "../paragraph/formatting";
|
||||
import { ParagraphProperties } from "../paragraph/properties";
|
||||
import * as formatting from "../paragraph/run/formatting";
|
||||
import { RunProperties } from "../paragraph/run/properties";
|
||||
import { Attributes, XmlAttributeComponent, XmlComponent } from "../xml-components";
|
||||
|
||||
interface ILevelAttributesProperties {
|
||||
ilvl?: number;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class MultiLevelType extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlAttributeComponent, XmlComponent } from "../xml-components";
|
||||
import { Attributes, XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
import { LevelForOverride } from "./level";
|
||||
|
||||
class AbstractNumId extends XmlComponent {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { DocumentAttributes } from "../document/document-attributes";
|
||||
import { Indent } from "../paragraph/formatting";
|
||||
import { RunFonts } from "../paragraph/run/run-fonts";
|
||||
import { XmlComponent } from "../xml-components";
|
||||
import { AbstractNumbering } from "./abstract-numbering";
|
||||
import { Num } from "./num";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPalignment.php
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export type AlignmentOptions = "left" | "center" | "right" | "both";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPborders.php
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
class Border extends XmlComponent {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPindentation.php
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
interface IIndentAttributesProperties {
|
||||
left?: number;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class KeepLines extends XmlComponent {
|
||||
constructor() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPtextSpecialContent-break.php
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
import { Run } from "../run";
|
||||
|
||||
class Break extends XmlComponent {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPspacing.php
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export interface ISpacingProperties {
|
||||
after?: number;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class Style extends XmlComponent {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPtab.php
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class TabStop extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class NumberProperties extends XmlComponent {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// http://officeopenxml.com/WPparagraph.php
|
||||
import { IData } from "file/media";
|
||||
import { Num } from "file/numbering/num";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { IData } from "../media/data";
|
||||
import { Num } from "../numbering/num";
|
||||
import { PictureRun, Run, TextRun } from "./run";
|
||||
|
||||
import { Alignment } from "./formatting/alignment";
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPparagraphProperties.php
|
||||
import { XmlComponent } from "../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class ParagraphProperties extends XmlComponent {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPtextSpecialContent-break.php
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class Break extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class SmallCaps extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
export { Underline } from "./underline";
|
||||
export { SubScript, SuperScript } from "./script";
|
||||
export { RunFonts } from "./run-fonts";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class RunProperties extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
class TextAttributes extends XmlAttributeComponent<{space: "default" | "preserve"}> {
|
||||
protected xmlKeys = {space: "xml:space"};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
interface IRunFontAttributesProperties {
|
||||
ascii: string;
|
||||
|
@ -9,7 +9,7 @@ import { Style } from "./style";
|
||||
import { Tab } from "./tab";
|
||||
import { Underline } from "./underline";
|
||||
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class Run extends XmlComponent {
|
||||
private properties: RunProperties;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export abstract class VerticalAlign extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
class StyleAttributes extends XmlAttributeComponent<{val: string}> {
|
||||
protected xmlKeys = {val: "w:val"};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
export class Tab extends XmlComponent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Attributes, XmlComponent } from "../../xml-components";
|
||||
import { Attributes, XmlComponent } from "file/xml-components";
|
||||
|
||||
export abstract class BaseUnderline extends XmlComponent {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { DocumentAttributes } from "../document/document-attributes";
|
||||
import { XmlComponent } from "../xml-components";
|
||||
|
||||
export class Title extends XmlComponent {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { DocumentAttributes } from "../document/document-attributes";
|
||||
import { XmlComponent } from "../xml-components";
|
||||
import { Created, Creator, Description, Keywords, LastModifiedBy, Modified, Revision, Subject, Title } from "./components";
|
||||
|
||||
export interface IPropertiesOptions {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent } from "../xml-components";
|
||||
import { XmlAttributeComponent } from "file/xml-components";
|
||||
|
||||
export interface IRelationshipsAttributesProperties {
|
||||
xmlns: string;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { RelationshipsAttributes } from "./attributes";
|
||||
|
||||
export class Relationships extends XmlComponent {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { ParagraphPropertiesDefaults } from "./paragraph-properties";
|
||||
import { RunPropertiesDefaults } from "./run-properties";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { ParagraphProperties } from "../../paragraph/properties";
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
|
||||
export class ParagraphPropertiesDefaults extends XmlComponent {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { Size } from "../../paragraph/run/formatting";
|
||||
import { RunProperties } from "../../paragraph/run/properties";
|
||||
import { RunFonts } from "../../paragraph/run/run-fonts";
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
|
||||
export class RunPropertiesDefaults extends XmlComponent {
|
||||
private properties: RunProperties;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { DocumentAttributes } from "../document/document-attributes";
|
||||
import { XmlComponent } from "../xml-components";
|
||||
import { DocumentDefaults } from "./defaults";
|
||||
import { ParagraphStyle } from "./style";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export interface ILatentStyleExceptionAttributesProperties {
|
||||
name?: string;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { LatentStyleException } from "./exceptions";
|
||||
|
||||
export class LatentStyles extends XmlComponent {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
interface IComponentAttributes {
|
||||
val: string;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
import * as paragraph from "../../paragraph";
|
||||
import * as formatting from "../../paragraph/run/formatting";
|
||||
import { RunProperties } from "../../paragraph/run/properties";
|
||||
import { XmlAttributeComponent, XmlComponent } from "../../xml-components";
|
||||
|
||||
import { BasedOn, Name, Next, QuickFormat } from "./components";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export class TableGrid extends XmlComponent {
|
||||
constructor(cols: number[]) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../xml-components";
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export type WidthTypes = "dxa" | "pct" | "nil" | "auto";
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { IXmlableObject } from "file/xml-components/xmlable-object";
|
||||
import { Paragraph } from "../paragraph";
|
||||
import { XmlComponent } from "../xml-components";
|
||||
import { IXmlableObject } from "../xml-components/xmlable-object";
|
||||
import { TableGrid } from "./grid";
|
||||
import { TableProperties, WidthTypes } from "./properties";
|
||||
|
||||
|
Reference in New Issue
Block a user