Skip to content

Commit

Permalink
Merge pull request #56 from justinethomas/release-3.4.5
Browse files Browse the repository at this point in the history
Release 3.4.5
  • Loading branch information
Justine Thomas authored Jul 11, 2018
2 parents 91b89c6 + 625fb94 commit 29913a8
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 26 deletions.
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
[![GitHub release](https://img.shields.io/github/release/justinethomas/header3.svg)](https://github.com/justinethomas/header3/releases)
[![Documentation Status](https://readthedocs.org/projects/header3/badge/?version=latest)](https://header3.readthedocs.io/en/latest/?badge=latest)

- - -
![alt text](docs/resources/header3.png "Header3")

- - -

# Header3 for Emacs
Header3 is a package for Emacs which will help you to automatically add headers
to your source code files when you create a new one in Emacs.

Header3 is built upon [header2.el](https://www.emacswiki.org/emacs/download/header2.el)
and adds more features to it, but I have made efforts to make it compatible with header2.

Expand All @@ -33,6 +37,8 @@ and adds more features to it, but I have made efforts to make it compatible with
- [Requirements](#requirements)
- [Installation](#installation)
- [How to use ?](#how-to-use-)
- [Full Documentation](#full-documentation)
- [License](#license)
- [Working](#working)

<!-- tocstop -->
Expand All @@ -41,36 +47,38 @@ and adds more features to it, but I have made efforts to make it compatible with

### Mini Header
if you need the smallest header.
<p align="center"><img src="docs/resources/mini_header.png" alt="Mini header"/></p>

![alt text](docs/resources/mini_header.png "Mini Header")
---

### File Header
if you need a little bigger headers.

![alt text](docs/resources/file_header.png "File Header")
<p align="center"><img src="docs/resources/file_header.png" alt="File header"/></p>

---
### Package Header
if you need the biggest one.

![alt text](docs/resources/package_header.png "Package Header")
<p align="center"><img src="docs/resources/package_header.png" alt="Package header"/></p>

---
### Readme Header

#### Template for new file
The following example is auto generated when you create a new Readme.md file
(file name is case insensitive)

![alt text](docs/resources/full_readme_1.jpg "Readme generated on a new file")
![alt text](docs/resources/full_readme_2.jpg "Readme generated on a new file")
<p align="center"><img src="docs/resources/full_readme_1.jpg" alt="Readme header"/></p>
<p align="center"><img src="docs/resources/full_readme_2.jpg" alt="Readme header"/></p>

------

#### Template for existing file
The following example is generated when you run `make-readme-header` and the file
already has some contents

![alt text](docs/resources/readme_with_content.jpg "Readme generated on a file with contents")
<p align="center"><img src="docs/resources/readme_with_content.jpg" alt="Readme header"/></p>

---
*All examples are generated using Header3.*
Expand Down Expand Up @@ -117,6 +125,16 @@ will add the header.
- `make-package-header`
- `make-readme-header`

## Full Documentation

For full documentation [read the docs](https://header3.readthedocs.io/en/latest/)

## License
Licensed under the terms of GPL v3

**[Back to top](#table-of-contents)**


## Working
* Files that are recognised as License files are
- LICENSE
Expand Down Expand Up @@ -156,7 +174,7 @@ will add the header.
- [x] Emacs Lisp
- `readme-header`
- When the file has `.md` extension and has `readme`(case insensitive) in
the name.
the name.

*Marked with* &#10003; *are tested*

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = u''
# The full version, including alpha/beta/rc tags
release = u'3.4.3'
release = u'3.4.5'


# -- General configuration ---------------------------------------------------
Expand Down
Binary file added docs/resources/header3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions header3-defaults.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
;; Copyright (c) 2018, Justine T Kizhakkinedath
;; All rights reserved
;; Created: Fri 29 Jun 2018 00:04:07 IST
;; Version: 3.4.2
;; Last-Updated: Wed 4 Jul 2018 00:07:44 IST
;; Version: 3.4.5
;; Last-Updated: Thu 12 Jul 2018 00:53:22 IST
;; By: Justine T Kizhakkinedath
;; Update #: 4
;; Update #: 5
;; URL: https://github.com/justinethomas/header3
;; Doc URL:
;; Keywords:
Expand Down
26 changes: 16 additions & 10 deletions header3.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
;; Copyright (C) 1989 Free Software Foundation, Inc.
;; Copyright (C) 1988 Lynn Randolph Slater, Jr.
;; Created: Tue Aug 4 17:06:46 1987
;; Version: 3.4.2
;; Version: 3.4.5
;; Package-Requires: ((projectile "0.14.0") (git-link "0.7.0"))
;; Last-Updated: Fri 6 Jul 2018 13:54:30 IST
;; Last-Updated: Thu 12 Jul 2018 00:53:46 IST
;; By: Justine T Kizhakkinedath
;; Update #: 2155
;; Update #: 2160
;; URL: https://github.com/justinethomas009/header3
;; Doc URL: https://emacswiki.org/emacs/AutomaticFileHeaders
;; Keywords: tools, docs, maint, abbrev, local
Expand Down Expand Up @@ -738,11 +738,12 @@ For more details on what constites a project check `projectile' docs"
(insert-file-contents (concat (projectile-project-root) license-file-name))
(setq license-list (split-string (buffer-string) "\n")))
(dotimes (i 5)
(if (or (cl-search " license" (downcase (car license-list)))
(cl-search "version " (downcase (car license-list))))
(add-to-list 'temp-list (string-trim (pop license-list)) t)))
(setq license-name (string-join temp-list " "))
)
(if (not (string-equal (car license-list) ""))
(if (or (cl-search " license" (downcase (car license-list)))
(cl-search "version " (downcase (car license-list))))
(add-to-list 'temp-list (string-trim (pop license-list)) t))
(pop license-list)))
(setq license-name (string-join temp-list " ")))

(defsubst header3-license--insert-file (file-name)
"INTERNAL FUNCTION. Inserts the contents of license from the resource."
Expand Down Expand Up @@ -836,7 +837,10 @@ Launches the \"insert-file\" function after comparing with the license name"

(defsubst header-maintainer ()
"Insert \"Maintainer: \" line."
(insert header-prefix-string "Maintainer: \n"))
(insert header-prefix-string "Maintainer: ")
;; (insert (user-full-name) "\n")
(insert
(shell-command-to-string "git log --format='%an <%ae>' -1")))

(defun header-copyright ()
"Insert `header-copyright-notice', unless nil."
Expand Down Expand Up @@ -954,7 +958,8 @@ Without this, `make-revision' inserts `header-history-label' after the header."
(defsubst header-modification-date ()
"Insert todays date as the time of last modification.
This is normally overwritten with each file save."
(insert header-prefix-string "Last-Updated: \n"))
(insert header-prefix-string "Last-Updated: ")
(insert (header-date-string) "\n"))

(defsubst header-modification-author ()
"Insert current user's name as the last person who modified the file.
Expand Down Expand Up @@ -1135,6 +1140,7 @@ It is sensitive to language-dependent comment conventions."
comment-start)
(t ";; "))) ; Use Lisp as default.

;; For autoloading functions
;;;###autoload
(autoload 'auto-make-header "header3")

Expand Down
8 changes: 4 additions & 4 deletions templates/readme/readme_contents.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Project Name

## Contents
## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)
- [Features](#features)
- [User Guide](#user-guide)
- [Contributor Code of Conduct](#contributor-code-of-conduct)
- [Full Documentation](#full-documentation)
- [License](#license)

## Introduction
Expand All @@ -25,9 +25,9 @@

**[Back to top](#table-of-contents)**

## Contributor Code of Conduct
## Full Documentation

**[Back to top](#table-of-contents)**
For full documentation [read the docs]()

## License

Expand Down

0 comments on commit 29913a8

Please sign in to comment.