All Projects → file2html → file2html

file2html / file2html

Licence: MIT license
JS convertor of files to HTML and CSS code

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to file2html

omynote
众山小笔记 - 集中管理你的读书笔记
Stars: ✭ 154 (+431.03%)
Mutual labels:  reading
yogurl
Serve files and code over HTTP in one command. The CLI for http://yogurl.io
Stars: ✭ 45 (+55.17%)
Mutual labels:  files
xtuff
A CLI to generate stuff easy! (components, services, etc...)
Stars: ✭ 28 (-3.45%)
Mutual labels:  files
indices
Indices creates a Table of Contents sidebar for Medium articles, and enables you to skip around
Stars: ✭ 16 (-44.83%)
Mutual labels:  reading
automated-readability
Formula to detect ease of reading according to the Automated Readability Index (1967)
Stars: ✭ 46 (+58.62%)
Mutual labels:  reading
Mastering-Algorithms-with-C
This repository contains example files organized by chapters in Mastering Algorithms with C, by Kyle Loudon
Stars: ✭ 48 (+65.52%)
Mutual labels:  reading
filestack-ios
Official iOS SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
Stars: ✭ 44 (+51.72%)
Mutual labels:  files
glob-fs
file globbing for node.js. speedy and powerful alternative to node-glob. This library is experimental and does not work on windows!
Stars: ✭ 54 (+86.21%)
Mutual labels:  files
lumen-file-manager
File manager module for the Lumen PHP framework.
Stars: ✭ 40 (+37.93%)
Mutual labels:  files
files-io
Read many files with node
Stars: ✭ 19 (-34.48%)
Mutual labels:  files
mobile
📱 Readium Mobile is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.
Stars: ✭ 47 (+62.07%)
Mutual labels:  reading
go-storage
A vendor-neutral storage library for Golang: Write once, run on every storage service.
Stars: ✭ 387 (+1234.48%)
Mutual labels:  files
nucked-truth-of-files
HollyJS Moscow
Stars: ✭ 14 (-51.72%)
Mutual labels:  files
vscode-fileutils
Visual Studio Code Extension
Stars: ✭ 138 (+375.86%)
Mutual labels:  files
point-us-to-a-book
📚 reading list
Stars: ✭ 50 (+72.41%)
Mutual labels:  reading
JetStory
JetStory is an open source android app made to help you spend your waiting time reading stories that have similar length to your available time.
Stars: ✭ 20 (-31.03%)
Mutual labels:  reading
dirdf
R package: dirdf - Extracts Metadata from Directory and File Names
Stars: ✭ 57 (+96.55%)
Mutual labels:  files
vtex-cms-sauce
VTEX package for handling CMS requests.
Stars: ✭ 25 (-13.79%)
Mutual labels:  files
daily astroph
Daily dose of astro-ph reading
Stars: ✭ 37 (+27.59%)
Mutual labels:  reading
PoReader
本地小说阅读器,支持深色模式,Wifi传书,代码简洁有注释(local text reader, support dark modal, upload text by wifi)
Stars: ✭ 41 (+41.38%)
Mutual labels:  reading

file2html

Build Statusnpm npm npm Coverage Status

JS convertor of files to HTML and CSS code

Requirements

Supported formats

Usage

Installation

> npm i file2html

Installation of required engines for each file type:

> npm i file2html-text file2html-ooxml file2html-image 

Check supported formats to decide which engines you need.

Configuration

import * as file2html from 'file2html';
import TextReader from 'file2html-text';
import OOXMLReader from 'file2html-ooxml';
import ImageReader from 'file2html-image';

file2html.config({
    readers: [
        TextReader,
        OOXMLReader,
        ImageReader
    ]
});

File reading

file2html.read({
    fileBuffer, // ArrayBuffer
    meta // file2html.FileMetaInformation
}).then((file) => {
    // file is an instance of file2html.File type 
    const {styles, content} = file.getData();    
    
    // "render" a file content with styles
    document.body.innerHTML = styles + content;
});

FileMetaInformation

    {
        fileType: number; // optional
        mimeType: string; // optional
        name: string; // optional
        size: number; // optional
        creator: string; // optional
        createdAt: string; // optional
        modifiedAt: string; // optional
    }

File

    {
        getMeta () {
            // returns object of file2html.FileMetaInformation    
        }
    
        getData ()  {
            // returns object of file2html.FileData
        }
    }

FileData

    {
        meta: file2html.FileMetaInformation;
        styles: string; // css styles as a string
        content: string; // html markup as a string
    }

Showcase

StormFiles

Browser extension, file viewer:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].