-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,926 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ | |
|
||
# integration test output | ||
tests/__image_snapshots__/__diff_output__ | ||
|
||
# parcel | ||
.cache | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env node | ||
|
||
var server = require("../src/converter/server"); | ||
var path = require("path"); | ||
var fs = require("fs"); | ||
var program = require("commander"); | ||
|
||
program | ||
.version("0.0.1") | ||
.usage("[options] <tex file>") | ||
.parse(process.argv); | ||
|
||
if (program.args.length != 1) { | ||
program.outputHelp(); | ||
process.exit(1); | ||
} | ||
|
||
server.start(program.args[0]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const Bundler = require("parcel-bundler"); | ||
const app = require("express")(); | ||
const render = require("./index").render; | ||
const path = require("path"); | ||
const tmp = require("tmp-promise"); | ||
|
||
module.exports.start = async input => { | ||
const tmpDir = await tmp.dir(); | ||
const htmlPath = await render({ | ||
input: input, | ||
output: tmpDir.path | ||
}); | ||
|
||
console.log("💅 Starting server at http://localhost:8000"); | ||
const bundler = new Bundler(htmlPath, { hmrPort: 8001 }); | ||
app.use(bundler.middleware()); | ||
app.listen(8000); | ||
}; |
Oops, something went wrong.