aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/en/Developer/write_config_files.html
blob: 17eae753107edac0417c137bcb50b1cea39b597e (plain) (blame)
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
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>wallabag - Write config files</title>

        <link rel="stylesheet" href="http://doc.wallabag.org/css/bootstrap.min.css">
        <link rel="stylesheet" href="http://doc.wallabag.org/css/font-awesome.min.css">
        <link rel="stylesheet" href="http://doc.wallabag.org/css/highlight.tomorrow-night.css">
        <link rel="stylesheet" href="http://doc.wallabag.org/css/main.css">
    </head>
    <body>

        <header class="navbar navbar-default navbar-fixed-top">

            <a class="navbar-brand" href="http://doc.wallabag.org/">
                wallabag
                <small class="hidden-xs hidden-sm">
                    Write config files
                </small>
            </a>
            <a href="http://doc.wallabag.org/en">EN</a> - <a href="http://doc.wallabag.org/fr">FR</a> - <a href="http://doc.wallabag.org/de">DE</a> - <a href="http://doc.wallabag.org/ru">RU</a>

            
        </header>

        <main class="container-fluid">
            <div class="row">

                
                    <nav id="sidebar" class="col-sm-3 col-lg-2" role="navigation">

                                                                                    <ul class="nav nav-pills nav-stacked">
                                    
                                    <h4 class="text-muted">
                                        
                                    </h4>

                                        <ul class="nav nav-pills nav-stacked">
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/index.html">
                                                   Getting started
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/help_wallabag.html">
                                                   Help us
                                                </a>
                                            </li>
                                                                                </ul>
                                    
                                    <h4 class="text-muted">
                                        Administrator
                                    </h4>

                                        <ul class="nav nav-pills nav-stacked">
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Administrator/download_and_install.html">
                                                   Download and installation
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Administrator/update.html">
                                                   Update wallabag
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Administrator/hidden_options.html">
                                                   Hidden options
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Administrator/multiusers.html">
                                                   Multi users
                                                </a>
                                            </li>
                                                                                </ul>
                                    
                                    <h4 class="text-muted">
                                        User
                                    </h4>

                                        <ul class="nav nav-pills nav-stacked">
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/save_your_first_article.html">
                                                   Save your first article
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/read_an_article.html">
                                                   Read an article
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/organize_articles.html">
                                                   Organize articles
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/configure_wallabag.html">
                                                   Configure wallabag
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/search.html">
                                                   Search
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/epub_conversion.html">
                                                   ePub conversion
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/issue_with_article.html">
                                                   Issue with article
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/rss_feed.html">
                                                   RSS feed
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/import_export.html">
                                                   Import export
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/User/framabag_account_creation.html">
                                                   Framabag account creation
                                                </a>
                                            </li>
                                                                                </ul>
                                    
                                    <h4 class="text-muted">
                                        Developer
                                    </h4>

                                        <ul class="nav nav-pills nav-stacked">
                                                                                    <li class="test active">
                                                <a href="http://doc.wallabag.org/en/Developer/write_config_files.html">
                                                   Write config files
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Developer/create_new_theme.html">
                                                   Create a new theme
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Developer/git_repo.html">
                                                   Git repository
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Developer/docker.html">
                                                   Docker
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Developer/vagrant.html">
                                                   Vagrant
                                                </a>
                                            </li>
                                                                                    <li class="test ">
                                                <a href="http://doc.wallabag.org/en/Developer/v2.html">
                                                   wallabag v2 / symfony2
                                                </a>
                                            </li>
                                                                                </ul>
                                                                    </ul>
                                                                                                                                                                                                                
                    </nav>

                
                <section class="col-lg-10">
                    <h1 id="write-config-files">Write config files</h1>
<p>wallabag can use specific site config files to parse website articles. These files are stored in the <a href="https://github.com/wallabag/wallabag/tree/master/inc/3rdparty/site_config/standard"><code>inc/3rdparty/site_config/standard</code></a> folder.</p>
<p>The format used for these files is <a href="http://www.w3.org/TR/xpath20/">XPath</a>. Look at some examples in the folder.</p>
<h2 id="automatic-config-files-generation">Automatic config files generation</h2>
<p>Fivefilters has created a <a href="http://siteconfig.fivefilters.org/">very useful tool</a> to create config files. You just type in the adress of the article to work on with, and you select the area containing the content you want.</p>
<p><img src="https://lut.im/RNaO7gGe/l9vRnO1b" alt="siteconfig" /></p>
<p>You should confirm this area by trying with other articles.<br />
When you got the right area, just click on <em>Download Full-Text RSS site config</em> to download your file.</p>
<h2 id="manual-config-file-generation">Manual config file generation</h2>
<p>If Fivefilters tool doesn't work correctly, take a look at the source (Ctrl + U on Firefox and Chromium). Search for your content and get the <code>class</code> or the <code>id</code> attribute of the area containing what you want.</p>
<p>Once you've got the id or class, you can write for example one or another of these lines:</p>
<pre><code>body: //div[@class='myclass']
body: //div[@id='myid']</code></pre>
<p>Then, test you file. If you got the right content but you want to strip unnecessary parts, do:</p>
<pre><code>strip: //div[@class='hidden']</code></pre>
<p>You can look at other options for siteconfig files <a href="http://help.fivefilters.org/customer/portal/articles/223153-site-patterns">here</a>.</p>
                </section>

            </div>
        </main>

        <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
        <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
        <script src="http://yandex.st/highlightjs/7.5/highlight.min.js"></script>

        <script>
            $(function() {
                $("section>h1").wrap('<div class="page-header" />');
                // Syntax highlighting
                hljs.initHighlightingOnLoad();
            });
        </script>

    </body>
</html>