Fossil SCM

Include rendered technote HTML in RSS feeds.

vor0nwe 2026-03-06 16:03 rss-content
Commit 7aa1f7f2eab8717ab6b5c3666a5cd3c7ba68fecc9314ca4476afc9ea1ffd5a21
2 files changed +27 +15
+27
--- src/rss.c
+++ src/rss.c
@@ -21,10 +21,11 @@
2121
#include <time.h>
2222
#include "rss.h"
2323
#include <assert.h>
2424
2525
void forum_render_to_html(struct Blob*, const char*, const char*);
26
+void technote_render_to_html(struct Blob*, int);
2627
2728
/*
2829
** Append text to pOut, escaping any CDATA terminators.
2930
*/
3031
static void rss_cdata_append(Blob *pOut, const char *zIn, int nIn){
@@ -429,10 +430,23 @@
429430
blob_size(&normalized));
430431
blob_reset(&normalized);
431432
bForumContent = 1;
432433
}
433434
}
435
+ }else if( zEType[0]=='e' ){
436
+ technote_render_to_html(&contentHtml, rid);
437
+ if( blob_size(&contentHtml)>0 ){
438
+ Blob normalized = BLOB_INITIALIZER;
439
+ rss_make_abs_links(&normalized, blob_str(&base),
440
+ blob_str(&top), blob_str(&contentHtml),
441
+ blob_size(&contentHtml));
442
+ blob_reset(&contentHtml);
443
+ blob_append(&contentHtml, blob_str(&normalized),
444
+ blob_size(&normalized));
445
+ blob_reset(&normalized);
446
+ bForumContent = 1;
447
+ }
434448
}
435449
@ <item>
436450
@ <title>%s(zPrefix)%h(zCom)%h(zSuffix)</title>
437451
@ <link>%s(g.zBaseURL)/info/%s(zId)</link>
438452
@ <description>%s(zPrefix)%h(zCom)%h(zSuffix)</description>
@@ -683,10 +697,23 @@
683697
blob_append(&contentHtml, blob_str(&normalized),
684698
blob_size(&normalized));
685699
blob_reset(&normalized);
686700
bForumContent = 1;
687701
}
702
+ }
703
+ }else if( zEType[0]=='e' ){
704
+ technote_render_to_html(&contentHtml, rid);
705
+ if( blob_size(&contentHtml)>0 ){
706
+ Blob normalized = BLOB_INITIALIZER;
707
+ rss_make_abs_links(&normalized, blob_str(&base),
708
+ blob_str(&top), blob_str(&contentHtml),
709
+ blob_size(&contentHtml));
710
+ blob_reset(&contentHtml);
711
+ blob_append(&contentHtml, blob_str(&normalized),
712
+ blob_size(&normalized));
713
+ blob_reset(&normalized);
714
+ bForumContent = 1;
688715
}
689716
}
690717
fossil_print("<item>");
691718
fossil_print("<title>%s%h%h</title>\n", zPrefix, zCom, zSuffix);
692719
fossil_print("<link>%s/info/%s</link>\n", zBaseURL, zId);
693720
--- src/rss.c
+++ src/rss.c
@@ -21,10 +21,11 @@
21 #include <time.h>
22 #include "rss.h"
23 #include <assert.h>
24
25 void forum_render_to_html(struct Blob*, const char*, const char*);
 
26
27 /*
28 ** Append text to pOut, escaping any CDATA terminators.
29 */
30 static void rss_cdata_append(Blob *pOut, const char *zIn, int nIn){
@@ -429,10 +430,23 @@
429 blob_size(&normalized));
430 blob_reset(&normalized);
431 bForumContent = 1;
432 }
433 }
 
 
 
 
 
 
 
 
 
 
 
 
 
434 }
435 @ <item>
436 @ <title>%s(zPrefix)%h(zCom)%h(zSuffix)</title>
437 @ <link>%s(g.zBaseURL)/info/%s(zId)</link>
438 @ <description>%s(zPrefix)%h(zCom)%h(zSuffix)</description>
@@ -683,10 +697,23 @@
683 blob_append(&contentHtml, blob_str(&normalized),
684 blob_size(&normalized));
685 blob_reset(&normalized);
686 bForumContent = 1;
687 }
 
 
 
 
 
 
 
 
 
 
 
 
 
