-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from camarm-dev/dev
1.2.0.beta revision 2, with patches for #108, #148, #149, #150, #152, #153, #154, #155, #157, #158, #159, #160, #161, #163
- Loading branch information
Showing
153 changed files
with
7,274 additions
and
1,510 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
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,142 +1,4 @@ | ||
# Contributing | ||
Welcome at Rèmede ! We are happy to welcome new contributors like you ! | ||
|
||
## Table of content | ||
- [How to contribute](#how-to-contribute) | ||
- [Big steps](#big-steps) | ||
- [Guide](#guide) | ||
- [Project structure](#understanding-project-structure) | ||
- [Lifecycle Schemas](#lifecycle-schemas) | ||
- [Add a custom word](#add-a-custom-word) | ||
- [Documentation](#documentation) | ||
|
||
## How to contribute | ||
**To contribute, you can:** | ||
- Open an issue ([here](https://github.com/camarm-dev/remede/issues)) | ||
- Choose an issue, fork the repository, resolve it and open a pull request ! ([complete guide](#guide)) | ||
- Contact us to become part of our team ([email protected]) | ||
- So you'll have access to this repository | ||
|
||
### Big steps | ||
1. Open or choose an issue on our [issue page](https://github.com/camarm-dev/remede/issues) | ||
2. Fork and clone the repository on your computer | ||
3. Read [the documentation](https://remede.camarm.fr/EN), and contact us for more informations (at [email protected]). | ||
4. Make your changes, and separate your work in multiple commits | ||
5. Open a pull request | ||
6. Wait and make requested changes | ||
7. You're now a contributor ! Thank you very much ! | ||
|
||
## Guide | ||
|
||
This project is developed using [Typescript](https://www.typescriptlang.org/), [Python](https://python.org) and [VueJS](https://vuejs.org/). You need to know these to start contributing ! | ||
|
||
### Understanding project structure | ||
|
||
First, the folders; | ||
- `server.py`: Main API, made with Fastapi | ||
- `data`: Ressources to make Remède database and Remède databases | ||
- `app`: Ionic project | ||
- `src`: Vuejs project | ||
- `electron`: Electron project, generated by [`@capacitor-community/electron`](https://github.com/capacitor-community/electron) | ||
- `android`: Android project, generated by [`@capacitor/android`](https://capacitorjs.com/docs/android) | ||
- `api-definition`: API to fetch Wictionary definitions (it's a git submodule) | ||
- `scripts`: Scripts to parse, generate and make migrations on the database. | ||
- `corrector`: Docker to run languagetool API | ||
- `tts`: Docker compose to run nanotts with opentts | ||
- `builds`: All builds for all platforms by version | ||
|
||
### Lifecycle Schemas | ||
|
||
_These schemas are outdated and not really readable. Visit [`INFRASTRUCTURE.md`](INFRASTRUCTURE.md) for more._ | ||
|
||
In this section you will understand Remède Lifecycle with different schemas. | ||
|
||
**Client -> Server without dictionary downloaded** | ||
|
||
```mermaid | ||
sequenceDiagram | ||
title Interaction schema with only online Client (database not downloaded) | ||
box Client | ||
participant Frontend | ||
end | ||
box Server | ||
participant API | ||
participant Memory | ||
participant Filesystem | ||
end | ||
API->>Filesystem: Collecting JSON files | ||
Filesystem-->>API: | ||
API-->>Memory: | ||
API->>Filesystem: Generating sheets objects | ||
Filesystem-->>API: | ||
API-->>Memory: | ||
Note over Frontend,API: Fetching a word | ||
Frontend->>+API: Can I get word `remède` ? | ||
API-->>Memory: | ||
Memory-->>API: | ||
API-->>-Frontend: {[...]} | ||
Note over Frontend,API: Fetching a sheet | ||
Frontend->>+API: Can I get sheets ? | ||
API->>Memory: Get sheet | ||
Memory-->>API: | ||
API->>-Frontend: {[...]} | ||
``` | ||
|
||
**Client -> Server with dictionary downloaded** | ||
|
||
```mermaid | ||
sequenceDiagram | ||
title Interaction schema with database downloaded on the client filesystem | ||
box Client | ||
participant Files as Filesystem | ||
participant Frontend | ||
participant Database | ||
end | ||
box Server | ||
participant API | ||
participant Memory | ||
participant Filesystem | ||
end | ||
Frontend->>Files: Read database | ||
Files-->>Database: | ||
API->>Filesystem: Collecting JSON files | ||
Filesystem-->>API: | ||
API-->>Memory: | ||
API->>Filesystem: Generating sheets objects | ||
Filesystem-->>API: | ||
API-->>Memory: | ||
Note over Frontend,Database: Fetching a word | ||
Frontend->>Database: Can I get word `remède` ? | ||
Database-->>Frontend: | ||
Note over Frontend,API: Fetching a sheet | ||
Frontend->>+API: Can I get sheets ? | ||
API->>Memory: Get sheet | ||
Memory-->>API: | ||
API->>-Frontend: {[...]} | ||
``` | ||
|
||
### Add a custom word | ||
|
||
Remède fetches words from the Wictionary but sometimes, words are not in our list so, you can add custom words... | ||
|
||
1. Add it to `data/IPA.txt` | ||
1. In alphabetic order, add your word with the following schema `word\t/phonetic/` (`\t` represents a <kbd>TAB</kbd> char, not spaces) | ||
2. Add it to `data/custom_words.json`, if necessary | ||
1. Check on the [french Wictionary](https://fr.wiktionary.org) if your word exist. | ||
2. If it does not exist, fill his document manually in the `data/custom_words.json`. Don't forget to quote your sources in the `credits` field. | ||
3. Before making a PR, rebuild ressources (so your word will be added newt time database is built) | ||
1. Run `python3 scripts/pre_generate_ressources.py`, if it outputs an error, check the previous steps... | ||
|
||
### Parsing | ||
|
||
A complete Guide about parsing and database generation is written in french at [`PARSING.md`](https://github.com/camarm-dev/remede/blob/main/PARSING.md) | ||
|
||
## Documentation | ||
You can find the documentation [here](/docs/EN.md) or on [our website](https://remede.camarm.fr/EN). | ||
|
||
Please learn more about contributing to Remède on our [online documentation](https://docs.remede.camarm.fr/docs/contributing) |
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
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,38 +1,76 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<!-- Permissions --> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:usesCleartextTraffic="true" | ||
android:theme="@style/AppTheme"> | ||
android:theme="@style/AppTheme" | ||
android:usesCleartextTraffic="true"> | ||
<receiver | ||
android:name=".RemedeSearchbarWidget" | ||
android:exported="false"> | ||
<intent-filter> | ||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> | ||
</intent-filter> | ||
<intent-filter> | ||
<action android:name="com.camarm.remede.action.OPEN_SEARCHBAR" /> | ||
</intent-filter> | ||
<meta-data | ||
android:name="android.appwidget.provider" | ||
android:resource="@xml/remede_searchbar_info" /> | ||
</receiver> | ||
|
||
<activity | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" | ||
android:name=".MainActivity" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" | ||
android:exported="true" | ||
android:label="@string/title_activity_main" | ||
android:theme="@style/AppTheme.NoActionBarLaunch" | ||
android:launchMode="singleTask" | ||
android:exported="true"> | ||
android:launchMode="singleTop" | ||
android:theme="@style/AppTheme.NoActionBarLaunch"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
<intent-filter> | ||
<action android:name="android.intent.action.VIEW" /> | ||
|
||
<category android:name="android.intent.category.DEFAULT" /> | ||
<category android:name="android.intent.category.BROWSABLE" /> | ||
|
||
<data android:scheme="@string/custom_url_scheme" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".ActiveRemedeActivity" | ||
android:exported="true" | ||
android:label="@string/active_remede_label"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.PROCESS_TEXT" /> | ||
|
||
<category android:name="android.intent.category.DEFAULT" /> | ||
|
||
<data android:mimeType="text/plain" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<provider | ||
android:name="androidx.core.content.FileProvider" | ||
android:authorities="${applicationId}.fileprovider" | ||
android:exported="false" | ||
android:grantUriPermissions="true"> | ||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> | ||
<meta-data | ||
android:name="android.support.FILE_PROVIDER_PATHS" | ||
android:resource="@xml/file_paths" /> | ||
</provider> | ||
</application> | ||
|
||
<!-- Permissions --> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
</manifest> | ||
</manifest> |
29 changes: 29 additions & 0 deletions
29
app/android/app/src/main/java/com/camarm/remede/ActiveRemedeActivity.java
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,29 @@ | ||
package com.camarm.remede; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.os.Bundle; | ||
|
||
public class ActiveRemedeActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
CharSequence text = getIntent().getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT); | ||
|
||
Uri page; | ||
if (text.toString().contains(" ") && text.charAt(0) != 'à') { | ||
page = Uri.parse(getResources().getString(R.string.custom_url_scheme) + "://correction?data=" + text); | ||
} else { | ||
page = Uri.parse(getResources().getString(R.string.custom_url_scheme) + "://dictionnaire/" + text.toString().toLowerCase()); | ||
} | ||
|
||
Intent definitionIntent = new Intent(this, MainActivity.class) | ||
.setData(page) | ||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); | ||
startActivity(definitionIntent); | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.