Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
christianparpart committed Jun 14, 2021
0 parents commit b117f57
Show file tree
Hide file tree
Showing 9 changed files with 455 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

on:
push:
branches:
- wip
- master
- preview
- release
pull_request:
branches:
- master

jobs:
compile_pdf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: "install dependencies"
run: |
set -ex
sudo apt -q update
sudo apt install -y texlive-latex-base texlive-latex-extra latexmk
- name: "Compile PDF"
run: |
set -ex
cd spec
latexmk -pdflatex terminal-unicode-core
- name: "Uploading PDF"
uses: actions/upload-artifact@v2
with:
name: spec
path: spec/terminal-unicode-core.pdf
if-no-files-found: error

compile_md:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: "install dependencies"
run: |
set -ex
sudo apt -q update
sudo apt install -y pandoc
- name: "Compile markdown"
run: |
set -ex
cd spec
pandoc -s terminal-unicode-core.tex -o terminal-unicode-core.md
- name: "Uploading markdown"
uses: actions/upload-artifact@v2
with:
name: spec
path: spec/terminal-unicode-core.md
if-no-files-found: error
123 changes: 123 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Release

on:
push:
branches:
- preview
- release

jobs:
compile_pdf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: "install dependencies"
run: |
set -ex
sudo apt -q update
sudo apt install -y texlive-latex-base texlive-latex-extra latexmk
- name: "Compile PDF"
run: |
set -ex
cd spec
latexmk -pdflatex terminal-unicode-core
- name: "Uploading PDF"
uses: actions/upload-artifact@v2
with:
name: spec
path: spec/terminal-unicode-core.pdf
if-no-files-found: error

compile_md:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: "install dependencies"
run: |
set -ex
sudo apt -q update
sudo apt install -y pandoc
- name: "Compile markdown"
run: |
set -ex
cd spec
pandoc -s terminal-unicode-core.tex -o terminal-unicode-core.md
- name: "Uploading markdown"
uses: actions/upload-artifact@v2
with:
name: spec
path: spec/terminal-unicode-core.md
if-no-files-found: error

do_release:
name: Create Github release
runs-on: ubuntu-latest
needs: [compile_pdf, compile_md]
steps:
- uses: actions/checkout@v1
# -------------------------------------------------------------
- name: fetch release artifacts
uses: actions/download-artifact@v2
with:
name: spec
# -------------------------------------------------------------
- name: Set Output Variables
id: set_env_var
env:
REPOSITORY: ${{ github.event.repository.name }}
run: |
VERSION=$(grep '^### ' Changelog.md | head -n1 | awk '{print $2}')
SUFFIX=$(grep '^### ' Changelog.md | head -n1 | awk '{print $3}' | tr -d '()')
if [ $REPOSITORY = "master" ]; then IS_PRE='false'; else IS_PRE='true'; fi
if [ $REPOSITORY = "master" ]; then SUFFIX='' ; else SUFFIX='prerelease'; fi
if [ $REPOSITORY != "master" ]; then
TAG_SUFFIX="_prerelease_${GITHUB_RUN_NUMBER}"
else
TAG_SUFFIX=""
fi
RELEASEBODY=$(awk -v RS='^### ' '/^'$VERSION'/ {print $0}' Changelog.md | tail -n+3)
RELEASEBODY="${RELEASEBODY//'%'/'%25'}"
RELEASEBODY="${RELEASEBODY//$'\n'/'%0A'}"
RELEASEBODY="${RELEASEBODY//$'\r'/'%0D'}"
echo "::set-output name=version::${VERSION}"
echo "::set-output name=tag_suffix::${TAG_SUFFIX}"
echo "::set-output name=RUN_ID::${GITHUB_RUN_NUMBER}"
echo "::set-output name=IS_PRERELEASE::${IS_PRE}"
echo "::set-output name=RELEASENAME_SUFFIX::${SUFFIX}"
echo "::set-output name=RELEASEBODY::${RELEASEBODY}"
# -------------------------------------------------------------
- name: Create Github release page
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.set_env_var.outputs.version }}${{ steps.set_env_var.outputs.tag_suffix}}
release_name: Terminal Good Image Protocol ${{ steps.set_env_var.outputs.version }}-${{ steps.set_env_var.outputs.RUN_ID }} ${{ steps.set_env_var.outputs.RELEASENAME_SUFFIX}}
body: |
${{ steps.set_env_var.outputs.RELEASEBODY }}
draft: true
prerelease: ${{ steps.set_env_var.outputs.IS_PRERELEASE }}
# -------------------------------------------------------------
- name: Upload PDF
id: upload-release-pdf
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: terminal-unicode-core.pdf
asset_name: terminal-unicode-core-${{ steps.set_env_var.outputs.version }}-${{ steps.set_env_var.outputs.RUN_ID }}.pdf
asset_content_type: application/pdf
# -------------------------------------------------------------
- name: Upload markdown
id: upload-release-md
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: terminal-unicode-core.md
asset_name: terminal-unicode-core-${{ steps.set_env_var.outputs.version }}-${{ steps.set_env_var.outputs.RUN_ID }}.md
asset_content_type: text/markdown

