aboutsummaryrefslogtreecommitdiff
path: root/posts/full-posts-rss-readers.txt
blob: cc42bf3980a420032a4c60f086792c3a4e58d7ec (plain)
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
Fri, 06 May 2022
FULL POSTS ARE NOW RENDERED INSIDE RSS READERS

Your subscribers can now read your full articles without leaving the 
comfort of their RSS readers.

I have finally succeeded after fighting with properly rendering full 
post content directly _inside_ RSS readers. I struggled with this 
implementation far longer than I'd like to admit. Although, that's to 
be expected with my caveman knowledge of RSS feeds and my simple monkey 
brain.

But here we are! We made it.


INSPIRATION
-----------

The thought of rendering all the content within users' RSS readers was 
always something I wanted for the initial launch of Shinobi Website. It 
was taking me a while to understand the layout issues caused by 
articles being pure plain text, so I ended up giving up for version 
"1.0".

Then fellow web-minimalist Matthew Graybosch kindly reached out and 
showed off his own beautifully crafted shinobi website[0]. Browsing 
through his site and articles I quickly realized a few rendering woes 
of my own:

1. Having set the reading length to 72, I was hurting the reading 
experience for mobile users
2. Matthew was doing a lot more cool things on his site (D&D style 
tables, separating specific feeds into their own directories)

Shortly after this exchange I was contacted by another plain-text web 
enthusiast, Koray Er[1].  They were inspired to start building out 
their own Shinobi Website. This is where the question was brought up 
regarding full post rendering:

> i want the entire content in my rss reader - not just one line. the 
best i could do was put $(tail -n +4 $file) in the description. that 
works, but without line breaks. is it possible to fix that in rss.sh? i 
don't want to change the txt - it's so pure.

This was the final straw. I _needed_ to get this working in _some_ 
capacity.


CDATA TO THE RESCUE
-------------------

I played around with converting plain text to HTML and pasting it 
inside the XML at build time. This created more problems than it fixed. 
But finally, after roughly 2 hours of going down multiple rabbit holes 
of failure, I mashed together a few concepts from everyone's trusty 
copy/paste site: stackoverflow.

Take a look at the newly updated shell script here:

> https://shinobi.website/script.sh

The only change I have made is inside the `description` tag within the 
individual `item` elements. Take a look if you're interested.

Wait, what the heck that CDATA junk, you might be asking?

> CDATA is defined as blocks of text that are not parsed by the parser, 
but are otherwise recognized as markup.

After that we use `sed` to swap out any newlines with HTML line break 
elements. Nothing crazy there.

NOTE:
As you may have noticed on the main page of this project, the `rss.sh` 
code snippet has been replaced with a direct link to a new `script.sh`. 
Those wishing to implement this new style of formatting will need to 
make the shell changes manually.


CAVEATS
-------

Please note that if you are planning to render your content this way 
there are minor things to look out for.

1. Pasting code examples is a big no-no. The content will be mangled 
and the reader will try to render example snippets as HTML elements. 
Your best bet is to link directly to example files elsewhere in your 
directory.

^ THIS IS NO LONGER TRUE. See details below.[2]

2. This may not work for every single RSS Reader. I can't test every 
application out there in the wild nor can I double check different 
operating systems. All I know is this renders fine for me on macOS 
using NetNewsWire.


FOOTNOTES
---------
[0]: https://matthewgraybosch.com/
[1]: https://korayer.de/
[2]: This issue has been fixed thanks to Matthew Graybosch's excellent 
patch. See patch notes here: 
https://git.sr.ht/~tdarb/shinobi-script/log?from=7e2f8bd312d648ff1c8d3cf
dc747d2e5634100d7#log-7e2f8bd312d648ff1c8d3cfdc747d2e5634100d7


Thanks for reading my humble blog (maybe directly in your RSS reader 
this time too!),
-- Brad