diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b5ffacd --- /dev/null +++ b/.gitignore @@ -0,0 +1,49 @@ +# Created by https://www.gitignore.io/api/osx,windows + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Windows ### +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk diff --git a/README.md b/README.md new file mode 100644 index 0000000..154e4dc --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +pyGitBook +======== + +gitBookLog is a simple and slightly hackish program that can be used to turn a dump from git-log into a nice logbook + +## Usage +Requirements: Python3 + +1. cd into your repository folder inside a terminal +2. Run `git log --pretty="format:[START commit][author=%an][time=%at][message=%s][hash=%H]" --shortstat > git-data.txt` for creating a git-data.txt file with your commit history +3. Put your created `git-data.txt` file into the repository folder and run `python main.py` inside of it diff --git a/README.txt b/README.txt deleted file mode 100644 index 8ef07e1..0000000 --- a/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -gitBookLog is a simple and slightly hackish program that can be used to turn a dump from git-log into a nice logbook - -To use the program simply run the snippet in the comment at the top of main.py - -Move the file created (probably) git-data.txt into the same directory and run main.py - -Thats about it hopefully i will get around to improving the program and writing a more compleate README some time in the future \ No newline at end of file diff --git a/main.py b/main.py index 758e210..b40ba0f 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +#-*- coding: utf-8 -*- # Use this is generate log data for the default template #git log --pretty="format:[START commit][author=%an][time=%at][message=%s][hash=%H]" --shortstat > git-data.txt @@ -53,8 +54,8 @@ def get_css(template): ## Makes a big blob of CSS so you dont need to worry abou "style":get_css(TEMPLATE_DIR), "commits":commits} -f = open(HTMLFILE,"w") +f = open(HTMLFILE,"w", encoding="utf-8") f.write(template.render(data)) f.close() -print "All done you now have a nice logbook at:", HTMLFILE +print ("All done you now have a nice logbook at:", HTMLFILE)