No description
7dbf2fb3fc
- Image paths: Images worked on the README.md, but as soon as you tried to view the images in the files tree, and the images were in a subdirectory, the full path was added after the directory name. For example, an image at <git-repo-root>/images/screenshot.gif, would be generated in the file tree with the following link: <git-repo-root>images/images/screenshot.gif because it doesn't know that the link to the source file is actually also linking to the images directory, because I generate directories for all links, as if you were actually traversing them. This means we are able to strip the directory from the file path completely, because our links already go to the desired directory, to get images to show up in the source file view - Unknown file type issues: I changed the else statement to render the unknown filetype, because it cause the source of, for example, main.scm to just say "(Unknown file type)". Maybe we can revise this in the future to see when we want to use Unknown filetypes! Thoughts: I think I'm going to try to see if prepending a slash at the front of image paths will create an absolute path, so we dont have to get into messy relative paths haha. |
||
---|---|---|
.gitignore | ||
git-daemon.service | ||
LICENSE | ||
main.scm | ||
Makefile | ||
post-receive | ||
README.md |
repo2html
a command-line tool that turns git repositories in html pages
features
- static html files
- image support (we're working on this)
- svg support (we're working on this)
- markdown files are rendered as html (we're working on this)
- no background process (unless you're using this tool as a post-receive hook, then you only need git-daemon running)
- default repository view is an html-rendered README.md file
caveats
- binary file contents are just... shown
- directory tree is shown as a flat list of files, so git repositories with many files and directories will look awful
- no commit log (yet?)
- no line numbers (yet?)
disclaimer
no one is liable if this software breaks, deletes, corrupts, or ruins anything
requirements
note: if you have chicken scheme installed, then you can install the eggs
above by running make dependencies
as root.
compilation
chicken scheme runs faster if it's compiled to a binary file. by default, the
binary is named repo2html
, and is installed in /usr/local/bin
.
to compile repo2html into a binary file, follow the steps below:
- ensure you're in the repo2html git repository
- run
make dependencies
as root - run
make
- run
make install
as root
installation
TODO
using repo2html as a post-receive hook
TODO
using repo2html as a standalone command-line utility
TODO
configuration
you can configure repo2html by changing environment variables in the post-receive
hook file.
for details about the environment variables, refer to the list below:
REPO2HTML_PREFIX
: the web directory where repo2html generates static git repositories. for example,/var/www/git/
.REPO2HTML_CLONE_URL
: the url that people will use when downloading your git repository. if you have git-daemon set up, then you can prefix the url withgit://
. otherwise, prefix the url withhttp://
. for example,git://git.example.com
. note: avoid slashes at the end of the url.REPO2HTML_TITLE
: the text that populates the<title>
html tag.REPO2HTML_DESCRIPTION
: a string that populates thedescription
meta information about your git repository.REPO2HTML_H1
: the text that populates the<h1>
html tag.
how it works
TODO
todos
- update docs according to changes in
50bbb3686d37fc00c95aedde82bc7a58de53b410
. m455 updated things a bit, but he wants to touch up on way more things documentation-wise according to the changes in this commit. - e2e tutorial
- if no README.md file exists in the root directory of the repository, then don't create the "about" nav link. instead, make the files page the index.html
- add a "license" nav link if a LICENSE file exists in the root directory of the repository. if no LICENSE file exists, then don't create the "license" nav link
- add a "contributors" nav link
hopes
- clickable line numbers in source files
- make repos with more files and directories less daunting (recursively generate a files list page for each directory in a repo?)
- nav link: Releases