Skip to content

Commit

Permalink
Merge branch 'main' into Dev_XiongJia
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Apr 2, 2024
2 parents 6fee2b2 + bd256c6 commit d8ceabd
Show file tree
Hide file tree
Showing 116 changed files with 3,821 additions and 1,161 deletions.
2 changes: 1 addition & 1 deletion .github/COC_CONTACT.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Issues pertaining to this project's [code of conduct](https://github.com/scribe-org/Scribe-iOS/blob/main/.github/CODE_OF_CONDUCT.md) can be reported to the Scribe team at scribe.language@gmail<nolink>.com.
Issues pertaining to this project's [code of conduct](https://github.com/scribe-org/Scribe-iOS/blob/main/.github/CODE_OF_CONDUCT.md) can be reported to the Scribe team at team@scri<nolink>.be.
133 changes: 108 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ If you have questions or would like to communicate with the team, please [join u

# **Contents**

- [First steps as a contributor](#first-steps)
- [Learning the tech stack](#learning-the-tech)
- [Development environment](#dev-env)
- [Note on debugging](#note-on-debugging)
- [Issues and projects](#issues-projects)
Expand All @@ -23,27 +25,104 @@ If you have questions or would like to communicate with the team, please [join u
- [Documentation](#documentation)
- [Design](#design)

<a id="first-steps"></a>

## First steps as a contributor [``](#contents)

Thank you for your interest in contributing to Scribe-iOS! We look forward to welcoming you to the community and working with you to build an tools for language learners to communicate effectively :) The following are some suggested steps for people interested in joining our community:

- Please join the [public Matrix chat](https://matrix.to/#/#scribe_community:matrix.org) to connect with the community
- [Matrix](https://matrix.org/) is a network for secure, decentralized communication
- Scribe would suggest that you use the [Element](https://element.io/) client
- The [General](https://matrix.to/#/!yQJjLmluvlkWttNhKo:matrix.org?via=matrix.org) and [iOS](https://matrix.to/#/#ScribeiOS:matrix.org) channels would be great places to start!
- Feel free to introduce yourself and tell us what your interests are if you're comfortable :)
- Read through this contributing guide for all the information you need to contribute
- Look into issues marked [`good first issue`](https://github.com/scribe-org/Scribe-iOS/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and the [Projects board](https://github.com/orgs/scribe-org/projects/1) to get a better understanding of what you can work on
- Check out our [public designs on Figma](https://www.figma.com/file/c8945w2iyoPYVhsqW7vRn6/scribe_public_designs?type=design&node-id=405-464&mode=design&t=E3ccS9Z8MDVSizQ4-0) to understand Scribes's goals and direction
- Consider joining our [bi-weekly developer sync](https://etherpad.wikimedia.org/p/scribe-dev-sync)!

> [!NOTE]
> Those new to Swift or wanting to work on their Swift skills are more than welcome to contribute! The team would be happy to help you on your development journey :)
<a id="learning-the-tech"></a>

## Learning the tech stack [``](#contents)

Scribe is very open to contributions from people in the early stages of their coding journey! The following is a select list of documentation pages to help you understand the technologies we use.

<details><summary>Docs for those new to programming</summary>
<p>

- [Mozilla Developer Network Learning Area](https://developer.mozilla.org/en-US/docs/Learn)
- Doing MDN sections for HTML, CSS and JavaScript is the best ways to get into web development!

</p>
</details>

<details><summary>Swift learning docs</summary>
<p>

- [Swift getting started guide](https://www.swift.org/getting-started/)
- [The Swift Programming Language guide](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/)
- [Swift Videos from Apple](https://developer.apple.com/videos/swift)
- [Swift Standard Library](https://developer.apple.com/documentation/swift/swift-standard-library)

</p>
</details>

<a id="dev-env"></a>

# Development environment [``](#contents)

Scribe-iOS is developed using the [Swift](https://developer.apple.com/swift/) coding language. Those new to Swift or wanting to develop their skills are more than welcome to contribute! The first step on your Swift journey would be to read through the [Swift documentation](https://docs.swift.org/swift-book/index.html). The general steps to setting up a development environment are:

1. Download [Xcode](https://apps.apple.com/us/app/xcode/id497799835?mt=12)
2. [Fork](http://help.github.com/fork-a-repo/) a copy of the [Scribe-iOS](https://github.com/scribe-org/Scribe-iOS) repository
- Alternatively you can [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) the repository

2. [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the [Scribe-iOS repo](https://github.com/scribe-org/Scribe-iOS), clone your fork, and configure the remotes:

> [!NOTE]
>
> <details><summary>Consider using SSH</summary>
>
> <p>
>
> Alternatively to using HTTPS as in the instructions below, consider SSH to interact with GitHub from the terminal. SSH allows you to connect without a user-pass authentication flow.
>
> To run git commands with SSH, remember then to substitute the HTTPS URL, `https://github.com/...`, with the SSH one, `git@github.com:...`.
>
> - e.g. Cloning now becomes `git clone git@github.com:<your-username>/Scribe-iOS.git`
>
> GitHub also has their documentation on how to [Generate a new SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) 🔑
>
> </p>
> </details>
```bash
# Clone your fork of the repo into the current directory.
git clone https://github.com/<your-username>/Scribe-iOS.git
# Navigate to the newly cloned directory.
cd Scribe-iOS
# Assign the original repo to a remote called "upstream".
git remote add upstream https://github.com/scribe-org/Scribe-iOS.git
```

- Now, if you run `git remote -v` you should see two remote repositories named:
- `origin` (forked repository)
- `upstream` (Scribe-iOS repository)

3. Open the Scribe-iOS directory in Xcode

4. In order to run Scribe on an emulator:

- Read the [documentation from Apple](https://developer.apple.com/documentation/xcode/running-your-app-in-the-simulator-or-on-a-device) if need be
- In the top bar select Scribe as the scheme
- If you're debugging you'll need to select the keyboard you're testing as the scheme (see the [note on debugging](#note-on-debugging) below)
- If you're debugging you'll need to select the keyboard you're testing as the scheme (see the [note on debugging](#note-on-debugging) below)
- Select a device to run the app on
- Press the run button marked `Start the active scheme`
- From here code edits that are made will be reflected in the app each time the active scheme is restarted

From there code edits that are made will be reflected in the app each time the active scheme is restarted.

Again, those new to Swift or wanting to work on their Swift skills are more than welcome to contribute! Scribe itself was developed as a way to learn Swift and iOS coding. The team would be happy to help you on your development journey :)
> [!NOTE]
> Feel free to contact the team in the [iOS room on Matrix](https://matrix.to/#/#ScribeiOS:matrix.org) if you're having problems getting your environment setup!
<a id="note-on-debugging"></a>

Expand All @@ -57,6 +136,15 @@ The Xcode debugger often doesn't work as expected for Scribe as the keyboards th
- When you get a window telling you to "choose an app to run", don't choose Scribe as you might expect, but instead scroll down and select Xcode Previews
- Occasionally you'll be met with just a black screen on startup, in which case you can press Home (or ⇧-⌘-H) and then go directly to Scribe or an app for keyboard testing

### Adding the file header template to Xcode

As [GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) licensed technology, Scribe is expected to include a license header in all files within the codebase. A template for this has been provided in the `ScribeTemplates` directory. You can have this header automatically added to the top of files by executing the following commands to add it to your Xcode templates:

```bash
mkdir ~/Library/Developer/Xcode/Templates
ln -s PATH_TO_LOCAL_SCRIBE_DIRECTORY/Scribe-iOS/ScribeTemplates ~/Library/Developer/Xcode/Templates/
```

<a id="issues-projects"></a>

# Issues and projects [``](#contents)
Expand Down Expand Up @@ -90,7 +178,7 @@ Guidelines for bug reports:
- What actually happens
- Notes (why this might be happening, things tried that didn't work, etc)

To make the above steps easier, the Scribe team asks that contributors report bugs using the [bug report](https://github.com/scribe-org/Scribe-iOS/issues/new?assignees=&labels=feature&template=bug_report.yml) template, with these issues further being marked with the [`bug`](https://github.com/scribe-org/Scribe-iOS/issues?q=is%3Aopen+is%3Aissue+label%3Abug) label.
To make the above steps easier, the Scribe team asks that contributors report bugs using the [bug report template](https://github.com/scribe-org/Scribe-iOS/issues/new?assignees=&labels=feature&template=bug_report.yml), with these issues further being marked with the [`bug`](https://github.com/scribe-org/Scribe-iOS/issues?q=is%3Aopen+is%3Aissue+label%3Abug) label.

Again, thank you for your time in reporting issues!

Expand All @@ -104,51 +192,46 @@ Feature requests are more than welcome! Please take a moment to find out whether

# Pull requests [``](#contents)

Good pull requests - patches, improvements and new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits. Note that all contributions to this project will be made under [the specified license](https://github.com/scribe-org/Scribe-iOS/blob/main/LICENSE.txt) and should follow the coding indentation and style standards (contact us if unsure).
Good pull requests - patches, improvements and new features - are the foundation of our community making Scribe-iOS. They should remain focused in scope and avoid containing unrelated commits. Note that all contributions to this project will be made under [the specified license](https://github.com/scribe-org/Scribe-iOS/blob/main/LICENSE.txt) and should follow the coding indentation and style standards ([contact us](https://matrix.to/#/#scribe_community:matrix.org) if unsure).

**Please ask first** before embarking on any significant pull request (implementing features, refactoring code, etc), otherwise you risk spending a lot of time working on something that the developers might not want to merge into the project. With that being said, major additions are very appreciated!

When making a contribution, adhering to the [GitHub flow](https://guides.github.com/introduction/flow/index.html) process is the best way to get your work merged:

1. [Fork](http://help.github.com/fork-a-repo/) the repo, clone your fork, and configure the remotes:

```bash
# Clone your fork of the repo into the current directory
git clone https://github.com/<your-username>/<repo-name>
# Navigate to the newly cloned directory
cd <repo-name>
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/<upsteam-owner>/<repo-name>
```

2. If you cloned a while ago, get the latest changes from upstream:
1. If you cloned a while ago, get the latest changes from upstream:

```bash
git checkout <dev-branch>
git pull upstream <dev-branch>
```

3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:
2. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:

```bash
git checkout -b <topic-branch-name>
```

4. Commit your changes in logical chunks, and please try to adhere to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). Use Git's [interactive rebase](https://docs.github.com/en/github/getting-started-with-github/about-git-rebase) feature to tidy up your commits before making them public.
3. Commit your changes in logical chunks, and please try to adhere to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

> [!NOTE]
> The following are tools and methods to help you write good commit messages ✨
>
> - [commitlint](https://commitlint.io/) helps write [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
> - Git's [interactive rebase](https://docs.github.com/en/github/getting-started-with-github/about-git-rebase) cleans up commits
5. Locally merge (or rebase) the upstream development branch into your topic branch:
4. Locally merge (or rebase) the upstream development branch into your topic branch:

```bash
git pull --rebase upstream <dev-branch>
```

6. Push your topic branch up to your fork:
5. Push your topic branch up to your fork:

```bash
git push origin <topic-branch-name>
```

7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description.
6. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description.

Thank you in advance for your contributions!

Expand Down
23 changes: 18 additions & 5 deletions Keyboards/InterfaceConstants.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
//
// Scribe
//
// Constants for Scribe keyboard interfaces.
//
/**
* Constants for the Scribe keyboard interfaces.
*
* Copyright (C) 2023 Scribe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

enum SpecialKeys {
static let indent = "indent"
Expand Down
27 changes: 20 additions & 7 deletions Keyboards/KeyboardsBase/Colors/ColorVariables.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
//
// ColorVariables.swift
//
// Variables associated with coloration for Scribe.
//
/**
* Variables associated with coloration for Scribe keyboards.
*
* Copyright (C) 2023 Scribe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import UIKit

Expand All @@ -17,10 +30,10 @@ var keyPressedColor = UIColor(.keyPressed)

var commandKeyColor = UIColor(.commandKey)
var commandBarColor = UIColor(.commandBar)
var commandBarBorderColor = UIColor(.commandBarBorder).cgColor
var commandBarBorderColor = UIColor(resource: .commandBarBorder).cgColor

var keyboardBgColor = UIColor(.keyboardBackground)
var keyShadowColor = UIColor(.keyShadow).cgColor
var keyShadowColor = UIColor(resource: .keyShadow).cgColor

// annotate colors.
var annotateRed = UIColor(.annotateRed)
Expand Down
21 changes: 18 additions & 3 deletions Keyboards/KeyboardsBase/Colors/ScribeColor.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
//
// ScribeColor.swift
//
/**
* Converts strings for colors into the corresponding color.
*
* Copyright (C) 2023 Scribe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import UIKit

Expand Down
21 changes: 18 additions & 3 deletions Keyboards/KeyboardsBase/Colors/UIColor+ScribeColors.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
//
// UIColor+ScribeColors.swift
//
/**
* Adds Scribe colors to the UIColor pool.
*
* Copyright (C) 2023 Scribe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import UIKit

Expand Down
23 changes: 18 additions & 5 deletions Keyboards/KeyboardsBase/Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
//
// Extensions.swift
//
// Extensions for Scribe keyboards.
//
/**
* Extensions for Scribe keyboards.
*
* Copyright (C) 2023 Scribe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import UIKit

Expand Down
Loading

0 comments on commit d8ceabd

Please sign in to comment.