openwrite 0.10.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. openwrite/__init__.py +134 -0
  2. openwrite/cli.py +340 -0
  3. openwrite/db/__init__.py +0 -0
  4. openwrite/db/base.py +3 -0
  5. openwrite/launch_gemini.py +8 -0
  6. openwrite/routes/admin.py +170 -0
  7. openwrite/routes/auth.py +77 -0
  8. openwrite/routes/blog.py +205 -0
  9. openwrite/routes/dashboard.py +408 -0
  10. openwrite/routes/federation.py +284 -0
  11. openwrite/routes/main.py +96 -0
  12. openwrite/routes/upload.py +81 -0
  13. openwrite/static/IBMPlexSans-Regular.ttf +0 -0
  14. openwrite/static/Merriweather.ttf +0 -0
  15. openwrite/static/avatar.png +0 -0
  16. openwrite/static/favicon.ico +0 -0
  17. openwrite/static/logo.png +0 -0
  18. openwrite/static/script/chart.js +14 -0
  19. openwrite/static/script/highlight.min.js +1244 -0
  20. openwrite/static/script/openwrite.js +88 -0
  21. openwrite/static/script/papaparse.min.js +7 -0
  22. openwrite/static/script/showdown.min.js +3 -0
  23. openwrite/static/script/showdown.min.js.map +1 -0
  24. openwrite/static/script/site.compat.min.js +7 -0
  25. openwrite/static/script/site.min.js +7 -0
  26. openwrite/static/style/hl.css +1 -0
  27. openwrite/static/style/style.css +611 -0
  28. openwrite/static/style/themes/light.css +28 -0
  29. openwrite/static/style/themes/obscura.css +27 -0
  30. openwrite/static/style/themes/stickynote.css +50 -0
  31. openwrite/static/style/themes/terminal.css +37 -0
  32. openwrite/static/style/themes/warmnight.css +73 -0
  33. openwrite/static/style/themes/windows98.css +132 -0
  34. openwrite/templates/admin.html +47 -0
  35. openwrite/templates/blog.html +16 -0
  36. openwrite/templates/blog_footer.html +6 -0
  37. openwrite/templates/blog_header.html +45 -0
  38. openwrite/templates/blog_preview.html +44 -0
  39. openwrite/templates/changepw.html +19 -0
  40. openwrite/templates/create.html +46 -0
  41. openwrite/templates/dashboard.html +45 -0
  42. openwrite/templates/discover.html +11 -0
  43. openwrite/templates/edit.html +190 -0
  44. openwrite/templates/footer.html +16 -0
  45. openwrite/templates/header.html +61 -0
  46. openwrite/templates/import.html +142 -0
  47. openwrite/templates/index.html +9 -0
  48. openwrite/templates/instances.html +14 -0
  49. openwrite/templates/login.html +18 -0
  50. openwrite/templates/new_post.html +207 -0
  51. openwrite/templates/post.html +53 -0
  52. openwrite/templates/preview.html +37 -0
  53. openwrite/templates/register.html +42 -0
  54. openwrite/templates/settings.html +63 -0
  55. openwrite/templates/stats.html +242 -0
  56. openwrite/utils/create_db.py +15 -0
  57. openwrite/utils/db.py +30 -0
  58. openwrite/utils/helpers.py +216 -0
  59. openwrite/utils/i18n.json +229 -0
  60. openwrite/utils/models.py +87 -0
  61. openwrite/utils/translations.py +6 -0
  62. openwrite-0.10.1.dist-info/METADATA +684 -0
  63. openwrite-0.10.1.dist-info/RECORD +67 -0
  64. openwrite-0.10.1.dist-info/WHEEL +5 -0
  65. openwrite-0.10.1.dist-info/entry_points.txt +2 -0
  66. openwrite-0.10.1.dist-info/licenses/LICENSE +661 -0
  67. openwrite-0.10.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,611 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ @font-face {
8
+ font-family: 'IBMPlexSans';
9
+ src: url('/static/IBMPlexSans-Regular.ttf') format('truetype');
10
+ }
11
+
12
+ @font-face {
13
+ font-family: 'Merriweather';
14
+ src: url('/static/Merriweather.ttf') format('truetype');
15
+ }
16
+
17
+ @media only screen and (max-width: 850px) {
18
+ .container {
19
+ width: 80% !important;
20
+ }
21
+
22
+ .header #logo {
23
+ width: 245px !important;
24
+ }
25
+
26
+ .header {
27
+ flex-direction: column;
28
+ align-items: center;
29
+ }
30
+
31
+ .header #menu {
32
+ margin-top: 1rem;
33
+ gap: 1rem !important;
34
+ }
35
+
36
+ .content h1 {
37
+ font-size: 30px !important;
38
+ }
39
+
40
+ article.main-content {
41
+ font-size: 15px !important;
42
+ }
43
+
44
+ article.post-content {
45
+ line-height: 23px !important;
46
+ }
47
+
48
+ .buttons-list {
49
+ flex-direction: column !important;
50
+ }
51
+
52
+ .horizontal-fields {
53
+ flex-direction: column !important;
54
+ }
55
+ }
56
+
57
+ body {
58
+ background: #18171c;
59
+ color: #e9d4ce;
60
+ }
61
+
62
+ .header #menu a.link-active, .link-active {
63
+ text-decoration: underline;
64
+ opacity: 1;
65
+ }
66
+
67
+ .container {
68
+ display: flex;
69
+ flex-direction: column;
70
+ width: 60%;
71
+ margin: 0 auto;
72
+ min-height: 60vh;
73
+ }
74
+
75
+ .container-row-fluid {
76
+ display: flex;
77
+ flex-direction: row;
78
+ width: 100%;
79
+ margin: 0 auto;
80
+ justify-content: space-between;
81
+ align-items: center;
82
+ }
83
+
84
+ .header {
85
+ display: flex;
86
+ justify-content: space-between;
87
+ align-items: center;
88
+ padding: 1rem 0;
89
+ border-bottom: 1px solid #3333333b;
90
+ font-family: "IBMPlexSans";
91
+ }
92
+
93
+ .header #logo { background-image: url('/static/logo.png');
94
+ background-size: contain;
95
+ background-repeat: no-repeat;
96
+
97
+ width: 280px;
98
+ height: 70px;
99
+ }
100
+
101
+ .header #menu {
102
+ display: flex;
103
+ flex-wrap: wrap;
104
+ justify-content: center;
105
+ gap: 2rem;
106
+ }
107
+
108
+ .header #menu a {
109
+ text-decoration: none;
110
+ color: #eeeeee;
111
+ transition: 0.3s;
112
+ opacity: 0.85;
113
+ } .header #menu a:hover {
114
+ color: #e9d4ce;
115
+ opacity: 1;
116
+ }
117
+
118
+ .content {
119
+ display: flex;
120
+ justify-content: space-between;
121
+ flex-direction: column;
122
+ padding: 3rem 0;
123
+ color: #dfd9d9;
124
+ }
125
+
126
+ .content h1, .content h2, .content h3 {
127
+ font-family: "Merriweather";
128
+ }
129
+
130
+ .content h1 {
131
+ font-size: 50px;
132
+ }
133
+
134
+ .content .centered {
135
+ text-align: center;
136
+ width: 100%;
137
+ display: block;
138
+ margin: 1rem;
139
+ }
140
+
141
+ article.main-content {
142
+ padding: 3rem 0;
143
+ font-size: 18px;
144
+ font-family: "IBMPlexSans";
145
+ text-align: justify;
146
+ }
147
+
148
+ article.blog-content {
149
+ font-size: 18px;
150
+ font-family: "IBMPlexSans";
151
+ text-align: justify;
152
+ margin-bottom: 1rem;
153
+ }
154
+
155
+ article.main-content form {
156
+ display: flex;
157
+ flex-direction: column;
158
+ gap: 1rem;
159
+ }
160
+
161
+ article.blog-content h3 {
162
+ margin-top: 1rem;
163
+ margin-bottom: 1rem;
164
+ }
165
+
166
+ .action-links {
167
+ display: flex;
168
+ flex-direction: column;
169
+ align-items: center;
170
+ gap: 1rem;
171
+ margin-top: 2rem;
172
+ }
173
+
174
+ .action-links .or-separator {
175
+ font-weight: bold;
176
+ font-family: "IBMPlexSans";
177
+ color: #888;
178
+ font-size: 0.9rem;
179
+ }
180
+
181
+ .btn {
182
+ display: flex;
183
+ text-decoration: none;
184
+ border-radius: 8px;
185
+ min-width: 13rem;
186
+ height: 3rem;
187
+ justify-content: center;
188
+ align-items: center;
189
+ font-family: "IBMPlexSans";
190
+ box-shadow: 2px 1px 49px -4px rgba(62,29,138,0.87);
191
+ -webkit-box-shadow: 2px 1px 49px -8px rgba(62,29,138,0.87);
192
+ -moz-box-shadow: 2px 1px 49px -4px rgba(62,29,138,0.87);
193
+ transition: 0.3s;
194
+ cursor: pointer;
195
+ padding: 1rem;
196
+ }
197
+
198
+ .btn.purple {
199
+ background: #694AB0;
200
+ color: #fffbfb;
201
+ }
202
+
203
+ .btn.purple:hover {
204
+ background: #795EB5;
205
+ }
206
+
207
+ .buttons-list {
208
+ display: flex;
209
+ flex-direction: row;
210
+ gap: 1rem;
211
+ margin-top: 1rem;
212
+ }
213
+
214
+ a.btn.empty {
215
+ border: 2px solid #694AB0;
216
+ color: #9B8EB9;
217
+ }
218
+
219
+ a.btn.empty:hover {
220
+ color: #fff;
221
+ }
222
+
223
+ a.btn.red {
224
+ background: #B32D2D;
225
+ color: #fffbfb;
226
+ box-shadow: none;
227
+ -webkit-box-shadow: none;
228
+ -moz-box-shadow: none;
229
+ }
230
+
231
+ footer.footer {
232
+ display: flex;
233
+ justify-content: center;
234
+ align-items: center;
235
+ flex-direction: row;
236
+ gap: 1rem;
237
+ font-family: "Merriweather";
238
+ border-top: 1px solid #3333333b;
239
+ padding: 2rem 0;
240
+ color: #757575;
241
+ }
242
+
243
+ footer.blog.footer {
244
+ gap: 3px;
245
+ }
246
+
247
+ .footer a {
248
+ text-decoration: none;
249
+ color: #757575;
250
+ transition: 0.3s;
251
+ }
252
+
253
+ .footer a:hover {
254
+ text-decoration: underline;
255
+ color: #fff;
256
+ }
257
+
258
+ form input {
259
+ max-width: 200px;
260
+ height: 35px;
261
+ background: #302746;
262
+ border: 1px solid #000;
263
+ border-radius: 8px;
264
+ color: #fff;
265
+ padding: 1rem;
266
+ box-shadow: 2px 1px 49px -4px rgba(62,29,138,0.87);
267
+ -webkit-box-shadow: 2px 1px 49px -12px rgba(62,29,138,0.87);
268
+ -moz-box-shadow: 2px 1px 49px -4px rgba(62,29,138,0.87);
269
+ border: 0;
270
+ } form input.medium {
271
+ max-width: 350px;
272
+ }
273
+
274
+ form input:focus {
275
+ outline: none;
276
+ border: 1px solid #685d84;
277
+ }
278
+
279
+ select {
280
+ display: flex;
281
+ text-decoration: none;
282
+ border-radius: 8px;
283
+ width: 7rem;
284
+ height: 2rem;
285
+ justify-content: center;
286
+ align-items: center;
287
+ font-family: "IBMPlexSans";
288
+ transition: 0.3s;
289
+ cursor: pointer;
290
+ border: none;
291
+ color: #9B8EB9;
292
+ background: none;
293
+ }
294
+
295
+ div.error {
296
+ display: flex;
297
+ width: 50%;
298
+ min-height: 3rem;
299
+ align-items: center;
300
+ padding: 1rem;
301
+ background: #b75353;
302
+ margin-bottom: 1rem;
303
+ border-radius: 8px;
304
+ border: 1px solid #461111;
305
+ color: #fff;
306
+ gap: 1rem;
307
+ }
308
+
309
+ div.message {
310
+ display: flex;
311
+ width: 50%;
312
+ min-height: 3rem;
313
+ align-items: center;
314
+ padding: 1rem;
315
+ background: #344486;
316
+ margin-bottom: 1rem;
317
+ border-radius: 8px;
318
+ border: 1px solid #0b1a46;
319
+ color: #fff;
320
+ gap: 1rem;
321
+ }
322
+
323
+ form input[type=radio], form input[type=checkbox] {
324
+ height: 20px;
325
+ }
326
+
327
+ div.horizontal-fields {
328
+ max-height: 30px;
329
+ }
330
+
331
+ div.bloginfo {
332
+ display: flex;
333
+ flex-direction: column;
334
+ gap: 1rem;
335
+ margin-top: 2rem;
336
+ border-bottom: 1px solid #3333333b;
337
+ padding: 1.5rem;
338
+ }
339
+
340
+ span.bloginfo {
341
+ font-size: 20px;
342
+ font-family: "IBMSansPlex";
343
+ }
344
+
345
+ textarea.post_content {
346
+ min-height: 400px;
347
+ background: #302746;
348
+ border: 1px solid #000;
349
+ border-radius: 8px;
350
+ color: #fff;
351
+ padding: 1rem;
352
+ border: 0;
353
+ font-size: 15px;
354
+ }
355
+
356
+ textarea.post_content:focus {
357
+ outline: none;
358
+ border: 1px solid #685d84;
359
+ }
360
+
361
+ h1.blog-name {
362
+ font-family: "Merriweather";
363
+ }
364
+
365
+ h1.blog-name a {
366
+ text-decoration: none;
367
+ color: #e9d4ce;
368
+ }
369
+
370
+ h1.post-title {
371
+ font-family: "IBMPlexSans";
372
+ margin-bottom: 1rem;
373
+ font-size: 40px;
374
+ margin-top: 1rem;
375
+ }
376
+
377
+ i.post-date {
378
+ font-size: 15px;
379
+ }
380
+
381
+ article.post-content {
382
+ display: flex;
383
+ flex-direction: column;
384
+ gap: 1rem;
385
+ color: #e6e6e6;
386
+ line-height: 30px;
387
+ margin-bottom: 1rem;
388
+ margin-top: 1rem;
389
+ }
390
+
391
+ article.post-content h1 {
392
+ font-size: 30px;
393
+ }
394
+
395
+ article.post-content h1, article.post-content h2, article.post-content h3 {
396
+ margin-top: 1.5rem;
397
+ }
398
+
399
+ article.post-content blockquote {
400
+ color: #888;
401
+ margin-left: 2rem;
402
+ border-left: 4px solid #888;
403
+ padding-left: 1em;
404
+ font-style: italic;
405
+ }
406
+
407
+ article.post-content a {
408
+ text-decoration: none;
409
+ color: #af9cfb;
410
+ }
411
+
412
+ article.post-content a:hover {
413
+ text-decoration: underline;
414
+ }
415
+
416
+ article.post-content ol, article.post-content ul, article.post-content img {
417
+ max-width: 90%;
418
+ height: auto;
419
+ }
420
+
421
+ article.post-content ol, article.post-content ul {
422
+ padding-left: 2.5rem;
423
+ }
424
+
425
+ article.post-content p > img {
426
+ display: block;
427
+ margin: 0 auto;
428
+ }
429
+
430
+ .small.btn {
431
+ max-width: 30px;
432
+ max-height: 30px;
433
+ min-width: 10px;
434
+ }
435
+
436
+ .small.btn.active, .btn.empty.active {
437
+ border: 2px solid #D4C1FF;
438
+ color: #D4C1FF;
439
+ }
440
+
441
+
442
+ table.posts {
443
+ border-collapse: collapse;
444
+ }
445
+
446
+ a.action {
447
+ text-decoration: none;
448
+ color: #d2c5ff;
449
+ } a.action:hover {
450
+ text-decoration: underline;
451
+ }
452
+
453
+ table.table {
454
+ padding: 1rem;
455
+ }
456
+
457
+ table.table thead {
458
+ height: 3rem;
459
+ }
460
+
461
+ table.table thead th {
462
+ min-height: 2rem;
463
+ background: #2c2244;
464
+ }
465
+
466
+ table.table tbody {
467
+ height: 2.2rem;
468
+ }
469
+
470
+ table.table tbody td {
471
+ text-align: center;
472
+ }
473
+
474
+ table.table tbody tr {
475
+ height: 3rem;
476
+ }
477
+
478
+ table.table tbody tr:nth-child(odd) td {
479
+ background: #684ab1;
480
+ }
481
+
482
+ table.table tbody tr:nth-child(even) td {
483
+ background: #2c2244;
484
+ }
485
+
486
+ p code {
487
+ background: #282c34;
488
+ color: #abb2bf;
489
+ }
490
+
491
+ div.postlist_item {
492
+ display: flex;
493
+ flex-direction: row;
494
+ gap: 1rem;
495
+ }
496
+
497
+ #like {
498
+ cursor: pointer;
499
+ }
500
+
501
+ .flex {
502
+ display: flex;
503
+ }
504
+
505
+ .row {
506
+ flex-direction: row;
507
+ } .column {
508
+ flex-direction: column;
509
+ }
510
+
511
+ .small-gap {
512
+ gap: 5px;
513
+ } .medium-gap {
514
+ gap: 1rem;
515
+ } .big-gap {
516
+ gap: 2rem;
517
+ }
518
+
519
+ .to-right {
520
+ justify-content: right;
521
+ } .to-left {
522
+ justify-content: left;
523
+ } .to-center {
524
+ justify-content: center;
525
+ }
526
+
527
+ .post-content#posts {
528
+ gap: 0;
529
+ }
530
+
531
+ p.column {
532
+ display: flex;
533
+ flex-direction: column;
534
+ }
535
+
536
+ i.caption {
537
+ color: #555;
538
+ font-size: 15px;
539
+ display: block;
540
+ text-align: center;
541
+ }
542
+
543
+ .file_upload {
544
+ width: 8rem;
545
+ }
546
+
547
+ .file_upload::-webkit-file-upload-button {
548
+ visibility: hidden;
549
+ }
550
+ .file_upload::before {
551
+ content: 'Upload file';
552
+ display: inline-block;
553
+ background: #694AB0;
554
+ border-radius: 3px;
555
+ padding: 5px 8px;
556
+ outline: none;
557
+ white-space: nowrap;
558
+ -webkit-user-select: none;
559
+ cursor: pointer;
560
+ font-weight: 700;
561
+ font-size: 10pt;
562
+ color: #fff;
563
+ transition: 0.3s;
564
+ min-width: 7rem;
565
+ text-align: center;
566
+ min-height: 1.5rem;
567
+ line-height: 1.7rem;
568
+ }
569
+ .file_upload:hover::before {
570
+ background: #795EB5;
571
+ }
572
+ .file_upload:active::before {
573
+ background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
574
+ }
575
+
576
+ input[type="checkbox"] {
577
+ width: 20px; /* Szerokość checkboxa */
578
+ height: 20px; /* Wysokość checkboxa */
579
+ appearance: none; /* Usunięcie domyślnego stylu */
580
+ background-color: #302747;
581
+ border: 2px solid #383246;
582
+ border-radius: 3px; /* Zaokrąglenie rogów */
583
+ cursor: pointer; /* Kursor wskazujący */
584
+ position: relative; /* Umożliwia pozycjonowanie pseudo-elementów */
585
+ }
586
+
587
+ input[type="checkbox"]:checked {
588
+ background-color: #694AB0; /* Tło po zaznaczeniu */
589
+ border: 2px solid #694AB0; /* Ramka po zaznaczeniu */
590
+ }
591
+
592
+ input[type="checkbox"]:checked::after {
593
+ content: ''; /* Pseudo-element */
594
+ position: absolute; /* Pozycjonowanie */
595
+ left: 9px; /* Odstęp od lewej */
596
+ top: 2px; /* Odstęp od góry */
597
+ width: 12px; /* Szerokość ptaszka */
598
+ height: 16px; /* Wysokość ptaszka */
599
+ border: solid white; /* Kolor ptaszka */
600
+ border-width: 0 2px 2px 0; /* Kształt ptaszka */
601
+ transform: rotate(45deg); /* Obrót ptaszka */
602
+ }
603
+
604
+ a.link {
605
+ color: #795EB5;
606
+ text-decoration: none;
607
+ }
608
+
609
+ a.link:hover {
610
+ text-decoration: underline;
611
+ }
@@ -0,0 +1,28 @@
1
+ body {
2
+ background: #efefef;
3
+ color: #464646;
4
+ }
5
+
6
+ article.post-content {
7
+ color: #3c3c3c;
8
+ }
9
+
10
+ article.post-content a {
11
+ color: #6834ab;
12
+ }
13
+
14
+ h1.blog-name a {
15
+ color: #6834ab;
16
+ }
17
+
18
+ i.post-date {
19
+ color: #505050;
20
+ }
21
+
22
+ svg {
23
+ fill: #9b4d10;
24
+ }
25
+
26
+ pre code.hljs {
27
+ background: #fff;
28
+ }
@@ -0,0 +1,27 @@
1
+ body {
2
+ background: #11111a;
3
+ }
4
+
5
+ h1.blog-name {
6
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
7
+ }
8
+
9
+ h1.blog-name a, article.blog-content h3, article.post-content a {
10
+ color: #e3bc5e;
11
+ }
12
+
13
+ div#menu a svg {
14
+ fill: #e3bc5e;
15
+ }
16
+
17
+ article.post-content {
18
+ color: #bbbaba;
19
+ }
20
+
21
+ h1.post-title {
22
+ color: #fff;
23
+ }
24
+
25
+ i.post-date {
26
+ color: #737373;
27
+ }
@@ -0,0 +1,50 @@
1
+ body {
2
+ background: #fff;
3
+ }
4
+
5
+ .container {
6
+ background: #fff8e7;
7
+ max-width: 700px;
8
+ margin: 2rem auto;
9
+ padding: 3rem 2.5rem;
10
+ box-shadow: 0 0 10px rgba(0,0,0,0.15);
11
+ border: 1px solid #e0d6c3;
12
+ font-family: 'Georgia', serif;
13
+ line-height: 1.6;
14
+ }
15
+
16
+ h1.blog-name a {
17
+ color: #ffa489;
18
+ }
19
+
20
+ #menu a svg {
21
+ fill: #ffa489;
22
+ }
23
+
24
+ article.post-content {
25
+ color: #828282;
26
+ }
27
+
28
+ article.blog-content h3 {
29
+ color: #353535;
30
+ }
31
+
32
+ article.post-content a {
33
+ color: #ffa489;
34
+ }
35
+
36
+ h1.post-title {
37
+ color: #6c6c6c;
38
+ }
39
+
40
+ i.post-date {
41
+ color: #7c7c7c;
42
+ }
43
+
44
+ pre code.hljs {
45
+ background: #ffffea;
46
+ }
47
+
48
+ p code {
49
+ background: #ffffea;
50
+ }