Skip to content

Commit

Permalink
Merge pull request deltachat#52 from deltachat/simple-howto-style
Browse files Browse the repository at this point in the history
Start new data structure and simple howto style for page content.
  • Loading branch information
pabzm committed Jan 27, 2020
2 parents 50d7837 + aadd366 commit 943dff8
Show file tree
Hide file tree
Showing 52 changed files with 618 additions and 579 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
_site
/vendor
.bundle

# Cargo / Rust

Expand Down
44 changes: 43 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ exclude = [
[dependencies]
serde = { version = "1.0", features = ["derive"] }

[dev-dependencies]
serde_json = "1.0"
serde_yaml = "0.8"

[build-dependencies]
glob = "0.3.0"
regex = "1"
lazy_static = "1.3.0"
yaml-rust = "0.4.3"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
131 changes: 43 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,65 @@
# Delta Chat Provider Info

This repository collects information on email providers and their interoperability with Delta Chat.

## Add an Entry
First check wether the file for the provider already exists, if it does skip to the **Edit an Entry** section.
Parts of that information (the metadata, aka front matter) is included into the deltachat-core, to provides them to the Delta Chat apps on the different platforms.

Add [provider name].md to the _providers folder in the following format:
~~~
---
name: [provider name]
domains: [ email domains of the provider / can also be yaml array when there are multiple ones can contain (€) to mark a premium domain]
credentials: [emailPass | emailAppPass | Oauth] - can also be an array, if multiple are supported availible
status:
state: [OK | PREP | BROKEN] - "PREP" stands for Preparation Steps needed
date: [YYYY-MM]
---
## Comments
[If there are any, but make sure everything regarding preparation is under "## Preparations"]
## Preparations
### Advanced Login Settings [if applicable]
```
[imap and smpt server addresses]
```
[if the provider requires additional steps, describe them here, you may also include images or a video tutorial of the process here]
## status history
[if you change the status, copy the previous here that we can allow for a history]
[has a table format? that we can color code the states]
[just a link to github changelog/history of this file?]
~~~

### Status options:
The page's content is built into a web page that shows the state of the respective provider regarding its usage with Delta Chat, and details possibly required preparation steps, or explains why the interoperability is broken.

State | Meaning
---|---
OK | works right out of the box, no additional steps needed (exception to this are custom domain email addresses where you might need to specify the smtp and imap server manualy)
PREP | preparation step/s is/are needed - (a few steps are required then it works - for example enabling imap/smtp on provider page)
BROKEN | not working - Does not work. (too unstable to use falls also in this category)

## Edit an Entry
## Format

## Entries
The files build on this format:

Optional yaml font matter fields:
```
limits:
maxRecipients: number | "Unlimited"
messagesPerDay: number | "Unlimited"
maxFileSize: string | "Unlimited"
registration:
inviteOnly: boolean
PhoneAuthRequired: boolean
PersonalDataRequired: boolean
price: string
```

## Example
~~~
```yaml
---
name: example
website: https://example.com
domains:
- example.com
- example.org
credentials: emailPass | emailAppPass | Oauth
status:
state: OK | PREP | BROKEN
date: YYYY-MM
name: [name of the provider]
state: [OK or PREPARATION or BROKEN]
domains:
- an_array
- of_domains
- used_by_this_provider
server:
# Repeat the following block for each server (usually one for imap, one for smtp).
- type: [imap or smtp]
socket: [SSL or STARTTLS or NONE]
hostname: [hostname to connect to]
port: [port number]
username: [optional: %EMAILADDRESS% or %EMAILLOCALPART%, default is %EMAILADDRESS%]
before_login_hint: |
[optional: a string that will be displayed before the user logs in.
Multiple lines are possible (line-breaks will be honoured), but keep in mind this text appears within the login form on possibly small displays.
]
after_login_hint: |
[optional: a string that will be displayed in the device chat after the user logged in.
Multiple lines are possible (line-breaks will be honoured).
There's more room for text in the device chat than in the login form, but please keep the text concise nonetheless.
]
date: [optional: date when the information was last checked]
website: [optional: website of the provider]
---
[Markdown-formatted content that gets displayed as provider-page on the web, linked from the apps (if state is not OK)]
```

## Comments
This is an example provider
## Status options:

## Preperations
### OK

### Advanced Login Settings
```
imap mail.example.com:993
smtp mail.example.com:465
```
~~~
If the state is `OK`, a standard text is used as page content. You don't need to put in anything.

## Use as cargo Package
### PREPARATION

https://crates.io/crates/deltachat-provider-database
This state means that the user must do some preparing steps before they can use Delta Chat with their provider. For example enabling IMAP/SMTP at their provider's settings, or creating an app-specific password.

Usage:
```rust
extern crate deltachat_provider_database;
The required steps must be described as page content in a friendly, helpful howto-style.

use deltachat_provider_database::get_provider_info;
Additionally a short, informative sentence must be written as `before_login_hint`, so tech-savy users already know what to do, and others get an idea what to expect from the linked provider page.

### BROKEN

fn main() {
let (provider, _domains) = get_provider_info("example.org").unwrap();
This state means that Delta Chat will not work with this provider.

println!("{}", provider.name);
The problems blocking the usage must be summarized as page content in a friendly tone.

if provider.status.state == deltachat_provider_database::StatusState::PREPARATION {
println!("{}", provider.markdown);
}
}
```
Additionally a short, informative sentence must be written as `before_login_hint`, so tech-savy users already know what's up, and others get an idea what to expect from the linked provider page.

See `cargo doc --open` for more information.
9 changes: 8 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include:
# include:

exclude:
- TODO
Expand All @@ -8,6 +8,13 @@ exclude:
- LICENSE
- "_providers/example.com.md"
- target
- build.rs
- Cargo.*
- rust-toolchain
- .travis.yml
- vendor
- .bundle
- "_providers/old"

defaults:
-
Expand Down
74 changes: 27 additions & 47 deletions _layouts/provider.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,34 @@

<body>
<div class="content">
<a href="./">&lt;Back to Overview</a><br>
<h1>{{ page.name }} <small style="color: grey">Provider Info</small>
</h1>
<hr>
<div class="section">
<b>domains</b>: {{ page.domains }}
<!-- Can be array (todo handle that case) -->
<br>
<b>Authentication</b>: {{ page.credentials }}
<br>
<b>STATUS</b>:
<span class="status-minimal status-{{ page.status.state | downcase }}">
{% case page.status.state %}
{% when 'OK' %}
OK
{% when 'PREP' %}
PREPARATION NEEDED
{% when 'BROKEN' %}
NOT WORKING
{% endcase %}
on {{ page.status.date }}
</span>
<br>
<b>Limits</b>:
{%if page.limits %}
{{ page.limits }}
{%else%}
<i>Unknown</i>
{%endif%}
<br>
<b>Account Registration</b>:
{%if page.registration %}
{{ page.registration }}
{%else%}
<i>Unknown</i>
{%endif%}
{%if page.website%}
<br>
<b>Website</b>: <a href="{{ page.website }}">{{ page.website }}</a>
{%endif%}
</div>
<hr>
<div class="section">
{{ content }}
<img src='./assets/provider-db-logo.svg' class='provider-db-logo' alt=''/>

<div class='project-title'>Provider info for Delta Chat</div>
<h1>{{ page.name }}</h1>
{% case page.state %}
{% when 'OK' %}
<p class='state-subheading state-ok'>
Just works!
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCC4D" d="M36 18c0 9.941-8.059 18-18 18S0 27.941 0 18 8.059 0 18 0s18 8.059 18 18"/><path fill="#664500" d="M18 21.849c-2.966 0-4.935-.346-7.369-.819-.557-.106-1.638 0-1.638 1.638 0 3.275 3.763 7.369 9.007 7.369s9.007-4.094 9.007-7.369c0-1.638-1.082-1.745-1.638-1.638-2.434.473-4.402.819-7.369.819"/><path fill="#DD2E44" d="M16.65 3.281C15.791.85 13.126-.426 10.694.431c-1.476.52-2.521 1.711-2.928 3.104-1.191-.829-2.751-1.1-4.225-.58C1.111 3.813-.167 6.48.692 8.911c.122.344.284.663.472.958 1.951 3.582 7.588 6.1 11.001 6.131 2.637-2.167 5.446-7.665 4.718-11.677-.038-.348-.113-.698-.233-1.042zm2.7 0C20.209.85 22.875-.426 25.306.431c1.476.52 2.521 1.711 2.929 3.104 1.191-.829 2.751-1.1 4.225-.58 2.43.858 3.707 3.525 2.85 5.956-.123.344-.284.663-.473.958-1.951 3.582-7.588 6.1-11.002 6.131-2.637-2.167-5.445-7.665-4.717-11.677.037-.348.112-.698.232-1.042z"/></svg>
</p>
<p>Using Delta Chat with {{ page.name }} will just work!</p>
{% when 'PREPARATION' %}
<p class="state-subheading state-preparation">
Needs preparation.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><circle fill="#FFCB4C" cx="18" cy="17.018" r="17"/><path fill="#65471B" d="M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z"/><ellipse fill="#65471B" cx="13.119" cy="11.174" rx="2.125" ry="2.656"/><ellipse fill="#65471B" cx="24.375" cy="12.236" rx="2.125" ry="2.656"/><path fill="#F19020" d="M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z"/><path fill="#65471B" d="M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z"/></svg>
</p>
{{ content }}
{% when 'BROKEN' %}
<p class="state-subheading state-broken">
It's broken.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCC4D" d="M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18"/><ellipse fill="#664500" cx="11.5" cy="17" rx="2.5" ry="3.5"/><ellipse fill="#664500" cx="24.5" cy="17" rx="2.5" ry="3.5"/><path fill="#664500" d="M5.999 13.5c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4 3.262-4.35 7.616-4.4 7.8-4.4.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.641-3.521-6.061-3.599-6.206-3.6-.55-.006-.994-.456-.991-1.005.003-.551.447-.995.997-.995.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-6.516 14.879C23.474 28.335 22.34 24 18 24s-5.474 4.335-5.485 4.379c-.053.213.044.431.232.544.188.112.433.086.596-.06C13.352 28.855 14.356 28 18 28c3.59 0 4.617.83 4.656.863.095.09.219.137.344.137.084 0 .169-.021.246-.064.196-.112.294-.339.239-.557z"/><path fill="#5DADEC" d="M16 31c0 2.762-2.238 5-5 5s-5-2.238-5-5 4-10 5-10 5 7.238 5 10z"/></svg>
</p>
{{ content }}
{% endcase %}
<div class='github-link'>
<a href="https://github.com/deltachat/provider-db/blob/master/{{page.path}}">Technical specs.</a>
</div>
<hr>
<a href="https://github.com/deltachat/provider-db/edit/master/{{page.path}}">Edit This Page on Github</a>
</div>
</body>

</html>
</html>
Loading

0 comments on commit 943dff8

Please sign in to comment.