Fossil SCM
Include rendered technote HTML in RSS feeds.
Commit
7aa1f7f2eab8717ab6b5c3666a5cd3c7ba68fecc9314ca4476afc9ea1ffd5a21
Parent
43267589414bec7…
2 files changed
+27
+15
+27
| --- src/rss.c | ||
| +++ src/rss.c | ||
| @@ -21,10 +21,11 @@ | ||
| 21 | 21 | #include <time.h> |
| 22 | 22 | #include "rss.h" |
| 23 | 23 | #include <assert.h> |
| 24 | 24 | |
| 25 | 25 | void forum_render_to_html(struct Blob*, const char*, const char*); |
| 26 | +void technote_render_to_html(struct Blob*, int); | |
| 26 | 27 | |
| 27 | 28 | /* |
| 28 | 29 | ** Append text to pOut, escaping any CDATA terminators. |
| 29 | 30 | */ |
| 30 | 31 | static void rss_cdata_append(Blob *pOut, const char *zIn, int nIn){ |
| @@ -429,10 +430,23 @@ | ||
| 429 | 430 | blob_size(&normalized)); |
| 430 | 431 | blob_reset(&normalized); |
| 431 | 432 | bForumContent = 1; |
| 432 | 433 | } |
| 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 | + } | |
| 434 | 448 | } |
| 435 | 449 | @ <item> |
| 436 | 450 | @ <title>%s(zPrefix)%h(zCom)%h(zSuffix)</title> |
| 437 | 451 | @ <link>%s(g.zBaseURL)/info/%s(zId)</link> |
| 438 | 452 | @ <description>%s(zPrefix)%h(zCom)%h(zSuffix)</description> |
| @@ -683,10 +697,23 @@ | ||
| 683 | 697 | blob_append(&contentHtml, blob_str(&normalized), |
| 684 | 698 | blob_size(&normalized)); |
| 685 | 699 | blob_reset(&normalized); |
| 686 | 700 | bForumContent = 1; |
| 687 | 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; | |
| 688 | 715 | } |
| 689 | 716 | } |
| 690 | 717 | fossil_print("<item>"); |
| 691 | 718 | fossil_print("<title>%s%h%h</title>\n", zPrefix, zCom, zSuffix); |
| 692 | 719 | fossil_print("<link>%s/info/%s</link>\n", zBaseURL, zId); |
| 693 | 720 |
| --- 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 @@ | ||
| 2564 | 2564 | Blob *pOut, |
| 2565 | 2565 | const char *zMimetype, |
| 2566 | 2566 | const char *zContent, |
| 2567 | 2567 | int eDocSrc |
| 2568 | 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); | |
| 2569 | 2572 | #endif |
| 2570 | 2573 | |
| 2571 | 2574 | /* |
| 2572 | 2575 | ** Show the default Section label for an associated wiki page. |
| 2573 | 2576 | */ |
| @@ -2662,10 +2665,22 @@ | ||
| 2662 | 2665 | htmlize_to_blob(pOut, blob_str(&in), blob_size(&in)); |
| 2663 | 2666 | blob_append_literal(pOut, "</pre>"); |
| 2664 | 2667 | } |
| 2665 | 2668 | blob_reset(&in); |
| 2666 | 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 | +} | |
| 2667 | 2682 | |
| 2668 | 2683 | /* |
| 2669 | 2684 | ** Check to see if there exists a wiki page with a name zPrefix/zName. |
| 2670 | 2685 | ** If there is, then render a <div class='section'>..</div> and |
| 2671 | 2686 | ** return true. |
| 2672 | 2687 |
| --- 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 |