Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Create OpenDocument text files with pure JavaScript

License

NotificationsYou must be signed in to change notification settings

connium/simple-odf

Repository files navigation

simple-odf is a library for creating Open Document Format text files using Typescript/JavaScript and Node.js.

VersionContinuous IntegrationcodecovDependenciesKnown Vulnerabilitiessemantic-releasecode style: prettier

Table of Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.Seeusage for notes on how to integrate the project in your software.

Prerequisites

To get started locally, follow these instructions:

  1. Make sure that you have Node 10.x or later installed.See instructionshere.

  2. Make sure that you have yarn installed; see instructions here.

  3. simple-odf usesnpm for running development scripts.If you haven't already done so, pleaseinstall npm.

Installing

  1. Make a fork of this repo.

  2. Clone the forked repo to your local computer using git.

    Open terminal and type:

    git clone https://github.com/<your_username>/simple-odf
  3. Runnpm install from the root of your clone of this project to install dependencies.

    # navigate into the cloned repocd simple-odf# install the dependenciesnpm install

Building the Module

To make a local build run:

npm buildnpm pack

This generates a number of javascript files in thedist/ directory and asimple-odf-<version-number>.tgz file in the project root.

To actually use the locally built lib, switch to another repository reproducing the specific issue you want to fix (or just generate a local repo). Then install the locally built package:

cd<path-to-your-other-repo>npm install<path-to-the-simple-odf-repo>/*.tgz

Testing

There are two different kind of tests which can be run locally:

Unit Tests

Each class of project should be tested isolated which is done by the unit tests. To run them, just executenpm test.

Integration Tests

There are also some tests which verify that the resulting document is correct. These cannot be run yet.

When debugging a specific test, changedescribe() orit() tofdescribe() andfit() to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.

Usage

If you want to use this package in your software, add it to your project dependencies via npm or yarn.

# npmnpm i simple-odf# yarnyarn add simple-odf

Now you can create your first document.

constsimpleOdf=require('simple-odf');constdocument=newsimpleOdf.TextDocument();constbody=document.getBody();body.addHeading('Welcome to simple-odf');body.addParagraph('The quick, brown fox jumps over a lazy dog.');document.saveFlat('/home/homer/Welcome.fodf');

See theexamples for more details on how to use the library.

Built With

Contributing

If you want to contribute to simple-odf, you are very welcome. Send issues and pull requests with your ideas.

Versioning

We useSemVer for versioning. For the versions available, see thetags on this repository.

Credits

This project exists thanks to all thecontributors who participate in this project.

License

This project is licensed under the MIT License - see theLICENSE file for details.

Documentation

Learn more about theOASIS Open Document Format.

About

Create OpenDocument text files with pure JavaScript

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp