1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
|
%global _empty_manifest_terminate_build 0
Name: python-yafpa
Version: 3.0.3
Release: 1
Summary: A script to share your obsidian vault (in partial way)
License: AGPL
URL: https://github.com/Mara-Li/YAFPA-python
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b8/e8/858a2fd4f788ea22bc23199ed038c307c4c8b2c3325520b0740e45af911d/yafpa-3.0.3.tar.gz
BuildArch: noarch
Requires: python3-dotenv
Requires: python3-gitpython
Requires: python3-frontmatter
Requires: python3-pyYAML
Requires: python3-pyperclip
Requires: python3-unidecode
%description
[](https://github.com/Mara-Li/YAFPA-python)
[](https://pypi.org/project/yafpa/)



[](https://github.com/Mara-Li/yet-another-free-publish-alternative)
**This script is intended to be used with [YAFPA](https://github.com/Mara-Li/yet-another-free-publish-alternative), a free way to share your obsidian vault**.
*⚠️ The script and site are not a replacement for [Obsidian Publish](https://obsidian.md/publish), which is a much more efficient way to share Obsidian files.*
# Get Started
- You first need to create a template using [YAFPA-blog](https://github.com/Mara-Li/yet-another-free-publish-alternative)
- After, do `pip install YAFPA`
The first time you use the script, it will ask you three things :
- Your vault path (absolute path !)
- The path of the blog (absolute too !)
- The link of your blog, as `https://my-awesome-blog.netlify.app/`
You can reconfigure the path with `yafpa --config`
The file will be created in your site_package folder.
# Script
usage: yafpa [-h] [--preserve | --update] [--filepath FILEPATH] [--git] [--keep] [--config]
Create file in folder, move image in assets, convert to relative path, add share support, and push to git
optional arguments:
- `-h, --help`: show this help message and exit
- `--preserve, --p, --P` : Don't delete file if already exist
- `--update, --u, --U` : force update : delete all file and reform.
- `--filepath FILEPATH, --f FILEPATH, --F FILEPATH `: Filepath of the file you want to convert
- `--git, --g, --G` : No commit and no push to git
- `--keep, --k` : Keep deleted file from vault and removed shared file
- `--config, --c` : Edit the config file
## Checking differences
The script will convert all file with `share:true` and check if the contents
are different to the versions in `_notes`. The only things that are
ignored is the contents of the metadata. If you want absolutely change the
metadata you can:
- Use `yafpa --file <filepath>` directly
- Use `--u` to force update all file
- Continue to work on the file before pushing it.
- Add a newline
- Manually delete the file
- Add or edit the metadata keys (unless `date`/`title`/`created`/`update`/`link`).
⚠️ As always with git, you can repost the exact same file that already exists on the server.
## Limitations
⚠️ In case you have two files with the same name but :
- In different folder
- With different sharing status or folder
The script will bug because **The folder is not checked** (It's not required). In this unique case, you need to rename one of the files.
- In the same way, in case you change the folder key in the metadata, you will have two identic file in different folder.
## Options
### Share all
`yafpa` and all `yafpa` option without `--F FILEPATH` will automatically read all file in your vault to check the `share: true` key in metadata (frontmatter YAML).
By default, the script will check the difference between line [(*cf checking difference*)](README.md#checking-differences), and convert only the file with difference. You can use `--u` to force update.
### Share only a file
The command will be : `yafpa --F filepath`
The file to be shared does not need to contain `share: true` in its YAML, and will be updated no matter what.
## How it works
The script :
- Moves file (with `share: true` frontmatter or specific file) in the `_notes` folder
- Moves image in `assets/img` and convert (with alt support)
- Converts highlight (`==mark==` to `[[mark::highlight]]`)
- Converts "normal" writing to GFM markdown (adding ` \n` each `\n`)
- Supports non existent file (adding a css for that 😉)
- Supports image flags css (Lithou snippet 🙏)
- Support normal and external files (convert "normal markdown link" to
"wikilinks")
- Edit link to support transluction (if not `embed: False`)
- Remove block id (no support)
- Add CSS settings for inline tags (no link support) ; Tags are : class = .hash ; id = #tag_name (so you can style each tags you use)
- Frontmatter : Update the date if there is no date in frontmatter
- Frontmatter : In absence of title, add the file's title.
- Copy the link to your clipboard if one file is edited.
- ⭐ Admonition conversion to "callout inspired notion"
- Update the frontmatter in the original file, adding the link and change `share` to true if one file is shared.
Finally, the plugin will add, commit and push if supported.
Note : The clipboard may not work in your configuration. I have (and can) only test the script on IOS and Windows, so I use `pyperclip` and `pasteboard` to do that. If you are on MacOS, Linux, Android, please, check your configuration on your python and open an issue if it doesn't work.
Note : I **can't** test on these 3 OSes, so I can't create a clipboard option on my own.
### Custom CSS
You can add CSS using the file [custom.css](https://github.com/Mara-Li/yet-another-free-publish-alternative/blob/master/assets/css/custom.css). The plugin [Markdown Attribute](https://github.com/valentine195/obsidian-markdown-attributes) allow to use the creation of inline css.
Some information about this :
- You need to add `:` after the first `{`
- The inline IAL work only if there is stylized markdown. In absence, the text will be bolded.
- It won't work with highlight (removed automatically by the script)
⚠️ As I use CodeMirror Options and Contextual Typography, I warn you : the use of `#tags` to stylize the text before it doesn't work with my build. So, as an option to don't have a random tag in a text, you can use `custom.css` to remove it with `display: none` (you can have an example with `#left`).
### Frontmatter settings
- `share: true` : Share the file
- `embed: false` : remove the transluction (convert to normal wikilinks)
- `update: false` : Don't update the file at all after the first push
- `folder` : Use a different folder than `_note` ([here some more information](https://github.com/Mara-Li/yet-another-free-publish-alternative#folder-options))
Alternatively, you can use the `category` key : `category: folder/category`
- `folder` is optional ; as default : `_notes`
- `category` can be `false` to prevent apparence in the feed
NB : if `category` and `folder` is used at the same time, `folder` will be used as the folder.
### Admonition
As admonition is very tricky, I choose to convert all admonition to a "callout Notion".
The script will :
- Remove codeblock for admonition codeblocks
- Convert ` ```ad-``` ` to ```!!!ad-```
- Bold title and add a IAL `{: .title}`
JavaScript will make all things nice.
⚠️ As always with markdown, you will see some problem with new paragraph inside admonition. You can use `$~$` to fake line. The script will automatically add this.
Also, you can add emoji on title to add some nice formatting.
#### Custom Admonition
You can now use custom admonition using the file [custom_admonition.yml](https://github.com/Mara-Li/yet-another-free-publish-alternative/blob/master/custom_admonition.yml). The file is formated as a YAML :
```yml
admonition_type: #In obsidian
- logo #emoji
- admonition title: #the name you want in the website
```
- Admonition name correspond to `admonition type` in the admonition plugin.
- Admonition title correspond to `admonition title` you use in the admonition plugin.
You need to create multiple key and value for each different synonyme you use (as in admonition...)
### IOS Shortcuts
You need to found the path of your vault and the blog in your phone. To achieve that, I use [a-shell](https://holzschu.github.io/a-Shell_iOS/).
First, in a-shell, run `pickFolder` and choose the folder of your vault, and rerun `pickFolder` to choose the folder where are the blog data (you need to clone with [Working Copy](https://workingcopyapp.com/))
After, do `showmarks` and copy the two path in any note app. Check if the path is not broken because of the paste!
You can also do :
```bash
cd
showmarks > bookmark
vim bookmark
```
Here is a blank sheet to help you if you want to manually write / edit it :
```
vault=
blog_path=
blog=
share=
```
With :
- `vault`: Vault Absolute Path
- `blog_path` : Blog repository absolute path
- `blog` : Blog link
- `share` : your wanted share key ; by default : `share`
To use the [shortcuts](https://routinehub.co/shortcut/10151/), you need :
- [a-shell](https://holzschu.github.io/a-Shell_iOS/) (Free)
- [Working Copy](https://workingcopyapp.com/)
Before running the shortcuts, you need to install all requirements, aka :
```
pip install yafpa
yafpa --C
```
Links :
- [Share All File](https://routinehub.co/shortcut/10151/)
- [Share One File](https://routinehub.co/shortcut/10475/)
For the moment I can't create a shortcut to share only one file, BUT! You can use `a-shell` as you do in a normal terminal, aka :
```
jump <vault>
yafpa --f <file>
```
To run the script for all your file, run `yafpa`.
Note : Compared to pyto, the script cannot work with `$HOME`, so the `.YAFPA-env` will be created in the folder you use to run it. It is also possible to use multiple folder, but you need to create the file for each. The better is to have one in the vault ; and one in the default folder of a-shell.
### Obsidian
→ Please use Wikilinks with "short links" (I BEG YOU)
You can integrate the script within obsidian using the nice plugin [Obsidian ShellCommands](https://github.com/Taitava/obsidian-shellcommands).
You could create two commands :
1. `share all` : `yafpa`
2. `share one` : `yafpa --f {{file_path:absolute}}`
You can use :
- [Customizable Sidebar](https://github.com/phibr0/obsidian-customizable-sidebar)
- [Obsidian Customizable Menu](https://github.com/kzhovn/obsidian-customizable-menu)
To have a button to share your file directly in Obsidian !
#### Template frontmatter
→ The • indicate that this value is optional
```yaml
title: My files•
date: 12-11-2021•
embed: true•
update: true•
current: true•
flux: true•
share: false (this key can be changed in the configuration)
category: folder/category (category can be false)
description: my awesome file
```
You can use MetaEdit / Supercharged links to quickly update the front matter.
## Exemple of frontmatter :
```yml
category: Roleplay/Application
date: 21-12-2021
share: true
tag: RP/Darkness-Haunted/Application/PC
title: (Darkness Haunted) Alwyn Kallendris
```
The file will be added in the `Roleplay` folder ; and the `Application` will now show the file in the sidebar, the Roleplay page and the collections page.
%package -n python3-yafpa
Summary: A script to share your obsidian vault (in partial way)
Provides: python-yafpa
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-yafpa
[](https://github.com/Mara-Li/YAFPA-python)
[](https://pypi.org/project/yafpa/)



[](https://github.com/Mara-Li/yet-another-free-publish-alternative)
**This script is intended to be used with [YAFPA](https://github.com/Mara-Li/yet-another-free-publish-alternative), a free way to share your obsidian vault**.
*⚠️ The script and site are not a replacement for [Obsidian Publish](https://obsidian.md/publish), which is a much more efficient way to share Obsidian files.*
# Get Started
- You first need to create a template using [YAFPA-blog](https://github.com/Mara-Li/yet-another-free-publish-alternative)
- After, do `pip install YAFPA`
The first time you use the script, it will ask you three things :
- Your vault path (absolute path !)
- The path of the blog (absolute too !)
- The link of your blog, as `https://my-awesome-blog.netlify.app/`
You can reconfigure the path with `yafpa --config`
The file will be created in your site_package folder.
# Script
usage: yafpa [-h] [--preserve | --update] [--filepath FILEPATH] [--git] [--keep] [--config]
Create file in folder, move image in assets, convert to relative path, add share support, and push to git
optional arguments:
- `-h, --help`: show this help message and exit
- `--preserve, --p, --P` : Don't delete file if already exist
- `--update, --u, --U` : force update : delete all file and reform.
- `--filepath FILEPATH, --f FILEPATH, --F FILEPATH `: Filepath of the file you want to convert
- `--git, --g, --G` : No commit and no push to git
- `--keep, --k` : Keep deleted file from vault and removed shared file
- `--config, --c` : Edit the config file
## Checking differences
The script will convert all file with `share:true` and check if the contents
are different to the versions in `_notes`. The only things that are
ignored is the contents of the metadata. If you want absolutely change the
metadata you can:
- Use `yafpa --file <filepath>` directly
- Use `--u` to force update all file
- Continue to work on the file before pushing it.
- Add a newline
- Manually delete the file
- Add or edit the metadata keys (unless `date`/`title`/`created`/`update`/`link`).
⚠️ As always with git, you can repost the exact same file that already exists on the server.
## Limitations
⚠️ In case you have two files with the same name but :
- In different folder
- With different sharing status or folder
The script will bug because **The folder is not checked** (It's not required). In this unique case, you need to rename one of the files.
- In the same way, in case you change the folder key in the metadata, you will have two identic file in different folder.
## Options
### Share all
`yafpa` and all `yafpa` option without `--F FILEPATH` will automatically read all file in your vault to check the `share: true` key in metadata (frontmatter YAML).
By default, the script will check the difference between line [(*cf checking difference*)](README.md#checking-differences), and convert only the file with difference. You can use `--u` to force update.
### Share only a file
The command will be : `yafpa --F filepath`
The file to be shared does not need to contain `share: true` in its YAML, and will be updated no matter what.
## How it works
The script :
- Moves file (with `share: true` frontmatter or specific file) in the `_notes` folder
- Moves image in `assets/img` and convert (with alt support)
- Converts highlight (`==mark==` to `[[mark::highlight]]`)
- Converts "normal" writing to GFM markdown (adding ` \n` each `\n`)
- Supports non existent file (adding a css for that 😉)
- Supports image flags css (Lithou snippet 🙏)
- Support normal and external files (convert "normal markdown link" to
"wikilinks")
- Edit link to support transluction (if not `embed: False`)
- Remove block id (no support)
- Add CSS settings for inline tags (no link support) ; Tags are : class = .hash ; id = #tag_name (so you can style each tags you use)
- Frontmatter : Update the date if there is no date in frontmatter
- Frontmatter : In absence of title, add the file's title.
- Copy the link to your clipboard if one file is edited.
- ⭐ Admonition conversion to "callout inspired notion"
- Update the frontmatter in the original file, adding the link and change `share` to true if one file is shared.
Finally, the plugin will add, commit and push if supported.
Note : The clipboard may not work in your configuration. I have (and can) only test the script on IOS and Windows, so I use `pyperclip` and `pasteboard` to do that. If you are on MacOS, Linux, Android, please, check your configuration on your python and open an issue if it doesn't work.
Note : I **can't** test on these 3 OSes, so I can't create a clipboard option on my own.
### Custom CSS
You can add CSS using the file [custom.css](https://github.com/Mara-Li/yet-another-free-publish-alternative/blob/master/assets/css/custom.css). The plugin [Markdown Attribute](https://github.com/valentine195/obsidian-markdown-attributes) allow to use the creation of inline css.
Some information about this :
- You need to add `:` after the first `{`
- The inline IAL work only if there is stylized markdown. In absence, the text will be bolded.
- It won't work with highlight (removed automatically by the script)
⚠️ As I use CodeMirror Options and Contextual Typography, I warn you : the use of `#tags` to stylize the text before it doesn't work with my build. So, as an option to don't have a random tag in a text, you can use `custom.css` to remove it with `display: none` (you can have an example with `#left`).
### Frontmatter settings
- `share: true` : Share the file
- `embed: false` : remove the transluction (convert to normal wikilinks)
- `update: false` : Don't update the file at all after the first push
- `folder` : Use a different folder than `_note` ([here some more information](https://github.com/Mara-Li/yet-another-free-publish-alternative#folder-options))
Alternatively, you can use the `category` key : `category: folder/category`
- `folder` is optional ; as default : `_notes`
- `category` can be `false` to prevent apparence in the feed
NB : if `category` and `folder` is used at the same time, `folder` will be used as the folder.
### Admonition
As admonition is very tricky, I choose to convert all admonition to a "callout Notion".
The script will :
- Remove codeblock for admonition codeblocks
- Convert ` ```ad-``` ` to ```!!!ad-```
- Bold title and add a IAL `{: .title}`
JavaScript will make all things nice.
⚠️ As always with markdown, you will see some problem with new paragraph inside admonition. You can use `$~$` to fake line. The script will automatically add this.
Also, you can add emoji on title to add some nice formatting.
#### Custom Admonition
You can now use custom admonition using the file [custom_admonition.yml](https://github.com/Mara-Li/yet-another-free-publish-alternative/blob/master/custom_admonition.yml). The file is formated as a YAML :
```yml
admonition_type: #In obsidian
- logo #emoji
- admonition title: #the name you want in the website
```
- Admonition name correspond to `admonition type` in the admonition plugin.
- Admonition title correspond to `admonition title` you use in the admonition plugin.
You need to create multiple key and value for each different synonyme you use (as in admonition...)
### IOS Shortcuts
You need to found the path of your vault and the blog in your phone. To achieve that, I use [a-shell](https://holzschu.github.io/a-Shell_iOS/).
First, in a-shell, run `pickFolder` and choose the folder of your vault, and rerun `pickFolder` to choose the folder where are the blog data (you need to clone with [Working Copy](https://workingcopyapp.com/))
After, do `showmarks` and copy the two path in any note app. Check if the path is not broken because of the paste!
You can also do :
```bash
cd
showmarks > bookmark
vim bookmark
```
Here is a blank sheet to help you if you want to manually write / edit it :
```
vault=
blog_path=
blog=
share=
```
With :
- `vault`: Vault Absolute Path
- `blog_path` : Blog repository absolute path
- `blog` : Blog link
- `share` : your wanted share key ; by default : `share`
To use the [shortcuts](https://routinehub.co/shortcut/10151/), you need :
- [a-shell](https://holzschu.github.io/a-Shell_iOS/) (Free)
- [Working Copy](https://workingcopyapp.com/)
Before running the shortcuts, you need to install all requirements, aka :
```
pip install yafpa
yafpa --C
```
Links :
- [Share All File](https://routinehub.co/shortcut/10151/)
- [Share One File](https://routinehub.co/shortcut/10475/)
For the moment I can't create a shortcut to share only one file, BUT! You can use `a-shell` as you do in a normal terminal, aka :
```
jump <vault>
yafpa --f <file>
```
To run the script for all your file, run `yafpa`.
Note : Compared to pyto, the script cannot work with `$HOME`, so the `.YAFPA-env` will be created in the folder you use to run it. It is also possible to use multiple folder, but you need to create the file for each. The better is to have one in the vault ; and one in the default folder of a-shell.
### Obsidian
→ Please use Wikilinks with "short links" (I BEG YOU)
You can integrate the script within obsidian using the nice plugin [Obsidian ShellCommands](https://github.com/Taitava/obsidian-shellcommands).
You could create two commands :
1. `share all` : `yafpa`
2. `share one` : `yafpa --f {{file_path:absolute}}`
You can use :
- [Customizable Sidebar](https://github.com/phibr0/obsidian-customizable-sidebar)
- [Obsidian Customizable Menu](https://github.com/kzhovn/obsidian-customizable-menu)
To have a button to share your file directly in Obsidian !
#### Template frontmatter
→ The • indicate that this value is optional
```yaml
title: My files•
date: 12-11-2021•
embed: true•
update: true•
current: true•
flux: true•
share: false (this key can be changed in the configuration)
category: folder/category (category can be false)
description: my awesome file
```
You can use MetaEdit / Supercharged links to quickly update the front matter.
## Exemple of frontmatter :
```yml
category: Roleplay/Application
date: 21-12-2021
share: true
tag: RP/Darkness-Haunted/Application/PC
title: (Darkness Haunted) Alwyn Kallendris
```
The file will be added in the `Roleplay` folder ; and the `Application` will now show the file in the sidebar, the Roleplay page and the collections page.
%package help
Summary: Development documents and examples for yafpa
Provides: python3-yafpa-doc
%description help
[](https://github.com/Mara-Li/YAFPA-python)
[](https://pypi.org/project/yafpa/)



[](https://github.com/Mara-Li/yet-another-free-publish-alternative)
**This script is intended to be used with [YAFPA](https://github.com/Mara-Li/yet-another-free-publish-alternative), a free way to share your obsidian vault**.
*⚠️ The script and site are not a replacement for [Obsidian Publish](https://obsidian.md/publish), which is a much more efficient way to share Obsidian files.*
# Get Started
- You first need to create a template using [YAFPA-blog](https://github.com/Mara-Li/yet-another-free-publish-alternative)
- After, do `pip install YAFPA`
The first time you use the script, it will ask you three things :
- Your vault path (absolute path !)
- The path of the blog (absolute too !)
- The link of your blog, as `https://my-awesome-blog.netlify.app/`
You can reconfigure the path with `yafpa --config`
The file will be created in your site_package folder.
# Script
usage: yafpa [-h] [--preserve | --update] [--filepath FILEPATH] [--git] [--keep] [--config]
Create file in folder, move image in assets, convert to relative path, add share support, and push to git
optional arguments:
- `-h, --help`: show this help message and exit
- `--preserve, --p, --P` : Don't delete file if already exist
- `--update, --u, --U` : force update : delete all file and reform.
- `--filepath FILEPATH, --f FILEPATH, --F FILEPATH `: Filepath of the file you want to convert
- `--git, --g, --G` : No commit and no push to git
- `--keep, --k` : Keep deleted file from vault and removed shared file
- `--config, --c` : Edit the config file
## Checking differences
The script will convert all file with `share:true` and check if the contents
are different to the versions in `_notes`. The only things that are
ignored is the contents of the metadata. If you want absolutely change the
metadata you can:
- Use `yafpa --file <filepath>` directly
- Use `--u` to force update all file
- Continue to work on the file before pushing it.
- Add a newline
- Manually delete the file
- Add or edit the metadata keys (unless `date`/`title`/`created`/`update`/`link`).
⚠️ As always with git, you can repost the exact same file that already exists on the server.
## Limitations
⚠️ In case you have two files with the same name but :
- In different folder
- With different sharing status or folder
The script will bug because **The folder is not checked** (It's not required). In this unique case, you need to rename one of the files.
- In the same way, in case you change the folder key in the metadata, you will have two identic file in different folder.
## Options
### Share all
`yafpa` and all `yafpa` option without `--F FILEPATH` will automatically read all file in your vault to check the `share: true` key in metadata (frontmatter YAML).
By default, the script will check the difference between line [(*cf checking difference*)](README.md#checking-differences), and convert only the file with difference. You can use `--u` to force update.
### Share only a file
The command will be : `yafpa --F filepath`
The file to be shared does not need to contain `share: true` in its YAML, and will be updated no matter what.
## How it works
The script :
- Moves file (with `share: true` frontmatter or specific file) in the `_notes` folder
- Moves image in `assets/img` and convert (with alt support)
- Converts highlight (`==mark==` to `[[mark::highlight]]`)
- Converts "normal" writing to GFM markdown (adding ` \n` each `\n`)
- Supports non existent file (adding a css for that 😉)
- Supports image flags css (Lithou snippet 🙏)
- Support normal and external files (convert "normal markdown link" to
"wikilinks")
- Edit link to support transluction (if not `embed: False`)
- Remove block id (no support)
- Add CSS settings for inline tags (no link support) ; Tags are : class = .hash ; id = #tag_name (so you can style each tags you use)
- Frontmatter : Update the date if there is no date in frontmatter
- Frontmatter : In absence of title, add the file's title.
- Copy the link to your clipboard if one file is edited.
- ⭐ Admonition conversion to "callout inspired notion"
- Update the frontmatter in the original file, adding the link and change `share` to true if one file is shared.
Finally, the plugin will add, commit and push if supported.
Note : The clipboard may not work in your configuration. I have (and can) only test the script on IOS and Windows, so I use `pyperclip` and `pasteboard` to do that. If you are on MacOS, Linux, Android, please, check your configuration on your python and open an issue if it doesn't work.
Note : I **can't** test on these 3 OSes, so I can't create a clipboard option on my own.
### Custom CSS
You can add CSS using the file [custom.css](https://github.com/Mara-Li/yet-another-free-publish-alternative/blob/master/assets/css/custom.css). The plugin [Markdown Attribute](https://github.com/valentine195/obsidian-markdown-attributes) allow to use the creation of inline css.
Some information about this :
- You need to add `:` after the first `{`
- The inline IAL work only if there is stylized markdown. In absence, the text will be bolded.
- It won't work with highlight (removed automatically by the script)
⚠️ As I use CodeMirror Options and Contextual Typography, I warn you : the use of `#tags` to stylize the text before it doesn't work with my build. So, as an option to don't have a random tag in a text, you can use `custom.css` to remove it with `display: none` (you can have an example with `#left`).
### Frontmatter settings
- `share: true` : Share the file
- `embed: false` : remove the transluction (convert to normal wikilinks)
- `update: false` : Don't update the file at all after the first push
- `folder` : Use a different folder than `_note` ([here some more information](https://github.com/Mara-Li/yet-another-free-publish-alternative#folder-options))
Alternatively, you can use the `category` key : `category: folder/category`
- `folder` is optional ; as default : `_notes`
- `category` can be `false` to prevent apparence in the feed
NB : if `category` and `folder` is used at the same time, `folder` will be used as the folder.
### Admonition
As admonition is very tricky, I choose to convert all admonition to a "callout Notion".
The script will :
- Remove codeblock for admonition codeblocks
- Convert ` ```ad-``` ` to ```!!!ad-```
- Bold title and add a IAL `{: .title}`
JavaScript will make all things nice.
⚠️ As always with markdown, you will see some problem with new paragraph inside admonition. You can use `$~$` to fake line. The script will automatically add this.
Also, you can add emoji on title to add some nice formatting.
#### Custom Admonition
You can now use custom admonition using the file [custom_admonition.yml](https://github.com/Mara-Li/yet-another-free-publish-alternative/blob/master/custom_admonition.yml). The file is formated as a YAML :
```yml
admonition_type: #In obsidian
- logo #emoji
- admonition title: #the name you want in the website
```
- Admonition name correspond to `admonition type` in the admonition plugin.
- Admonition title correspond to `admonition title` you use in the admonition plugin.
You need to create multiple key and value for each different synonyme you use (as in admonition...)
### IOS Shortcuts
You need to found the path of your vault and the blog in your phone. To achieve that, I use [a-shell](https://holzschu.github.io/a-Shell_iOS/).
First, in a-shell, run `pickFolder` and choose the folder of your vault, and rerun `pickFolder` to choose the folder where are the blog data (you need to clone with [Working Copy](https://workingcopyapp.com/))
After, do `showmarks` and copy the two path in any note app. Check if the path is not broken because of the paste!
You can also do :
```bash
cd
showmarks > bookmark
vim bookmark
```
Here is a blank sheet to help you if you want to manually write / edit it :
```
vault=
blog_path=
blog=
share=
```
With :
- `vault`: Vault Absolute Path
- `blog_path` : Blog repository absolute path
- `blog` : Blog link
- `share` : your wanted share key ; by default : `share`
To use the [shortcuts](https://routinehub.co/shortcut/10151/), you need :
- [a-shell](https://holzschu.github.io/a-Shell_iOS/) (Free)
- [Working Copy](https://workingcopyapp.com/)
Before running the shortcuts, you need to install all requirements, aka :
```
pip install yafpa
yafpa --C
```
Links :
- [Share All File](https://routinehub.co/shortcut/10151/)
- [Share One File](https://routinehub.co/shortcut/10475/)
For the moment I can't create a shortcut to share only one file, BUT! You can use `a-shell` as you do in a normal terminal, aka :
```
jump <vault>
yafpa --f <file>
```
To run the script for all your file, run `yafpa`.
Note : Compared to pyto, the script cannot work with `$HOME`, so the `.YAFPA-env` will be created in the folder you use to run it. It is also possible to use multiple folder, but you need to create the file for each. The better is to have one in the vault ; and one in the default folder of a-shell.
### Obsidian
→ Please use Wikilinks with "short links" (I BEG YOU)
You can integrate the script within obsidian using the nice plugin [Obsidian ShellCommands](https://github.com/Taitava/obsidian-shellcommands).
You could create two commands :
1. `share all` : `yafpa`
2. `share one` : `yafpa --f {{file_path:absolute}}`
You can use :
- [Customizable Sidebar](https://github.com/phibr0/obsidian-customizable-sidebar)
- [Obsidian Customizable Menu](https://github.com/kzhovn/obsidian-customizable-menu)
To have a button to share your file directly in Obsidian !
#### Template frontmatter
→ The • indicate that this value is optional
```yaml
title: My files•
date: 12-11-2021•
embed: true•
update: true•
current: true•
flux: true•
share: false (this key can be changed in the configuration)
category: folder/category (category can be false)
description: my awesome file
```
You can use MetaEdit / Supercharged links to quickly update the front matter.
## Exemple of frontmatter :
```yml
category: Roleplay/Application
date: 21-12-2021
share: true
tag: RP/Darkness-Haunted/Application/PC
title: (Darkness Haunted) Alwyn Kallendris
```
The file will be added in the `Roleplay` folder ; and the `Application` will now show the file in the sidebar, the Roleplay page and the collections page.
%prep
%autosetup -n yafpa-3.0.3
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-yafpa -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Apr 25 2023 Python_Bot <Python_Bot@openeuler.org> - 3.0.3-1
- Package Spec generated
|