forked from macagua/collective.spanishdocumentation
-
Notifications
You must be signed in to change notification settings - Fork 122
/
toplone.cfg
112 lines (98 loc) · 3.5 KB
/
toplone.cfg
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
[buildout]
parts +=
toplone
test
lxml
extends +=
sources.cfg
versions.cfg
#
# Recipe to create toplone command.
#
# It will walk through all blueprints defined
# in pipeline.cfg and override their target parameter
# to be a remote Plone site given on the command line.
# This all happeins in initialization= magic.
#
# Also Python logger is initialized to give us verbose
# output. Some blueprints use logging module for the output.
#
#[toplone]
#recipe = zc.recipe.egg
#eggs =
# transmogrify.htmltesting
# transmogrify.webcrawler
# transmogrify.siteanalyser
# transmogrify.htmlcontentextractor
# transmogrify.pathsorter
# transmogrify.ploneremote
#
## This initialization script sets remote site argument
## for remote blueprints defined in pipeline.cfg
#initialization =
# from urllib import pathname2url as url
# from sys import argv
# import logging, os
#
# logging.basicConfig(level=logging.DEBUG)
# target=len(argv) > 1 and argv[1] or ''
# args = dict(webcrawler=dict(site_url='file://'+os.getcwd()+'/build/html/'),
# localconstructor=dict(output=url('ploneout')),
# ploneuploader=dict(target=target),
# )
#arguments = 'pipeline.cfg', args
#entry-points = toplone=transmogrify.htmltesting.runner:runner
#
# Recipe to create toplone command.
#
# Using the funnelweb blueprint to create a script
# to convert and upload the manual as plone content
# bin/toplone --ploneupload=http://admin:admin@localhost:8080/Plone
# use --template1:debug to get extra detail on fields extracted from pages.
# use --changetype:value="python:item['_type']" if you want to test on plone site without PHC
# see http://plone.org/products/funnelweb
#
[toplone]
recipe = funnelweb
crawler-url=file://${buildout:directory}/build/html
crawler-ignore=
cgi-bin
javascript:
_static
_sources
genindex\.html
search\.html
saesrchindex\.js
# Since content is from disk, no need for local cache
cache-output =
# Fields with '_' won't be uploaded to Plone so will be effectively removed
template1-title = text //div[@class='body']//h1[1]
template1-_permalink = text //div[@class='body']//a[@class='headerlink']
template1-text = html //div[@class='body']
template1-_label = optional //p[contains(@class,'admonition-title')]
template1-description = optional //div[contains(@class,'admonition-description')]/p[@class='last']/text()
template1-_remove_useless_links = optional //div[@id = 'indices-and-tables']
templateauto-condition = python:False
#attachmentguess-condition = python: subitem.get('_type') in ['Image']
#attachmentguess-defaultpage = index
# Images will get titles from backlink text
titleguess-condition = python:True
indexguess-condition = python:True
# Hide the images folder from navigation
hideguess-condition = python:item.get("_path","").startswith('_images') and item.get('_type')=='Folder'
# Upload as PHC instead of Folders and Pages
changetype-value=python:{'Folder':'HelpCenterReferenceManualSection','Document':'HelpCenterLeafPage'}.get(item['_type'],item['_type'])
# Save locally for debugging purposes
# WARNING: not currently working
#localupload-output=${buildout:directory}/ploneout
# All folderish content should be checked if they contain
# any items on the remote site which are not presented locally. including base folder
ploneprune-condition=python:item.get('_type') in ['HelpCenterReferenceManualSection','HelpCenterReferenceManual'] or item['_path'] == ''
[test]
recipe = zc.recipe.testrunner
eggs =
${toplone:eggs}
transmogrify.htmltesting
[lxml]
recipe = z3c.recipe.staticlxml
egg = lxml