688 }
689 }
690 fossil_print("<item>");
691 fossil_print("<title>%s%h%h</title>\n", zPrefix, zCom, zSuffix);
692 fossil_print("<link>%s/info/%s</link>\n", zBaseURL, zId);
693
--- src/rss.c
+++ src/rss.c
@@ -21,10 +21,11 @@
21 #include <time.h>
22 #include "rss.h"
23 #include <assert.h>
24
25 void forum_render_to_html(struct Blob*, const char*, const char*);
26 void technote_render_to_html(struct Blob*, int);
27
28 /*
29 ** Append text to pOut, escaping any CDATA terminators.
30 */
31 static void rss_cdata_append(Blob *pOut, const char *zIn, int nIn){
@@ -429,10 +430,23 @@
430 blob_size(&normalized));
431 blob_reset(&normalized);
432 bForumContent = 1;
433 }
434 }
435 }else if( zEType[0]=='e' ){
436 technote_render_to_html(&contentHtml, rid);
437 if( blob_size(&contentHtml)>0 ){
438 Blob normalized = BLOB_INITIALIZER;
439 rss_make_abs_links(&normalized, blob_str(&base),
440 blob_str(&top), blob_str(&contentHtml),
441 blob_size(&contentHtml));
442 blob_reset(&contentHtml);
443 blob_append(&contentHtml, blob_str(&normalized),
444 blob_size(&normalized));
445 blob_reset(&normalized);
446 bForumContent = 1;
447 }
448 }
449 @ <item>
450 @ <title>%s(zPrefix)%h(zCom)%h(zSuffix)</title>
451 @ <link>%s(g.zBaseURL)/info/%s(zId)</link>
452 @ <description>%s(zPrefix)%h(zCom)%h(zSuffix)</description>
@@ -683,10 +697,23 @@
697 blob_append(&contentHtml, blob_str(&normalized),
698 blob_size(&normalized));
699 blob_reset(&normalized);
700 bForumContent = 1;
701 }
702 }
703 }else if( zEType[0]=='e' ){
704 technote_render_to_html(&contentHtml, rid);
705 if( blob_size(&contentHtml)>0 ){
706 Blob normalized = BLOB_INITIALIZER;
707 rss_make_abs_links(&normalized, blob_str(&base),
708 blob_str(&top), blob_str(&contentHtml),
709 blob_size(&contentHtml));
710 blob_reset(&contentHtml);
711 blob_append(&contentHtml, blob_str(&normalized),
712 blob_size(&normalized));
713 blob_reset(&normalized);
714 bForumContent = 1;
715 }
716 }
717 fossil_print("<item>");
718 fossil_print("<title>%s%h%h</title>\n", zPrefix, zCom, zSuffix);
719 fossil_print("<link>%s/info/%s</link>\n", zBaseURL, zId);
720
+15
--- src/wiki.c
+++ src/wiki.c
@@ -2564,10 +2564,13 @@
25642564
Blob *pOut,
25652565
const char *zMimetype,
25662566
const char *zContent,
25672567
int eDocSrc
25682568
);
2569
+
2570
+/* Render a technote's content (rid) to HTML in an output blob. */
2571
+void technote_render_to_html(Blob *pOut, int rid);
25692572
#endif
25702573
25712574
/*
25722575
** Show the default Section label for an associated wiki page.
25732576
*/
@@ -2662,10 +2665,22 @@
26622665
htmlize_to_blob(pOut, blob_str(&in), blob_size(&in));
26632666
blob_append_literal(pOut, "</pre>");
26642667
}
26652668
blob_reset(&in);
26662669
}
2670
+
2671
+/*
2672
+** Render technote content into an output blob as HTML.
2673
+*/
2674
+void technote_render_to_html(Blob *pOut, int rid){
2675
+ Manifest *pNote;
2676
+ if( pOut==0 ) return;
2677
+ pNote = manifest_get(rid, CFTYPE_EVENT, 0);
2678
+ if( pNote==0 ) return;
2679
+ wiki_convert_to_html(pOut, pNote->zMimetype, pNote->zWiki, DOCSRC_WIKI);
2680
+ manifest_destroy(pNote);
2681
+}
26672682
26682683
/*
26692684
** Check to see if there exists a wiki page with a name zPrefix/zName.
26702685
** If there is, then render a <div class='section'>..</div> and
26712686
** return true.
26722687
--- src/wiki.c
+++ src/wiki.c
@@ -2564,10 +2564,13 @@
2564 Blob *pOut,
2565 const char *zMimetype,
2566 const char *zContent,
2567 int eDocSrc
2568 );
 
 
 
2569 #endif
2570
2571 /*
2572 ** Show the default Section label for an associated wiki page.
2573 */
@@ -2662,10 +2665,22 @@
2662 htmlize_to_blob(pOut, blob_str(&in), blob_size(&in));
2663 blob_append_literal(pOut, "</pre>");
2664 }
2665 blob_reset(&in);
2666 }
 
 
 
 
 
 
 
 
 
 
 
 
2667
2668 /*
2669 ** Check to see if there exists a wiki page with a name zPrefix/zName.
2670 ** If there is, then render a <div class='section'>..</div> and
2671 ** return true.
2672
--- src/wiki.c
+++ src/wiki.c
@@ -2564,10 +2564,13 @@
2564 Blob *pOut,
2565 const char *zMimetype,
2566 const char *zContent,
2567 int eDocSrc
2568 );
2569
2570 /* Render a technote's content (rid) to HTML in an output blob. */
2571 void technote_render_to_html(Blob *pOut, int rid);
2572 #endif
2573
2574 /*
2575 ** Show the default Section label for an associated wiki page.
2576 */
@@ -2662,10 +2665,22 @@
2665 htmlize_to_blob(pOut, blob_str(&in), blob_size(&in));
2666 blob_append_literal(pOut, "</pre>");
2667 }
2668 blob_reset(&in);
2669 }
2670
2671 /*
2672 ** Render technote content into an output blob as HTML.
2673 */
2674 void technote_render_to_html(Blob *pOut, int rid){
2675 Manifest *pNote;
2676 if( pOut==0 ) return;
2677 pNote = manifest_get(rid, CFTYPE_EVENT, 0);
2678 if( pNote==0 ) return;
2679 wiki_convert_to_html(pOut, pNote->zMimetype, pNote->zWiki, DOCSRC_WIKI);
2680 manifest_destroy(pNote);
2681 }
2682
2683 /*
2684 ** Check to see if there exists a wiki page with a name zPrefix/zName.
2685 ** If there is, then render a <div class='section'>..</div> and
2686 ** return true.
2687

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button