-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding pre-commit hooks, reformatting code with `swift-format`, various cleanup.
- Loading branch information
Showing
16 changed files
with
294 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: CI pipeline | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-14 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build code | ||
run: make release | ||
|
||
- name: Run check | ||
run: make check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
|
||
- repo: local | ||
hooks: | ||
- id: swift-format | ||
name: Check formatting of Swift source files | ||
entry: swift-format format -i | ||
language: system | ||
types: ["swift"] | ||
stages: ["commit"] | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-added-large-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"version": 1, | ||
"indentation": { | ||
"spaces": 4 | ||
}, | ||
"tabWidth" : 4, | ||
"lineLength" : 120, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
|
||
all: adhoc | ||
all: debug | ||
|
||
adhoc: | ||
xcodebuild -quiet -target qlview-adhoc | ||
debug: | ||
@xcodebuild -quiet -target qlview-adhoc -configuration Debug | ||
|
||
signed: | ||
xcodebuild -quiet -target qlview-signed | ||
release: | ||
@xcodebuild -quiet -target qlview-signed -configuration Release | ||
|
||
check: | ||
codesign --verify --verbose build/Release/qlview | ||
codesign --display --verbose=4 build/Release/qlview 2>&1 | grep Signed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
qlview | ||
====== | ||
# qlview | ||
|
||
Standalone, Quick Look-based document preview application for macOS. | ||
This is a standalone document previewer based on macOS's built-in | ||
Quick Look—imagine a nicer `qlmanage`. It's particularly useful as a | ||
quick command-line viewer for terminal applications, like | ||
[mutt](http://www.mutt.org). | ||
|
||
More to come. | ||
![Screenshot](screenshot.png "Screenshot") | ||
|
||
## Installation | ||
|
||
You currently need to build it yourself. Assuming you have Xcode | ||
installed, either use it to open the project, or run `make release` | ||
from the command line. You will then find an executable in | ||
`build/Release/qlview`. | ||
|
||
## Usage | ||
|
||
Run it from the command line: | ||
|
||
``` | ||
# qlview <file> | ||
``` | ||
|
||
If you execute `qlview` without any arguments, it'll open an empty | ||
window where you can drag a document into. | ||
|
||
## Feedback | ||
|
||
Feel free to open issues or pull requests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1 | ||
0.1-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,51 @@ | ||
// Copyright (c) 2024 by Robin Sommer. See LICENSE for details. | ||
|
||
import SwiftUI | ||
|
||
extension Bundle { | ||
var bundleName: String { | ||
return (object(forInfoDictionaryKey: "CFBundleName") as? String) ?? "<unknown>" | ||
} | ||
|
||
var bundleVersion: String { | ||
return (object(forInfoDictionaryKey: "CFBundleVersion") as? String) ?? "<unknown>" | ||
} | ||
|
||
} | ||
|
||
struct AboutView: View { | ||
@Binding var showAbout: Bool; | ||
@Binding var showAbout: Bool | ||
|
||
var body: some View { | ||
VStack(spacing: 10) { | ||
//Image(nsImage: NSImage(named: "AppIcon")!) | ||
|
||
Text(Bundle.main.bundleName) | ||
.font(.system(size: 20, weight: .bold)) | ||
.font(.headline) | ||
|
||
Text("Version \(Bundle.main.bundleVersion)") | ||
.textSelection(.enabled) | ||
|
||
Text("© 2023 Robin Sommer") | ||
.font(.system(size: 10, weight: .thin)) | ||
.multilineTextAlignment(.center) | ||
.font(.subheadline) | ||
|
||
Text("© 2024 Robin Sommer") | ||
.font(.system(.footnote, weight: .thin)) | ||
|
||
Spacer() | ||
|
||
Link("GitHub", destination: URL(string: "https://github.com/rsmmr/qlview")! ) | ||
|
||
|
||
HStack { | ||
Link("GitHub", destination: URL(string: "https://github.com/rsmmr/qlview")!) | ||
Link( | ||
"License", | ||
destination: URL( | ||
string: | ||
"https://raw.githubusercontent.com/rsmmr/qlview/main/LICENSE?token=GHSAT0AAAAAACLOI6MX53ZVUFTKWHB4O5CCZNMF5WA" | ||
)!) | ||
} | ||
.font(.system(.body, design: .monospaced)) | ||
|
||
Spacer() | ||
|
||
Button("Close", action: { showAbout = false }) | ||
Spacer () | ||
} | ||
.padding(50) | ||
.frame(minWidth: 200) | ||
.padding(25) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.