-
Notifications
You must be signed in to change notification settings - Fork 53
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
14 changed files
with
4,230 additions
and
24 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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
|
||
# Created by https://www.gitignore.io/api/node | ||
# Edit at https://www.gitignore.io/?templates=node | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# End of https://www.gitignore.io/api/node | ||
|
||
# TypeScript output | ||
out/ | ||
|
||
# dist | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"printWidth": 80, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
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,34 @@ | ||
{ | ||
"name": "texlab-citeproc", | ||
"version": "0.1.0", | ||
"description": "LaTeX Language Server", | ||
"repository": "https://github.com/latex-lsp/texlab.git", | ||
"author": "Eric Förster <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"dist": "webpack", | ||
"build": "tsc -p .", | ||
"watch": "tsc -p . --watch", | ||
"lint": "tslint --project .", | ||
"format": "prettier --write \"src/**/*.{ts,json}\" \"*.{ts,json,yml,md}\" \".vscode/**/*.{json}\"" | ||
}, | ||
"devDependencies": { | ||
"@citation-js/core": "^0.4.0-rc.4", | ||
"@citation-js/plugin-bibtex": "^0.4.0-rc.4", | ||
"@citation-js/plugin-csl": "^0.4.0-rc.4", | ||
"@types/jsdom": "^12.2.3", | ||
"@types/node": "^11.12.0", | ||
"@types/turndown": "^5.0.0", | ||
"@types/webpack": "^4.4.26", | ||
"null-loader": "^0.1.1", | ||
"prettier": "^1.14.3", | ||
"ts-loader": "^5.3.3", | ||
"ts-node": "^8.0.3", | ||
"tslint": "^5.11.0", | ||
"tslint-config-prettier": "^1.15.0", | ||
"turndown": "^5.0.3", | ||
"typescript": "^3.0.3", | ||
"webpack": "^4.29.6", | ||
"webpack-cli": "^3.3.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare module '@citation-js/core' { | ||
export class Cite { | ||
constructor(text: string); | ||
|
||
public format(type: string, options: any): string; | ||
} | ||
} |
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,13 @@ | ||
import { Cite } from '@citation-js/core'; | ||
import '@citation-js/plugin-bibtex'; | ||
import '@citation-js/plugin-csl'; | ||
import fs from 'fs'; | ||
|
||
const code = fs.readFileSync('entry.bib').toString(); | ||
const cite = new Cite(code); | ||
const html = cite.format('bibliography', { | ||
format: 'html', | ||
template: 'apa', | ||
lang: 'en-US', | ||
}); | ||
console.log(html); |
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,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es6", | ||
"lib": ["es6"], | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"sourceMap": true, | ||
"strict": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true | ||
}, | ||
"include": ["src/**/*"] | ||
} |
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,20 @@ | ||
{ | ||
"extends": ["tslint:latest", "tslint-config-prettier"], | ||
"rules": { | ||
"no-implicit-dependencies": false, | ||
"interface-name": false, | ||
"max-classes-per-file": false, | ||
"object-literal-sort-keys": false, | ||
"variable-name": [ | ||
true, | ||
"ban-keywords", | ||
"check-format", | ||
"allow-leading-underscore", | ||
"allow-pascal-case" | ||
], | ||
"no-empty": false, | ||
"no-console": false, | ||
"no-conditional-assignment": false, | ||
"no-bitwise": false | ||
} | ||
} |
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,44 @@ | ||
import path from 'path'; | ||
import { Configuration, ContextReplacementPlugin } from 'webpack'; | ||
|
||
const config: Configuration = { | ||
target: 'node', | ||
entry: './src/main.ts', | ||
mode: 'production', | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), | ||
filename: 'citeproc.js', | ||
libraryTarget: 'commonjs2', | ||
devtoolModuleFilenameTemplate: '../[resource-path]', | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.js', '.json'], | ||
}, | ||
plugins: [ | ||
// Do not resolve canvas API of jsdom (jsdom/lib/jsdom/utils.js 186:21-40) | ||
new ContextReplacementPlugin(/jsdom[/\\]lib/, /^$/), | ||
|
||
// Do not resolve streaming API of parse5 (parse5/lib/index.js 55:23-49) | ||
new ContextReplacementPlugin(/parse5[/\\]lib/, /^$/), | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: 'ts-loader', | ||
}, | ||
], | ||
}, | ||
{ | ||
// Map browser dependencies to an empty module | ||
test: /node_modules[/\\](sync-request|isomorphic-fetch|ws)[/\\]/, | ||
use: 'null-loader', | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.