Skip to content

Commit ca99098

Browse files
authored
Merge pull request #15 from bperel/freshen-up
Freshen up
2 parents b99ce42 + d521213 commit ca99098

File tree

8 files changed

+5863
-1111
lines changed

8 files changed

+5863
-1111
lines changed

.eslintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 12,
5+
"sourceType": "module"
6+
},
7+
"plugins": ["@typescript-eslint"],
8+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"]
9+
}

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM node:10-buster-slim
1+
FROM node:16-slim
22

33
WORKDIR /home/wiki-as-git
4-
COPY package.json package-lock.json wiki-as-git.js ./
4+
COPY package.json package-lock.json tsconfig.json wiki-as-git.ts ./
55

6-
RUN apt-get update && apt-get install -y --no-install-recommends libgit2-dev git && apt-get clean \
7-
&& npm rebuild && npm install
6+
RUN apt-get update && apt-get install -y --no-install-recommends git && apt-get clean
7+
RUN npm install
88

9-
ENTRYPOINT ["/home/wiki-as-git/wiki-as-git.js"]
9+
ENTRYPOINT ["./node_modules/.bin/ts-node", "wiki-as-git.ts"]

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,26 @@ An easy way to check the revision history of a Wikipedia article using Git comma
66

77
# Install
88

9-
* You can run wiki-as-git using our Docker image :
10-
`docker run --rm -it -v $(pwd)/articles:/home/wiki-as-git/articles bperel/wiki-as-git "Hello world"`
9+
* You can run wiki-as-git using our Docker image, see Usage.
1110

12-
* Or you can install it manually :
13-
* `libgit2-dev` is required for the `nodegit` dependency.
14-
* Then run `npm rebuild && npm install`
11+
* Or you can install its dependencies manually : `npm install`
1512

1613
## Usage
1714

18-
`wiki-as-git.js [--language=en] "<Article name>"`
15+
### With Docker, using a pre-built image
16+
17+
`docker run --rm -it -v $(pwd)/articles:/home/wiki-as-git/articles bperel/wiki-as-git '<Article name>'`
18+
19+
Example:
20+
`docker run --rm -it -v $(pwd)/articles:/home/wiki-as-git/articles bperel/wiki-as-git '"Hello, World!" program'`
21+
22+
### Without Docker
23+
24+
`npx ts-node wiki-as-git.ts [--language=en] '<Article name>'`
25+
26+
Example:
27+
`npx ts-node wiki-as-git.ts '"Hello, World!" program'`
28+
1929

2030
If you have bot credentials for the wiki that you wish to target, copy-paste `settings.example.json` into a file named `settings.json` and fill in the bot's credentials.
2131
This will lift some limits of the Mediawiki API and make wiki-as-git much faster.

0 commit comments

Comments
 (0)