Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
809682c
working except github
piotrpdev Oct 26, 2023
33d7fc0
fix: github.html
piotrpdev Nov 3, 2023
13a2596
feat: replace jQuery with native, fix GitHub auth
piotrpdev Nov 4, 2023
9f4f766
feat: replace Moment with native
piotrpdev Nov 4, 2023
38c745c
refactor: move demo to another vite config
piotrpdev Nov 4, 2023
0c049c5
fix: correct README to use new demo script
piotrpdev Nov 4, 2023
4892233
feat: use jsdelivr for jsgl
piotrpdev Nov 5, 2023
ff8dbe7
feat: update jQuery, switch to vitest
piotrpdev Nov 5, 2023
bb5081e
fix: small test and build script improv
piotrpdev Nov 5, 2023
f3bd284
feat: deploy demo to gh pages
piotrpdev Nov 5, 2023
4029e03
fix: change gh pages to use dispatch
piotrpdev Nov 5, 2023
183afa5
fix: change demo to use relative paths
piotrpdev Nov 5, 2023
de063b6
feat: Build gh_pages with action
piotrpdev Nov 5, 2023
9301d16
feat: prepare for npm
piotrpdev Nov 5, 2023
206f60c
refactor: remove docker mention
piotrpdev Nov 5, 2023
8333351
refactor: add dist until npm issue is resolved
piotrpdev Nov 5, 2023
d10f1af
feat: favicon, nicer README
piotrpdev Nov 5, 2023
7d19da2
fix: package name in library bug
piotrpdev Nov 5, 2023
552569b
fix: regex bug
piotrpdev Nov 5, 2023
2c81dc5
fix: update library
piotrpdev Nov 5, 2023
9fa3762
feat: rewrite AsyncLoader to Promises
piotrpdev Nov 5, 2023
84710a3
refactor: remove dist since npm issue resolved
piotrpdev Nov 7, 2023
c20be0f
refactor: remove unused travis file
piotrpdev Nov 7, 2023
4636ef8
fix: umd file extension, refactor: npm in readme
piotrpdev Nov 7, 2023
6a8427a
fix: spelling
piotrpdev Nov 7, 2023
9889622
fix: dist file names in package.json
piotrpdev Nov 7, 2023
7f34060
fix: didn't build in npm workflow
piotrpdev Nov 7, 2023
8181358
refactor: make demo use jsdelivr
piotrpdev Nov 7, 2023
bc50bf7
fix: bump version in README
piotrpdev Nov 7, 2023
7c0e7d6
feat: switch crypto-js to spark-md5
piotrpdev Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/img/gitline-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/gitline-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Deploy demo to GH Pages

on:
release:
types: [released]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install and Build
run: |
npm ci
npm run build:demo
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: demo-dist/

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
34 changes: 34 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish NPM package