12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.tmp
*.aux
*.log
*.toc
*.pdf
*.out
*.fls
*.fdb_latexmk
*.synctex.gz
.fake
.ionide
/out
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### 0.1.0 (unreleased)

- initial draft
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# gem "rails"
gem 'jekyll'
67 changes: 67 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.7)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.13.1)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jekyll (4.2.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.3.3)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.4)
rouge (3.26.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)

PLATFORMS
ruby

DEPENDENCIES
jekyll

BUNDLED WITH
2.1.4
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# vim:noet

BASENAME = terminal-unicode-core
SOURCE_FILES = spec/$(BASENAME).tex
TARGET_DIR = out

all: ${TARGET_DIR}/${BASENAME}.pdf

clean:
@rm -vf ${TARGET_DIR}/*

${TARGET_DIR}/${BASENAME}.pdf: $(SOURCE_FILES)
@mkdir -p ${TARGET_DIR}
@cd spec && latexmk -pdflatex ${BASENAME}.tex \
-aux-directory=../${TARGET_DIR} -output-directory=../${TARGET_DIR}

.PHONY: all clean
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Terminal Unicode Core Specification

**IMPORTANT: THIS PROJECT IS IN ALPHA STAGE & ACTIVE DEVELOPMENT**

Let's make Unicode support in terminal emulators better - not perfect, but better.

For that I'd like to introduce a small spec that at least tries to tackle **some**
basics that would greatly help user experience.

Of course, the terminal emulator is not enough, terminal applications have
to catch up, too. But without support from terminals, the applications
cannot even start doing so. This draft spec tries to fix that.

## Goal of this repository

It would be nice if this repository serves as a communication hub for improving this spec
that ideally enough terminal emulators will adopt so we could call this the future defacto image protocol
for terminals, so that developers have it easier in the future on how to get images into their
terminal applications.

## How to contribute

Everybodies point of view is valuable, whether terminal emulator developer, terminal application or
toolkit developer, or a user.

While getting this spec in shape, I'd like to get your feedback to find a common
concensus that most of us can agree on with the goal to get an adoption as broad as possible.

Sure, this won't happen in a day or even 2 years. But someone has to start at some point,
so more can follow.

## This spec is NOT

- attempting to bring full Unicode support to the terminal
- planning to get Unicode BiDi support formalized (mlterm could be doing that much better :) )
- tackle every other niche aspect of Unicode.

## This spec will

- Enable users to make use of Ligatures and Emoji without sacrifice.
- Have legacy applications as well as newer ones respecting this spec compatible in one terminal.

## Roadmap

- [x] create CI job for auto-generating PDF/markdown of the latest draft to be downloadable
- [x] create CI job for providing prereleases of the draft specification.
- [ ] Move Changelog into .tex file and let CI's release.yml extract it from there
- [ ] Create Github pages that have an auto-generated PDF/markdown version of this specification.
- [ ] Hopefully get enough terminal and TUI app devs attracted to collaborate in a positive, friendly, and productive manner.

## FAQ

- **Why LaTeX and not Markdown?** Expressivity and the fact that you can convert to Markdown: https://pandoc.org/demos.html
- **Why GitHub and not GitLab on freedesktop?** Better reachability.

Loading

0 comments on commit b117f57

Please sign in to comment.