-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
94 lines (62 loc) · 3.32 KB
/
README
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
Dokuwiki Plugin for creating external newsfeeds.
This plugin will generate a news feed that can be read in a standard news reader (See below for how to generate
the feed from the plugin markup.)
-------------------
Syntax Markup
There are two types of markup. At the top of a page that holds new items, you must place one of the following:
~~NEWSFEED~~
~~NEWSFEED:<n>~~
First form: ~~NEWSFEED~~
If you use the first form, then you bracket your news items with the following markup:
<news: item_title>
blah blah
</news>
<news: another_item>
blah blah
</news>
The news reader will use your title for the item. You can omit the title:
<news>
blah blah
</news>
In this case the title will default to 'News Item'
Second form: ~~NEWSFEED:<n>~~
In this form, the news items are generated from material which is preceded by Dokuwiki header markup, and the headers
become the titles of the news items. The <n> designates the number of equal signs that mark up your headers. The plugin will
create news items from all headers greater than or equal to n. For instance:
~~NEWSFEED:3~~
will create items from all headers with with three or more equal signs:
=== header 1 ===
==== header 2 ====
This page is particularly useful if you have a page which is dedicated to news items.
---------------------
Generating the feed
Each of the following methods generates an xml news feed in your top level dokuwiki directory. The news feed file is
named news_feed.xml.
The main file for generating news feeds is newsfeed.php, which is found in news/scripts.
1. place newsfeed.php in your top level dokiuwiki directory and use as your feed url:
http:/my_web_site.org/my_dokuwiki/newsfeed.php
This method adheres to the ttl (time-to-live) configuration setting (see Options below) and creates a new xml file
only after the ttl has expired. Until the expiry time, it reads and outputs the previously created news_feed.xml.
However, you can force a new feed to be created by method 2 or 3.
2. place newsfeed.php in lib/exe and generate the feed from the command line:
php newsfeed.php
3. open the news admin panel and click on the generate button.
4. Create a Refresh button:
~~NOCACHE~~
~~NEWS_REFRESH~~
If you use method 2 or 3 and do not implement method 1, then your url must be:
http:/my_web_site.org/my_dokuwiki/news_feed.xml
---------------
Configuration Options:
1. ttl: Number of minutes before a new feed will be automatically generated
2. title: Feed Title
3. desc: Feed Description.
2 and 3 configure the header section, where the Title is what is feed is known as the the description is a form of subtitle describing the feed further.
---------------------
If you have a version of the news plugin which supports multiple feeds, then you must include a unique feed name in your ~~NEWSFEED~~ syntax:
~~NEWSFEED:<n>;;<feed_name>~~.
~~NEWSFEED:<feed_name>~~
The Refresh button will also require the feed name:
~~NEWS_REFRESH:<feed_name>~~
The header values for these feeds are configured in the file scripts/newsfeed.ini.
You can still use the original syntax, without the feed name; its header title and description will be taken from the default entry in newsfeed.ini or, lacking that, from the options set in the Dokuwiki configuration manager.