on:
release:
types: [released]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules/
npm-debug.log
.idea
dist/
demo-dist/
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"cSpell.words": [
"allmerges",
"authordate",
"authoremail",
"authorname",
"authortimestamp",
"blecher",
"childs",
"committerdate",
"committeremail",
"committername",
"committertimestamp",
"contentpanel",
"datacallback",
"datetime",
"directchild",
"directparent",
"examplejson",
"fullname",
"gitline",
"graphicalpanel",
"headerpanel",
"headsha",
"jhead",
"jsgl",
"loadingpanel",
"myfile",
"newdata",
"newparents",
"Overv",
"overwitten",
"parenthashes",
"Piotr",
"piotrpdev",
"Placzek",
"refnames",
"specifity",
"ssha",
"textpanel"
]
}
95 changes: 63 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,76 @@
![gitline sample](https://github.com/blecher-at/gitline/blob/master/doc/gitline.png)
![gitline example](./.github/img/gitline-example.png)

gitline - A git history to HTML renderer implemented in TypeScript
===========
[![Travis CI Status](https://travis-ci.org/blecher-at/gitline.svg?branch=master)](https://travis-ci.org/blecher-at/gitline/builds/)
# gitline - A git history to HTML renderer implemented in TypeScript

<img align="right" width="200px" src="https://github.com/piotrpdev/gitline/assets/99439005/ce6723a1-d9fc-47a7-aa06-84552df2669f" />

> [!NOTE]
> This is a fork of the original project by [blecher-at](https://github.com/blecher-at/gitline). This fork updates the project to a more modern approach and removes a lot of libraries that are no longer needed.

The idea is to have this on a central server or your local machine, to keep tabs on what your team is doing :)
Needs a JSON file as input (generated with [git2json](https://github.com/blecher-at/git2json))

gitline tries to be aware of your branching scheme. It will autodetect the category and assignment of branches and groups commits accordingly.

Run it on a server (requires docker)
-----
docker run -dP -e REPO_URL="https://github.com/blecher-at/gitline" -e REPO_NAME="Gitline" blecherat/gitline

see https://github.com/blecher-at/gitline/tree/master/docker-image for more details
## Usage

[![NPM](https://nodei.co/npm/@piotrpdev/gitline.png)](https://nodei.co/npm/@piotrpdev/gitline/)

[An NPM package is available for this project](https://www.npmjs.com/package/@piotrpdev/gitline). You can see typical usage in [`src/demo/`](src/demo/).

It usually looks something like this:

```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Gitline Example</title>

<!-- jQuery required by JSGL -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<!-- JSGL used for generating pretty SVG Git lines -->
<script src="https://cdn.jsdelivr.net/gh/jsgl/repo@6231386/jsgl.min.js"></script>
<!-- Optional styles to make stuff look nice -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@piotrpdev/gitline@1.0.4/dist/gitline.min.css"/>
<!-- This library -->
<script src="https://cdn.jsdelivr.net/npm/@piotrpdev/gitline@1.0.4/dist/gitline.umd.min.js"></script>
</head>
<body>
<div id="myGitlinePanel-1"></div>

<script>
Gitline.create()
.fromJSON(`assets/data/example02.json`)
.withHeader("<h1>My Gitline</h1>")
.renderTo(document.querySelector("#myGitlinePanel-1"));
</script>
</body>
</html>
```

## Creating sample data

Installation / Setup of development environment
-----
- Install Node.js
- Install Gulp globally: `npm install -g gulp`
- Install dependencies in project's root folder: `npm install`
- Run `gulp watch` in project's root folder in a second terminal window to compile TypeScript on the fly when a file changes
- To run, execute `gulp run` in project's root folder, then visit `http://localhost:3000/`
- To test, execute `gulp test`

Creating sample data
-----
- Install [git2json](https://github.com/blecher-at/git2json)
- run `git json > myfile.json` - in a cronjob presumably
- point `src/index.html` to the newly created JSON file
- run `git json > myfile.json` - in a cronjob/github workflow presumably
- point `src/demo/index.html` to the newly created JSON file

## Imports / Third party

Imports / Third party
-----
- Programming language: [TypeScript](http://www.typescriptlang.org/)
- SVG Rendering: [JSGL](http://www.jsgl.org/)
- Generic JS framework: [jQuery](https://jquery.org/)
- Hash Generation: [Crypto JS](https://github.com/brix/crypto-js)
- Date and time: [Moment.js](http://momentjs.com/)
- Icon font: [Font Awesome](https://fortawesome.github.io/Font-Awesome/)

Legal / License
-----
- SVG Rendering: [JSGL](https://github.com/jsgl/repo)
- Uses [jQuery](https://jquery.org/)
- Hash Generation ([Gravatar](https://docs.gravatar.com/general/images/)): [SparkMD5](https://github.com/satazor/js-spark-md5)

## Development

- Install Node.js
- Install dependencies: `npm install`
- Build the library: `npm run build`
- View the examples: `npm run dev:demo`
- Test the library: `npm run test`

## Legal / License

Licensed under the [Affero GPLv3](LICENSE), which basically says: You are free to hack and use,
but if you want to build a product out of it, or host it as a service, we need to talk.
14 changes: 0 additions & 14 deletions deploy.sh

This file was deleted.

Binary file removed doc/gitline.png
Binary file not shown.
21 changes: 0 additions & 21 deletions docker-image/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions docker-image/README.md

This file was deleted.

55 changes: 0 additions & 55 deletions docker-image/run.sh

This file was deleted.

Loading