Skip to content

Commit

Permalink
Merge pull request #11 from FelixLuciano/Project-Struct
Browse files Browse the repository at this point in the history
Project struct
  • Loading branch information
FelixLuciano authored Nov 29, 2021
2 parents b7f5663 + 0e60c6f commit b28749b
Show file tree
Hide file tree
Showing 17 changed files with 554 additions and 388 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand Down Expand Up @@ -128,6 +127,9 @@ dmypy.json
# Pyre type checker
.pyre/

# PyNews files
config.json
pages/*/joins.csv
pages/*/leaves.csv
credentials.json
token.json
18 changes: 16 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"scripts/build.py"
],
"presentation": {
"reveal": "silent"
"focus": true,
"clear": true,
"close": true
},
"group": {
"kind": "build",
Expand All @@ -29,7 +31,7 @@
"scripts/watch.py"
],
"presentation": {
"reveal": "silent",
"focus": true,
"clear": true,
"close": true
}
Expand Down Expand Up @@ -63,6 +65,18 @@
"close": true
}
},
{
"label": "βž• Create",
"detail": "Create a new page.",
"args": [
"scripts/create.py"
],
"presentation": {
"focus": true,
"clear": true,
"close": true
}
},
{
"label": "πŸ“¦ Install",
"detail": "Install project dependencies.",
Expand Down
47 changes: 17 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,19 @@ pip install -r requirements.txt
```


## Configuration

The `config.json` (at project root) file contains essential definitions be for sending and some optional properties for templating. Because this file may contain sensitive information it is ignored, so it needs to be created manually at installation.

```json
{
"sheet": {
"id": "Google Sheet id",
"pages": {
"joins": "Subscribers tab name",
"leaves": "Unsubscribers tab name"
},
"columns": {
"date": "Date",
"mail": "Mail",
"name": "Name"
}
},
"test_user": {
"Date": "00/00/0000 00:00:00",
"Mail": "[email protected]",
"Name": "Luciano"
},
"props": {
"org": "PyNews SA",
"author": "Luciano Felix",
}
}
## Credentials

```
TO DO.


## Credentials
## Create a page

TO DO.

```bash
$ python scripts/create.py
```


## Template properties

Expand Down Expand Up @@ -99,6 +76,16 @@ $ python scripts/send.py --test
> Newsletter launched successfully!
```


## Watch for canges

TO DO.

```bash
$ python scripts/watch.py
```


## VS Code tasks

[Task Explorer](https://marketplace.visualstudio.com/items?itemName=spmeesseman.vscode-taskexplorer)
Expand Down
Binary file modified assets/page.webp
Binary file not shown.
25 changes: 13 additions & 12 deletions src/news.md β†’ pages/PyNews πŸ“°/page.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: PyNews πŸ“°
subject: News of the week
author: Luciano Felix


<title>{name} - {subject}</title>
Expand All @@ -8,7 +9,7 @@ subject: News of the week

# Lorem ipsum dolor sit amet

consectetur adipiscing elit. Cras in massa accumsan tortor auctor facilisis a eget ligula. Sed mollis eleifend mi vel semper. Phasellus congue, orci tristique porta ultricies, elit neque iaculis magna, sed gravida magna mi sit amet magna.
consecteturaaaa adipiscing elit. Cras in massa accumsan tortor auctor facilisis a eget ligula. Sed mollis eleifend mi vel semper. Phasellus congue, orci tristique porta ultricies, elit neque iaculis magna, sed gravida magna mi sit amet magna.

> Sed vitae leo sollicitudin urna tincidunt dictum. Maecenas eget posuere dui. Duis orci felis, vulputate nec fermentum eget, venenatis eu arcu. In aliquet vehicula turpis sed iaculis.
Expand All @@ -24,9 +25,9 @@ Font: [News](https://example.com).
## In metus est, sodales sit amet tellus id, fringilla gravida lorem
**πŸ›οΈ POLITICS**

![example image](https://images.unsplash.com/photo-1495020689067-958852a7765e?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2069&q=80)
_Image: Unsplash_
{: style="text-align: center;" }
!!! center ""
![example image](https://images.unsplash.com/photo-1495020689067-958852a7765e?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2069&q=80)
*Image: Unsplash*

Mauris volutpat pulvinar nunc, a mattis ex vehicula ac. Pellentesque molestie erat quis lacus porttitor, quis malesuada elit commodo. Mauris vehicula aliquam ligula at consequat. Sed pharetra dolor urna, posuere congue lorem porta a. In hac habitasse platea dictumst.

Expand All @@ -48,19 +49,19 @@ Quisque imperdiet vel nisi ac tincidunt. Suspendisse felis nibh, finibus vitae l

Font: [News](https://example.com).

# **To the next, {user_Nome}! πŸ‘‹**
# To the next, {Nome}! πŸ‘‹

We always arrive at your inbox around 06:09. **Some email servers are stubborn and slow… Others are even worse and throw us into spam and/or promotions. Whenever you can't find us in your inbox, look in these two.**

---

*{author}, {day} de {month} de {year}.*
{: style="text-align: right;" }
!!! right ""
*{author}, {day} de {month} de {year}.*

{org}, Simple python newsletter project.
3477 Av. Brig. Faria Lima, SΓ£o Paulo - SP, 04538-133
<br /><br />
[Unsubscribe]({unsubscribe_link}{user_e-mail}) | [Contact us](https://api.whatsapp.com/send?phone=55912345678)
{: style="text-align: center;" }
!!! center ""
PyNews, Simple python newsletter project.
3477 Av. Brig. Faria Lima, SΓ£o Paulo - SP, 04538-133
[Unsubscribe]({unsubscribe_link}{Email}) | [Contact us](https://api.whatsapp.com/send?phone=55912345678)

</div>
17 changes: 10 additions & 7 deletions src/styles.json β†’ pages/PyNews πŸ“°/styles.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@
"margin-bottom": "-.5rem"
},

"a": {
"color": "currentcolor"
},

"img": {
"max-width": "100%",
"border-radius": ".4rem"
},

Expand All @@ -36,8 +31,16 @@
},

"hr": {
"margin": "2rem 0",
"margin": "2rem 5%",
"border": "none",
"border-top": "2px solid #EEEEEE"
},

".center": {
"text-align": "center"
},

".right": {
"text-align": "right"
}
}
}
9 changes: 9 additions & 0 deletions pages/styles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"a": {
"color": "currentcolor"
},

"img": {
"max-width": "100%"
}
}
Loading

0 comments on commit b28749b

Please sign in to comment.