gettalong-webgen 0.5.4.20080929

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. data/AUTHORS +5 -0
  2. data/COPYING +10 -0
  3. data/GPL +340 -0
  4. data/Rakefile +324 -0
  5. data/THANKS +17 -0
  6. data/bin/webgen +10 -0
  7. data/data/webgen/resources.yaml +3 -0
  8. data/data/webgen/webgui/controller/main.rb +129 -0
  9. data/data/webgen/webgui/overrides/win32console.rb +0 -0
  10. data/data/webgen/webgui/public/css/jquery.autocomplete.css +50 -0
  11. data/data/webgen/webgui/public/css/ramaze_error.css +90 -0
  12. data/data/webgen/webgui/public/css/style.css +55 -0
  13. data/data/webgen/webgui/public/img/headerbg.jpg +0 -0
  14. data/data/webgen/webgui/public/img/webgen_logo.png +0 -0
  15. data/data/webgen/webgui/public/js/jquery.autocomplete.js +15 -0
  16. data/data/webgen/webgui/public/js/jquery.js +32 -0
  17. data/data/webgen/webgui/view/create_website.xhtml +22 -0
  18. data/data/webgen/webgui/view/error.xhtml +64 -0
  19. data/data/webgen/webgui/view/index.xhtml +22 -0
  20. data/data/webgen/webgui/view/manage_website.xhtml +18 -0
  21. data/data/webgen/webgui/view/page.xhtml +40 -0
  22. data/data/webgen/website_skeleton/README +10 -0
  23. data/data/webgen/website_skeleton/Rakefile +40 -0
  24. data/data/webgen/website_skeleton/config.yaml +17 -0
  25. data/data/webgen/website_skeleton/ext/init.rb +6 -0
  26. data/data/webgen/website_styles/1024px/README +13 -0
  27. data/data/webgen/website_styles/1024px/src/default.css +188 -0
  28. data/data/webgen/website_styles/1024px/src/default.template +60 -0
  29. data/data/webgen/website_styles/1024px/src/images/background.gif +0 -0
  30. data/data/webgen/website_styles/andreas00/README +13 -0
  31. data/data/webgen/website_styles/andreas00/src/default.css +290 -0
  32. data/data/webgen/website_styles/andreas00/src/default.template +60 -0
  33. data/data/webgen/website_styles/andreas00/src/images/bg.gif +0 -0
  34. data/data/webgen/website_styles/andreas00/src/images/front.jpg +0 -0
  35. data/data/webgen/website_styles/andreas00/src/images/menubg.gif +0 -0
  36. data/data/webgen/website_styles/andreas00/src/images/menubg2.gif +0 -0
  37. data/data/webgen/website_styles/andreas01/README +14 -0
  38. data/data/webgen/website_styles/andreas01/src/default.css +310 -0
  39. data/data/webgen/website_styles/andreas01/src/default.template +61 -0
  40. data/data/webgen/website_styles/andreas01/src/images/bg.gif +0 -0
  41. data/data/webgen/website_styles/andreas01/src/images/front.jpg +0 -0
  42. data/data/webgen/website_styles/andreas01/src/print.css +35 -0
  43. data/data/webgen/website_styles/andreas03/README +14 -0
  44. data/data/webgen/website_styles/andreas03/src/default.css +223 -0
  45. data/data/webgen/website_styles/andreas03/src/default.template +58 -0
  46. data/data/webgen/website_styles/andreas03/src/images/bodybg.png +0 -0
  47. data/data/webgen/website_styles/andreas03/src/images/contbg.png +0 -0
  48. data/data/webgen/website_styles/andreas03/src/images/footerbg.png +0 -0
  49. data/data/webgen/website_styles/andreas03/src/images/gradient1.png +0 -0
  50. data/data/webgen/website_styles/andreas03/src/images/gradient2.png +0 -0
  51. data/data/webgen/website_styles/andreas04/README +15 -0
  52. data/data/webgen/website_styles/andreas04/src/default.css +290 -0
  53. data/data/webgen/website_styles/andreas04/src/default.template +81 -0
  54. data/data/webgen/website_styles/andreas04/src/images/blinkarrow.gif +0 -0
  55. data/data/webgen/website_styles/andreas04/src/images/bodybg.png +0 -0
  56. data/data/webgen/website_styles/andreas04/src/images/contentbg.png +0 -0
  57. data/data/webgen/website_styles/andreas04/src/images/entrybg.png +0 -0
  58. data/data/webgen/website_styles/andreas04/src/images/flash.gif +0 -0
  59. data/data/webgen/website_styles/andreas04/src/images/flash2.gif +0 -0
  60. data/data/webgen/website_styles/andreas04/src/images/globe.gif +0 -0
  61. data/data/webgen/website_styles/andreas04/src/images/globebottom.gif +0 -0
  62. data/data/webgen/website_styles/andreas04/src/images/linkarrow.gif +0 -0
  63. data/data/webgen/website_styles/andreas04/src/images/menuhover.png +0 -0
  64. data/data/webgen/website_styles/andreas05/README +14 -0
  65. data/data/webgen/website_styles/andreas05/src/default.css +33 -0
  66. data/data/webgen/website_styles/andreas05/src/default.template +40 -0
  67. data/data/webgen/website_styles/andreas05/src/images/bodybg.gif +0 -0
  68. data/data/webgen/website_styles/andreas05/src/images/front.png +0 -0
  69. data/data/webgen/website_styles/andreas06/README +14 -0
  70. data/data/webgen/website_styles/andreas06/src/default.css +354 -0
  71. data/data/webgen/website_styles/andreas06/src/default.template +70 -0
  72. data/data/webgen/website_styles/andreas06/src/images/bodybg.gif +0 -0
  73. data/data/webgen/website_styles/andreas06/src/images/boxbg.gif +0 -0
  74. data/data/webgen/website_styles/andreas06/src/images/greypx.gif +0 -0
  75. data/data/webgen/website_styles/andreas06/src/images/header.jpg +0 -0
  76. data/data/webgen/website_styles/andreas06/src/images/innerbg.gif +0 -0
  77. data/data/webgen/website_styles/andreas06/src/images/leaves.jpg +0 -0
  78. data/data/webgen/website_styles/andreas06/src/images/tabs.gif +0 -0
  79. data/data/webgen/website_styles/andreas07/README +15 -0
  80. data/data/webgen/website_styles/andreas07/src/browserfix.css +7 -0
  81. data/data/webgen/website_styles/andreas07/src/default.css +92 -0
  82. data/data/webgen/website_styles/andreas07/src/default.template +42 -0
  83. data/data/webgen/website_styles/andreas07/src/images/bodybg.gif +0 -0
  84. data/data/webgen/website_styles/andreas07/src/images/sidebarbg.gif +0 -0
  85. data/data/webgen/website_styles/andreas08/README +14 -0
  86. data/data/webgen/website_styles/andreas08/src/default.css +224 -0
  87. data/data/webgen/website_styles/andreas08/src/default.template +51 -0
  88. data/data/webgen/website_styles/andreas09/README +14 -0
  89. data/data/webgen/website_styles/andreas09/src/default.css +308 -0
  90. data/data/webgen/website_styles/andreas09/src/default.template +68 -0
  91. data/data/webgen/website_styles/andreas09/src/images/bodybg-black.jpg +0 -0
  92. data/data/webgen/website_styles/andreas09/src/images/bodybg-green.jpg +0 -0
  93. data/data/webgen/website_styles/andreas09/src/images/bodybg-orange.jpg +0 -0
  94. data/data/webgen/website_styles/andreas09/src/images/bodybg-purple.jpg +0 -0
  95. data/data/webgen/website_styles/andreas09/src/images/bodybg-red.jpg +0 -0
  96. data/data/webgen/website_styles/andreas09/src/images/bodybg.jpg +0 -0
  97. data/data/webgen/website_styles/andreas09/src/images/footerbg.jpg +0 -0
  98. data/data/webgen/website_styles/andreas09/src/images/menuhover-black.jpg +0 -0
  99. data/data/webgen/website_styles/andreas09/src/images/menuhover-green.jpg +0 -0
  100. data/data/webgen/website_styles/andreas09/src/images/menuhover-orange.jpg +0 -0
  101. data/data/webgen/website_styles/andreas09/src/images/menuhover-purple.jpg +0 -0
  102. data/data/webgen/website_styles/andreas09/src/images/menuhover-red.jpg +0 -0
  103. data/data/webgen/website_styles/andreas09/src/images/menuhover.jpg +0 -0
  104. data/data/webgen/website_styles/simple/README +6 -0
  105. data/data/webgen/website_styles/simple/src/default.css +84 -0
  106. data/data/webgen/website_styles/simple/src/default.template +36 -0
  107. data/data/webgen/website_templates/default/README +6 -0
  108. data/data/webgen/website_templates/default/src/index.page +8 -0
  109. data/data/webgen/website_templates/project/README +5 -0
  110. data/data/webgen/website_templates/project/src/about.page +12 -0
  111. data/data/webgen/website_templates/project/src/download.page +15 -0
  112. data/data/webgen/website_templates/project/src/features.page +8 -0
  113. data/data/webgen/website_templates/project/src/index.page +9 -0
  114. data/data/webgen/website_templates/project/src/screenshots.page +18 -0
  115. data/doc/contentprocessor.template +11 -0
  116. data/doc/contentprocessor/blocks.page +66 -0
  117. data/doc/contentprocessor/builder.page +80 -0
  118. data/doc/contentprocessor/erb.page +56 -0
  119. data/doc/contentprocessor/erubis.page +46 -0
  120. data/doc/contentprocessor/haml.page +47 -0
  121. data/doc/contentprocessor/maruku.page +41 -0
  122. data/doc/contentprocessor/rdiscount.page +37 -0
  123. data/doc/contentprocessor/rdoc.page +36 -0
  124. data/doc/contentprocessor/redcloth.page +39 -0
  125. data/doc/contentprocessor/sass.page +31 -0
  126. data/doc/contentprocessor/tags.page +73 -0
  127. data/doc/extensions.metainfo +29 -0
  128. data/doc/extensions.page +16 -0
  129. data/doc/extensions.template +17 -0
  130. data/doc/faq.page +214 -0
  131. data/doc/getting_started.page +134 -0
  132. data/doc/index.page +65 -0
  133. data/doc/manual.page +532 -0
  134. data/doc/reference_configuration.page +646 -0
  135. data/doc/reference_metainfo.page +213 -0
  136. data/doc/sourcehandler.template +21 -0
  137. data/doc/sourcehandler/copy.page +19 -0
  138. data/doc/sourcehandler/directory.page +27 -0
  139. data/doc/sourcehandler/feed.page +82 -0
  140. data/doc/sourcehandler/metainfo.page +41 -0
  141. data/doc/sourcehandler/page.page +30 -0
  142. data/doc/sourcehandler/sitemap.page +46 -0
  143. data/doc/sourcehandler/template.page +45 -0
  144. data/doc/sourcehandler/virtual.page +49 -0
  145. data/doc/tag.template +25 -0
  146. data/doc/tag/breadcrumbtrail.page +40 -0
  147. data/doc/tag/coderay.page +49 -0
  148. data/doc/tag/date.page +31 -0
  149. data/doc/tag/executecommand.page +26 -0
  150. data/doc/tag/includefile.page +32 -0
  151. data/doc/tag/langbar.page +22 -0
  152. data/doc/tag/menu.page +92 -0
  153. data/doc/tag/metainfo.page +29 -0
  154. data/doc/tag/relocatable.page +38 -0
  155. data/doc/tag/sitemap.page +31 -0
  156. data/doc/upgrading.page +139 -0
  157. data/doc/webgen_page_format.page +128 -0
  158. data/lib/webgen/blackboard.rb +73 -0
  159. data/lib/webgen/cache.rb +85 -0
  160. data/lib/webgen/cli.rb +118 -0
  161. data/lib/webgen/cli/create_command.rb +64 -0
  162. data/lib/webgen/cli/run_command.rb +20 -0
  163. data/lib/webgen/cli/utils.rb +86 -0
  164. data/lib/webgen/cli/webgui_command.rb +49 -0
  165. data/lib/webgen/common.rb +10 -0
  166. data/lib/webgen/common/sitemap.rb +76 -0
  167. data/lib/webgen/configuration.rb +147 -0
  168. data/lib/webgen/contentprocessor.rb +96 -0
  169. data/lib/webgen/contentprocessor/blocks.rb +46 -0
  170. data/lib/webgen/contentprocessor/builder.rb +26 -0
  171. data/lib/webgen/contentprocessor/context.rb +90 -0
  172. data/lib/webgen/contentprocessor/erb.rb +24 -0
  173. data/lib/webgen/contentprocessor/erubis.rb +40 -0
  174. data/lib/webgen/contentprocessor/haml.rb +25 -0
  175. data/lib/webgen/contentprocessor/maruku.rb +18 -0
  176. data/lib/webgen/contentprocessor/rdiscount.rb +15 -0
  177. data/lib/webgen/contentprocessor/rdoc.rb +17 -0
  178. data/lib/webgen/contentprocessor/redcloth.rb +15 -0
  179. data/lib/webgen/contentprocessor/sass.rb +18 -0
  180. data/lib/webgen/contentprocessor/tags.rb +134 -0
  181. data/lib/webgen/coreext.rb +10 -0
  182. data/lib/webgen/default_config.rb +198 -0
  183. data/lib/webgen/languages.rb +578 -0
  184. data/lib/webgen/loggable.rb +23 -0
  185. data/lib/webgen/logger.rb +78 -0
  186. data/lib/webgen/node.rb +347 -0
  187. data/lib/webgen/output.rb +37 -0
  188. data/lib/webgen/output/filesystem.rb +67 -0
  189. data/lib/webgen/page.rb +133 -0
  190. data/lib/webgen/path.rb +182 -0
  191. data/lib/webgen/source.rb +24 -0
  192. data/lib/webgen/source/filesystem.rb +58 -0
  193. data/lib/webgen/source/resource.rb +42 -0
  194. data/lib/webgen/source/stacked.rb +53 -0
  195. data/lib/webgen/sourcehandler.rb +202 -0
  196. data/lib/webgen/sourcehandler/base.rb +211 -0
  197. data/lib/webgen/sourcehandler/copy.rb +41 -0
  198. data/lib/webgen/sourcehandler/directory.rb +31 -0
  199. data/lib/webgen/sourcehandler/feed.rb +121 -0
  200. data/lib/webgen/sourcehandler/fragment.rb +71 -0
  201. data/lib/webgen/sourcehandler/metainfo.rb +117 -0
  202. data/lib/webgen/sourcehandler/page.rb +77 -0
  203. data/lib/webgen/sourcehandler/sitemap.rb +60 -0
  204. data/lib/webgen/sourcehandler/template.rb +68 -0
  205. data/lib/webgen/sourcehandler/virtual.rb +75 -0
  206. data/lib/webgen/tag.rb +23 -0
  207. data/lib/webgen/tag/base.rb +162 -0
  208. data/lib/webgen/tag/breadcrumbtrail.rb +71 -0
  209. data/lib/webgen/tag/coderay.rb +32 -0
  210. data/lib/webgen/tag/date.rb +18 -0
  211. data/lib/webgen/tag/executecommand.rb +29 -0
  212. data/lib/webgen/tag/includefile.rb +42 -0
  213. data/lib/webgen/tag/langbar.rb +52 -0
  214. data/lib/webgen/tag/menu.rb +186 -0
  215. data/lib/webgen/tag/metainfo.rb +25 -0
  216. data/lib/webgen/tag/relocatable.rb +53 -0
  217. data/lib/webgen/tag/sitemap.rb +42 -0
  218. data/lib/webgen/tree.rb +80 -0
  219. data/lib/webgen/version.rb +6 -0
  220. data/lib/webgen/webgentask.rb +148 -0
  221. data/lib/webgen/website.rb +214 -0
  222. data/lib/webgen/websiteaccess.rb +29 -0
  223. data/lib/webgen/websitemanager.rb +125 -0
  224. data/man/man1/webgen.1 +67 -0
  225. data/misc/default.css +360 -0
  226. data/misc/default.template +75 -0
  227. data/misc/htmldoc.metainfo +25 -0
  228. data/misc/htmldoc.virtual +5 -0
  229. data/misc/images/arrow.gif +0 -0
  230. data/misc/images/error.gif +0 -0
  231. data/misc/images/exclamation.gif +0 -0
  232. data/misc/images/headerbg.jpg +0 -0
  233. data/misc/images/information.gif +0 -0
  234. data/misc/images/quote.gif +0 -0
  235. data/setup.rb +1585 -0
  236. data/test/helper.rb +41 -0
  237. data/test/test_blackboard.rb +58 -0
  238. data/test/test_cache.rb +57 -0
  239. data/test/test_common_sitemap.rb +56 -0
  240. data/test/test_configuration.rb +66 -0
  241. data/test/test_contentprocessor.rb +31 -0
  242. data/test/test_contentprocessor_blocks.rb +34 -0
  243. data/test/test_contentprocessor_builder.rb +19 -0
  244. data/test/test_contentprocessor_context.rb +38 -0
  245. data/test/test_contentprocessor_erb.rb +20 -0
  246. data/test/test_contentprocessor_erubis.rb +47 -0
  247. data/test/test_contentprocessor_haml.rb +20 -0
  248. data/test/test_contentprocessor_maruku.rb +27 -0
  249. data/test/test_contentprocessor_rdiscount.rb +15 -0
  250. data/test/test_contentprocessor_rdoc.rb +16 -0
  251. data/test/test_contentprocessor_redcloth.rb +12 -0
  252. data/test/test_contentprocessor_sass.rb +20 -0
  253. data/test/test_contentprocessor_tags.rb +97 -0
  254. data/test/test_languages.rb +53 -0
  255. data/test/test_loggable.rb +30 -0
  256. data/test/test_logger.rb +73 -0
  257. data/test/test_node.rb +339 -0
  258. data/test/test_output_filesystem.rb +58 -0
  259. data/test/test_page.rb +203 -0
  260. data/test/test_path.rb +131 -0
  261. data/test/test_source_filesystem.rb +59 -0
  262. data/test/test_source_resource.rb +26 -0
  263. data/test/test_source_stacked.rb +34 -0
  264. data/test/test_sourcehandler_base.rb +92 -0
  265. data/test/test_sourcehandler_copy.rb +45 -0
  266. data/test/test_sourcehandler_directory.rb +25 -0
  267. data/test/test_sourcehandler_feed.rb +74 -0
  268. data/test/test_sourcehandler_fragment.rb +67 -0
  269. data/test/test_sourcehandler_metainfo.rb +93 -0
  270. data/test/test_sourcehandler_page.rb +70 -0
  271. data/test/test_sourcehandler_sitemap.rb +47 -0
  272. data/test/test_sourcehandler_template.rb +63 -0
  273. data/test/test_sourcehandler_virtual.rb +56 -0
  274. data/test/test_tag_base.rb +82 -0
  275. data/test/test_tag_breadcrumbtrail.rb +89 -0
  276. data/test/test_tag_coderay.rb +30 -0
  277. data/test/test_tag_date.rb +16 -0
  278. data/test/test_tag_executecommand.rb +39 -0
  279. data/test/test_tag_includefile.rb +48 -0
  280. data/test/test_tag_langbar.rb +60 -0
  281. data/test/test_tag_menu.rb +195 -0
  282. data/test/test_tag_metainfo.rb +17 -0
  283. data/test/test_tag_relocatable.rb +57 -0
  284. data/test/test_tag_sitemap.rb +44 -0
  285. data/test/test_tree.rb +69 -0
  286. data/test/test_webgentask.rb +21 -0
  287. data/test/test_website.rb +96 -0
  288. data/test/test_websiteaccess.rb +23 -0
  289. data/test/test_websitemanager.rb +68 -0
  290. metadata +575 -0
@@ -0,0 +1,134 @@
1
+ require 'yaml'
2
+ require 'strscan'
3
+ require 'webgen/tag'
4
+
5
+ module Webgen::ContentProcessor
6
+
7
+ # Processes special webgen tags to provide dynamic content.
8
+ #
9
+ # webgen tags are an easy way to add dynamically generated content to websites, for example menus
10
+ # or breadcrumb trails.
11
+ class Tags
12
+
13
+ include Webgen::WebsiteAccess
14
+ include Webgen::Loggable
15
+
16
+ def initialize #:nodoc:
17
+ @start_re = /(\\*)\{#{website.config['contentprocessor.tags.prefix']}(\w+)(::?)/
18
+ @end_re = /(\\*)\{#{website.config['contentprocessor.tags.prefix']}(\w+)\}/
19
+ end
20
+
21
+ # Replace all webgen tags in the content of +context+ with the rendered content.
22
+ def call(context)
23
+ replace_tags(context.content, context.ref_node) do |tag, param_string, body|
24
+ log(:debug) { "Replacing tag #{tag} with data '#{param_string}' and body '#{body}' in <#{context.ref_node.absolute_lcn}>" }
25
+
26
+ result = ''
27
+ processor = processor_for_tag(tag)
28
+ if !processor.nil?
29
+ processor.set_params(processor.create_tag_params(param_string, context.ref_node))
30
+ result, process_output = processor.call(tag, body, context)
31
+ processor.set_params(nil)
32
+
33
+ result = call(context.clone(:content => result)).content if process_output
34
+ end
35
+
36
+ result
37
+ end
38
+ context
39
+ end
40
+
41
+ #######
42
+ private
43
+ #######
44
+
45
+ BRACKETS_RE = /([{}])/
46
+ ProcessingStruct = Struct.new(:state, :tag, :simple_tag, :backslashes, :brackets, :start_pos, :end_pos,
47
+ :params_start_pos, :params_end_pos, :body_end_pos)
48
+
49
+ # Return the +content+ provided by +node+ with all webgen tags replaced. When a webgen tag is
50
+ # encountered by the parser, the method yields all found information and substitutes the
51
+ # returned string for the tag.
52
+ def replace_tags(content, node) #:yields: tag_name, param_string, body
53
+ scanner = StringScanner.new(content)
54
+ data = ProcessingStruct.new(:before_tag)
55
+ while true
56
+ case data.state
57
+ when :before_tag
58
+ if scanner.skip_until(@start_re)
59
+ data.state = :in_start_tag
60
+ data.backslashes = scanner[1].length
61
+ data.brackets = 1
62
+ data.tag = scanner[2]
63
+ data.simple_tag = (scanner[3] == ':')
64
+ data.params_start_pos = scanner.pos
65
+ data.start_pos = scanner.pos - scanner.matched.length
66
+ else
67
+ data.state = :done
68
+ end
69
+
70
+ when :in_start_tag
71
+ data.brackets += (scanner[1] == '{' ? 1 : -1) while data.brackets != 0 && scanner.skip_until(BRACKETS_RE)
72
+ if data.brackets != 0
73
+ log(:error) { "Unbalanced curly brackets in <#{node.absolute_lcn}>!" }
74
+ data.state = :done
75
+ else
76
+ data.params_end_pos = data.body_end_pos = data.end_pos = scanner.pos - 1
77
+ data.state = (data.simple_tag ? :process : :in_body)
78
+ end
79
+
80
+ when :process
81
+ if data.backslashes % 2 == 0
82
+ result = yield(data.tag, scanner.string[data.params_start_pos...data.params_end_pos],
83
+ scanner.string[(data.params_end_pos+1)...data.body_end_pos]).to_s
84
+ scanner.string[data.start_pos..data.end_pos] = "\\" * (data.backslashes / 2) + result
85
+ scanner.pos = data.start_pos + result.length
86
+ else
87
+ scanner.string[data.start_pos, 1 + data.backslashes / 2] = ''
88
+ scanner.pos -= 1 + data.backslashes / 2
89
+ end
90
+ data.state = :before_tag
91
+
92
+ when :in_body
93
+ while (result = scanner.skip_until(@end_re))
94
+ next unless scanner[2] == data.tag
95
+ if scanner[1].length % 2 == 1
96
+ scanner.string[(scanner.pos - scanner.matched.length), 1 + scanner[1].length / 2] = ''
97
+ scanner.pos -= 1 + scanner[1].length / 2
98
+ else
99
+ break
100
+ end
101
+ end
102
+ if result
103
+ data.state = :process
104
+ data.end_pos = scanner.pos - 1
105
+ data.body_end_pos = scanner.pos - scanner.matched.length + scanner[1].length / 2
106
+ else
107
+ log(:error) { "Invalid body part in <#{node.absolute_lcn}>!" }
108
+ data.state = :done
109
+ end
110
+
111
+ when :done
112
+ break
113
+ end
114
+ end
115
+ scanner.string
116
+ end
117
+
118
+ # Return the tag processor for +tag+ or +nil+ if +tag+ is unknown.
119
+ def processor_for_tag(tag)
120
+ map = website.config['contentprocessor.tags.map']
121
+ klass = if map.has_key?(tag)
122
+ map[tag]
123
+ elsif map.has_key?(:default)
124
+ map[:default]
125
+ else
126
+ log(:error) { "No tag processor for tag #{tag.inspect} found" }
127
+ nil
128
+ end
129
+ klass.nil? ? nil : website.cache.instance(klass)
130
+ end
131
+
132
+ end
133
+
134
+ end
@@ -0,0 +1,10 @@
1
+ # :nodoc:
2
+ class Array
3
+
4
+ def to_hash # :nodoc:
5
+ h = {}
6
+ self.each {|k,v| h[k] = v}
7
+ h
8
+ end
9
+
10
+ end
@@ -0,0 +1,198 @@
1
+ website = Webgen::WebsiteAccess.website
2
+ config = website.config
3
+
4
+ # General configuration parameters
5
+ config.website.cache([:file, 'webgen.cache'], :doc => 'The file name (or String) from/to which the cache is read/written')
6
+ config.website.lang('en', :doc => 'The default language used for the website')
7
+ config.website.link_to_current_page(false, :doc => 'Specifies whether links to the current page should be used')
8
+
9
+ # All things regarding logging
10
+ config.logger.mask(nil, :doc => 'Only show logging events which match the regexp mask')
11
+
12
+
13
+ # All things regarding resources
14
+ config.resources({}, :doc => 'A mapping from resource names to source identifiers')
15
+
16
+ resources = YAML::load(File.read(File.join(Webgen.data_dir, 'resources.yaml')))
17
+ resources.each do |res_path_template, res_name|
18
+ Dir.glob(File.join(Webgen.data_dir, res_path_template), File::FNM_CASEFOLD).each do |res_path|
19
+ substs = Hash.new {|h,k| h[k] = "$" + k }
20
+ substs.merge!({
21
+ 'basename' => File.basename(res_path),
22
+ 'basename_no_ext' => File.basename(res_path, '.*'),
23
+ 'extname' => File.extname(res_path)[1..-1],
24
+ :dirnames => File.dirname(res_path).split(File::SEPARATOR),
25
+ })
26
+ name = res_name.to_s.gsub(/\$\w+/) do |m|
27
+ if m =~ /^\$dir(\d+)$/
28
+ substs[:dirnames][-($1.to_i)]
29
+ else
30
+ substs[m[1..-1]]
31
+ end
32
+ end
33
+ config['resources'][name] = if File.directory?(res_path)
34
+ ["Webgen::Source::FileSystem", res_path]
35
+ else
36
+ ["Webgen::Source::FileSystem", File.dirname(res_path), File.basename(res_path)]
37
+ end
38
+ end
39
+ end
40
+
41
+
42
+ # All things regarding sources
43
+ config.sources [['/', "Webgen::Source::FileSystem", 'src']], :doc => 'One or more sources from which files are read, relative to website directory'
44
+
45
+ # All things regarding source handler
46
+ config.sourcehandler.patterns({
47
+ 'Webgen::SourceHandler::Copy' => ['**/*.css', '**/*.js', '**/*.html', '**/*.gif', '**/*.jpg', '**/*.png'],
48
+ 'Webgen::SourceHandler::Directory' => ['**/'],
49
+ 'Webgen::SourceHandler::Metainfo' => ['**/metainfo', '**/*.metainfo'],
50
+ 'Webgen::SourceHandler::Template' => ['**/*.template'],
51
+ 'Webgen::SourceHandler::Page' => ['**/*.page'],
52
+ 'Webgen::SourceHandler::Virtual' => ['**/virtual', '**/*.virtual'],
53
+ 'Webgen::SourceHandler::Feed' => ['**/*.feed'],
54
+ 'Webgen::SourceHandler::Sitemap' => ['**/*.sitemap']
55
+ }, :doc => 'Source handler to path pattern map')
56
+ config.sourcehandler.invoke({
57
+ 1 => ['Webgen::SourceHandler::Directory', 'Webgen::SourceHandler::Metainfo', 'Webgen::SourceHandler::Directory'],
58
+ 5 => ['Webgen::SourceHandler::Copy', 'Webgen::SourceHandler::Template',
59
+ 'Webgen::SourceHandler::Page', 'Webgen::SourceHandler::Feed',
60
+ 'Webgen::SourceHandler::Sitemap'],
61
+ 9 => ['Webgen::SourceHandler::Virtual']
62
+ }, :doc => 'All source handlers listed here are used by webgen and invoked according to their priority setting')
63
+ config.sourcehandler.casefold(true, :doc => 'Specifies whether path are considered to be case-sensitive')
64
+ config.sourcehandler.use_hidden_files(false, :doc => 'Specifies whether hidden files (those starting with a dot) are used')
65
+ config.sourcehandler.ignore(['**/*~', '**/.svn/**'], :doc => 'Path patterns that should be ignored')
66
+ config.sourcehandler.default_lang_in_output_path(false, :doc => 'Specifies whether output paths in the default language should have the language in the name')
67
+
68
+ config.sourcehandler.default_meta_info({
69
+ :all => {
70
+ 'output_path' => 'standard',
71
+ 'output_path_style' => [:parent, :cnbase, ['.', :lang], :ext]
72
+ },
73
+ 'Webgen::SourceHandler::Copy' => {
74
+ 'kind' => 'asset'
75
+ },
76
+ 'Webgen::SourceHandler::Directory' => {
77
+ 'index_path' => 'index.html',
78
+ 'kind' => 'directory'
79
+ },
80
+ 'Webgen::SourceHandler::Page' => {
81
+ 'kind' => 'page',
82
+ 'fragments_in_menu' => true,
83
+ 'blocks' => {'default' => {'pipeline' => 'erb,tags,maruku,blocks'}}
84
+ },
85
+ 'Webgen::SourceHandler::Fragment' => {
86
+ 'kind' => 'fragment'
87
+ },
88
+ 'Webgen::SourceHandler::Template' => {
89
+ 'blocks' => {'default' => {'pipeline' => 'erb,tags,blocks'}}
90
+ },
91
+ 'Webgen::SourceHandler::Metainfo' => {
92
+ 'blocks' => {1 => {'name' => 'paths'}, 2 => {'name' => 'alcn'}}
93
+ },
94
+ 'Webgen::SourceHandler::Feed' => {
95
+ 'rss' => true,
96
+ 'atom' => true
97
+ },
98
+ 'Webgen::SourceHandler::Sitemap' => {
99
+ 'default_priority' => 0.5,
100
+ 'default_change_freq' => 'weekly',
101
+ 'common.sitemap.any_lang' => true
102
+ }
103
+ }, :doc => "Default meta information for all nodes and for nodes belonging to a specific source handler")
104
+
105
+ config.sourcehandler.template.default_template('default.template', :doc => 'The name of the default template file of a directory')
106
+
107
+ website.autoload_service(:templates_for_node, 'Webgen::SourceHandler::Template')
108
+
109
+ website.autoload_service(:create_fragment_nodes, 'Webgen::SourceHandler::Fragment')
110
+ website.autoload_service(:parse_html_headers, 'Webgen::SourceHandler::Fragment')
111
+
112
+
113
+ # All things regarding output
114
+ config.output ["Webgen::Output::FileSystem", 'out'], :doc => 'The class which is used to output the generated paths.'
115
+
116
+ Webgen::WebsiteAccess.website.blackboard.add_service(:output_instance, Webgen::Output.method(:instance))
117
+
118
+
119
+ # All things regarding content processors
120
+ config.contentprocessor.map({
121
+ 'markdown' => 'Webgen::ContentProcessor::Maruku',
122
+ 'maruku' => 'Webgen::ContentProcessor::Maruku',
123
+ 'textile' => 'Webgen::ContentProcessor::RedCloth',
124
+ 'redcloth' => 'Webgen::ContentProcessor::RedCloth',
125
+ 'tags' => 'Webgen::ContentProcessor::Tags',
126
+ 'blocks' => 'Webgen::ContentProcessor::Blocks',
127
+ 'erb' => 'Webgen::ContentProcessor::Erb',
128
+ 'haml' => 'Webgen::ContentProcessor::Haml',
129
+ 'sass' => 'Webgen::ContentProcessor::Sass',
130
+ 'rdoc' => 'Webgen::ContentProcessor::RDoc',
131
+ 'builder' => 'Webgen::ContentProcessor::Builder',
132
+ 'erubis' => 'Webgen::ContentProcessor::Erubis',
133
+ 'rdiscount' => 'Webgen::ContentProcessor::RDiscount',
134
+ }, :doc => 'Content processor name to class map')
135
+
136
+ Webgen::WebsiteAccess.website.blackboard.add_service(:content_processor_names, Webgen::ContentProcessor.method(:list))
137
+ Webgen::WebsiteAccess.website.blackboard.add_service(:content_processor, Webgen::ContentProcessor.method(:for_name))
138
+
139
+ # All things regarding tags
140
+ config.contentprocessor.tags.prefix('', :doc => 'The prefix used for tag names to avoid name clashes when another content processor uses similar markup.')
141
+ config.contentprocessor.tags.map({
142
+ 'relocatable' => 'Webgen::Tag::Relocatable',
143
+ 'menu' => 'Webgen::Tag::Menu',
144
+ 'breadcrumb_trail' => 'Webgen::Tag::BreadcrumbTrail',
145
+ 'langbar' => 'Webgen::Tag::Langbar',
146
+ 'include_file' => 'Webgen::Tag::IncludeFile',
147
+ 'execute_cmd' => 'Webgen::Tag::ExecuteCommand',
148
+ 'coderay' => 'Webgen::Tag::Coderay',
149
+ 'date' => 'Webgen::Tag::Date',
150
+ 'sitemap' => 'Webgen::Tag::Sitemap',
151
+ :default => 'Webgen::Tag::Metainfo'
152
+ }, :doc => 'Tag processor name to class map')
153
+
154
+ config.contentprocessor.erubis.use_pi(false, :doc => 'Specify whether processing instructions should be used')
155
+ config.contentprocessor.erubis.options({}, :doc => 'A hash of additional options')
156
+
157
+ config.tag.relocatable.path(nil, :doc => 'The path which should be made relocatable', :mandatory => 'default')
158
+
159
+ config.tag.menu.start_level(1, :doc => 'The level at which the menu starts.')
160
+ config.tag.menu.min_levels(1, :doc => 'The minimum number of menu levels that should always be shown.')
161
+ config.tag.menu.max_levels(3, :doc => 'The maximum number of menu levels that should be shown.')
162
+ config.tag.menu.show_current_subtree_only(true, :doc => 'Specifies whether only the current subtree should be shown.')
163
+ config.tag.menu.used_nodes('all', :doc => 'Specifies the kind of nodes that should be used: all, files, or fragments')
164
+
165
+ config.tag.breadcrumbtrail.separator(' / ', :doc => 'Separates the hierachy entries from each other.')
166
+ config.tag.breadcrumbtrail.omit_index_path(false, :doc => 'Omits the last path component if it is an index path.')
167
+ config.tag.breadcrumbtrail.start_level(0, :doc => 'The level at which the breadcrumb trail starts.')
168
+ config.tag.breadcrumbtrail.end_level(-1, :doc => 'The level at which the breadcrumb trail ends.')
169
+
170
+ config.tag.langbar.separator(' | ', :doc => 'Separates the languages from each other.')
171
+ config.tag.langbar.show_single_lang(true, :doc => 'Should the link be shown although the page is only available in one language?')
172
+ config.tag.langbar.show_own_lang(true, :doc => 'Should the link to the currently displayed language page be shown?')
173
+
174
+ config.tag.includefile.filename(nil, :doc => 'The name of the file which should be included (relative to the website).', :mandatory => 'default')
175
+ config.tag.includefile.process_output(true, :doc => 'The file content will be scanned for tags if true.')
176
+ config.tag.includefile.escape_html(true, :doc => 'Special HTML characters in the file content will be escaped if true.')
177
+
178
+ config.tag.executecommand.command(nil, :doc => 'The command which should be executed', :mandatory => 'default')
179
+ config.tag.executecommand.process_output(true, :doc => 'The output of the command will be scanned for tags if true')
180
+ config.tag.executecommand.escape_html(true, :doc => 'Special HTML characters in the output will be escaped if true')
181
+
182
+ config.tag.coderay.lang('ruby', :doc => 'The highlighting language', :mandatory => 'default')
183
+ config.tag.coderay.process_body(true, :doc => 'The tag body will be scanned for tags first if true')
184
+ config.tag.coderay.wrap(:div, :doc => 'Specifies how the code should be wrapped, either :div or :span')
185
+ config.tag.coderay.line_numbers(true, :doc => 'Show line numbers')
186
+ config.tag.coderay.line_number_start(1, :doc => 'Line number of first line')
187
+ config.tag.coderay.bold_every(10, :doc => 'The interval at which the line number appears bold')
188
+ config.tag.coderay.tab_width(8, :doc => 'Number of spaces used for a tabulator')
189
+
190
+ config.tag.date.format('%Y-%m-%d %H:%M:%S', :doc => 'The format of the date (same options as Ruby\'s Time#strftime)')
191
+
192
+
193
+ # All things regarding common functionality
194
+ website.autoload_service(:create_sitemap, 'Webgen::Common::Sitemap')
195
+
196
+ config.common.sitemap.honor_in_menu(false, :doc => 'Only include pages that are also in the menu if true')
197
+ config.common.sitemap.any_lang(false, :doc => 'Use nodes in any language if true')
198
+ config.common.sitemap.used_kinds(['page'], :doc => 'Array of node kinds that is used for the sitemap')
@@ -0,0 +1,578 @@
1
+ module Webgen
2
+
3
+ # Describes a human language which is uniquely identfied by a three letter code and, optionally,
4
+ # by an alternative three letter or a two letter code.
5
+ class Language
6
+
7
+ include Comparable
8
+
9
+ # An array containing the language codes for the language.
10
+ attr_reader :codes
11
+
12
+ # The english description of the language.
13
+ attr_reader :description
14
+
15
+ # Create a new language. +codes+ has to be an array containing three strings: the three letter
16
+ # code, the alternative three letter code and the two letter code. If one is not available for
17
+ # the language, it has to be +nil+.
18
+ def initialize(codes, description)
19
+ @codes = codes
20
+ @description = description
21
+ end
22
+
23
+ # The two letter code.
24
+ def code2chars
25
+ @codes[2]
26
+ end
27
+
28
+ # The three letter code.
29
+ def code3chars
30
+ @codes[0]
31
+ end
32
+
33
+ # The alternative three letter code.
34
+ def code3chars_alternative
35
+ @codes[1]
36
+ end
37
+
38
+ # The textual representation of the language.
39
+ def to_s
40
+ code2chars || code3chars
41
+ end
42
+
43
+ alias_method :to_str, :to_s
44
+
45
+ def inspect #:nodoc:
46
+ "#<Language codes=#{codes.inspect} description=#{description.inspect}>"
47
+ end
48
+
49
+ def <=>(other) #:nodoc:
50
+ self.to_s <=> other.to_s
51
+ end
52
+
53
+ end
54
+
55
+
56
+ # Used for managing human languages.
57
+ module LanguageManager
58
+
59
+ # Return a +Language+ object for the given language code or +nil+ if no such object exists.
60
+ def self.language_for_code(code)
61
+ languages[code]
62
+ end
63
+
64
+ # Return an array of +Language+ objects whose description match the given +text+.
65
+ def self.find_language(text)
66
+ languages.values.find_all {|lang| /.*#{Regexp.escape(text)}.*/i =~ lang.description}.uniq.sort
67
+ end
68
+
69
+ # Return all available languages as a Hash. The keys are the language codes and the values are
70
+ # the +Language+ objects for them.
71
+ def self.languages
72
+ unless defined?(@@languages)
73
+ @@languages = {}
74
+ started = nil
75
+ data = File.readlines(__FILE__).each do |l|
76
+ next if !started && (started = (l == '__END__'))
77
+ data = l.chomp.split('|').collect {|f| f.empty? ? nil : f}
78
+ lang = Language.new(data[0..2], data[3])
79
+ @@languages[lang.code2chars] ||= lang unless lang.code2chars.nil?
80
+ @@languages[lang.code3chars] ||= lang unless lang.code3chars.nil?
81
+ @@languages[lang.code3chars_alternative] ||= lang unless lang.code3chars_alternative.nil?
82
+ end
83
+ @@languages.freeze
84
+ end
85
+ @@languages
86
+ end
87
+
88
+ end
89
+
90
+ end
91
+
92
+ __END__
93
+ aar||aa|Afar|afar
94
+ abk||ab|Abkhazian|abkhaze
95
+ ace|||Achinese|aceh
96
+ ach|||Acoli|acoli
97
+ ada|||Adangme|adangme
98
+ ady|||Adyghe; Adygei|adyghé
99
+ afa|||Afro-Asiatic (Other)|afro-asiatiques, autres langues
100
+ afh|||Afrihili|afrihili
101
+ afr||af|Afrikaans|afrikaans
102
+ ain|||Ainu|aïnou
103
+ aka||ak|Akan|akan
104
+ akk|||Akkadian|akkadien
105
+ alb|sqi|sq|Albanian|albanais
106
+ ale|||Aleut|aléoute
107
+ alg|||Algonquian languages|algonquines, langues
108
+ alt|||Southern Altai|altai du Sud
109
+ amh||am|Amharic|amharique
110
+ ang|||English, Old (ca.450-1100)|anglo-saxon (ca.450-1100)
111
+ anp|||Angika|angika
112
+ apa|||Apache languages|apache
113
+ ara||ar|Arabic|arabe
114
+ arc|||Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)|araméen d'empire (700-300 BCE)
115
+ arg||an|Aragonese|aragonais
116
+ arm|hye|hy|Armenian|arménien
117
+ arn|||Mapudungun; Mapuche|mapudungun; mapuche; mapuce
118
+ arp|||Arapaho|arapaho
119
+ art|||Artificial (Other)|artificielles, autres langues
120
+ arw|||Arawak|arawak
121
+ asm||as|Assamese|assamais
122
+ ast|||Asturian; Bable; Leonese; Asturleonese|asturien; bable; léonais; asturoléonais
123
+ ath|||Athapascan languages|athapascanes, langues
124
+ aus|||Australian languages|australiennes, langues
125
+ ava||av|Avaric|avar
126
+ ave||ae|Avestan|avestique
127
+ awa|||Awadhi|awadhi
128
+ aym||ay|Aymara|aymara
129
+ aze||az|Azerbaijani|azéri
130
+ bad|||Banda languages|banda, langues
131
+ bai|||Bamileke languages|bamilékés, langues
132
+ bak||ba|Bashkir|bachkir
133
+ bal|||Baluchi|baloutchi
134
+ bam||bm|Bambara|bambara
135
+ ban|||Balinese|balinais
136
+ baq|eus|eu|Basque|basque
137
+ bas|||Basa|basa
138
+ bat|||Baltic (Other)|baltiques, autres langues
139
+ bej|||Beja; Bedawiyet|bedja
140
+ bel||be|Belarusian|biélorusse
141
+ bem|||Bemba|bemba
142
+ ben||bn|Bengali|bengali
143
+ ber|||Berber (Other)|berbères, autres langues
144
+ bho|||Bhojpuri|bhojpuri
145
+ bih||bh|Bihari|bihari
146
+ bik|||Bikol|bikol
147
+ bin|||Bini; Edo|bini; edo
148
+ bis||bi|Bislama|bichlamar
149
+ bla|||Siksika|blackfoot
150
+ bnt|||Bantu (Other)|bantoues, autres langues
151
+ bos||bs|Bosnian|bosniaque
152
+ bra|||Braj|braj
153
+ bre||br|Breton|breton
154
+ btk|||Batak languages|batak, langues
155
+ bua|||Buriat|bouriate
156
+ bug|||Buginese|bugi
157
+ bul||bg|Bulgarian|bulgare
158
+ bur|mya|my|Burmese|birman
159
+ byn|||Blin; Bilin|blin; bilen
160
+ cad|||Caddo|caddo
161
+ cai|||Central American Indian (Other)|indiennes d'Amérique centrale, autres langues
162
+ car|||Galibi Carib|karib; galibi; carib
163
+ cat||ca|Catalan; Valencian|catalan; valencien
164
+ cau|||Caucasian (Other)|caucasiennes, autres langues
165
+ ceb|||Cebuano|cebuano
166
+ cel|||Celtic (Other)|celtiques, autres langues
167
+ cha||ch|Chamorro|chamorro
168
+ chb|||Chibcha|chibcha
169
+ che||ce|Chechen|tchétchène
170
+ chg|||Chagatai|djaghataï
171
+ chi|zho|zh|Chinese|chinois
172
+ chk|||Chuukese|chuuk
173
+ chm|||Mari|mari
174
+ chn|||Chinook jargon|chinook, jargon
175
+ cho|||Choctaw|choctaw
176
+ chp|||Chipewyan; Dene Suline|chipewyan
177
+ chr|||Cherokee|cherokee
178
+ chu||cu|Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic|slavon d'église; vieux slave; slavon liturgique; vieux bulgare
179
+ chv||cv|Chuvash|tchouvache
180
+ chy|||Cheyenne|cheyenne
181
+ cmc|||Chamic languages|chames, langues
182
+ cop|||Coptic|copte
183
+ cor||kw|Cornish|cornique
184
+ cos||co|Corsican|corse
185
+ cpe|||Creoles and pidgins, English based (Other)|créoles et pidgins anglais, autres
186
+ cpf|||Creoles and pidgins, French-based (Other)|créoles et pidgins français, autres
187
+ cpp|||Creoles and pidgins, Portuguese-based (Other)|créoles et pidgins portugais, autres
188
+ cre||cr|Cree|cree
189
+ crh|||Crimean Tatar; Crimean Turkish|tatar de Crimé
190
+ crp|||Creoles and pidgins (Other)|créoles et pidgins divers
191
+ csb|||Kashubian|kachoube
192
+ cus|||Cushitic (Other)|couchitiques, autres langues
193
+ cze|ces|cs|Czech|tchèque
194
+ dak|||Dakota|dakota
195
+ dan||da|Danish|danois
196
+ dar|||Dargwa|dargwa
197
+ day|||Land Dayak languages|dayak, langues
198
+ del|||Delaware|delaware
199
+ den|||Slave (Athapascan)|esclave (athapascan)
200
+ dgr|||Dogrib|dogrib
201
+ din|||Dinka|dinka
202
+ div||dv|Divehi; Dhivehi; Maldivian|maldivien
203
+ doi|||Dogri|dogri
204
+ dra|||Dravidian (Other)|dravidiennes, autres langues
205
+ dsb|||Lower Sorbian|bas-sorabe
206
+ dua|||Duala|douala
207
+ dum|||Dutch, Middle (ca.1050-1350)|néerlandais moyen (ca. 1050-1350)
208
+ dut|nld|nl|Dutch; Flemish|néerlandais; flamand
209
+ dyu|||Dyula|dioula
210
+ dzo||dz|Dzongkha|dzongkha
211
+ efi|||Efik|efik
212
+ egy|||Egyptian (Ancient)|égyptien
213
+ eka|||Ekajuk|ekajuk
214
+ elx|||Elamite|élamite
215
+ eng||en|English|anglais
216
+ enm|||English, Middle (1100-1500)|anglais moyen (1100-1500)
217
+ epo||eo|Esperanto|espéranto
218
+ est||et|Estonian|estonien
219
+ ewe||ee|Ewe|éwé
220
+ ewo|||Ewondo|éwondo
221
+ fan|||Fang|fang
222
+ fao||fo|Faroese|féroïen
223
+ fat|||Fanti|fanti
224
+ fij||fj|Fijian|fidjien
225
+ fil|||Filipino; Pilipino|filipino; pilipino
226
+ fin||fi|Finnish|finnois
227
+ fiu|||Finno-Ugrian (Other)|finno-ougriennes, autres langues
228
+ fon|||Fon|fon
229
+ fre|fra|fr|French|français
230
+ frm|||French, Middle (ca.1400-1600)|français moyen (1400-1600)
231
+ fro|||French, Old (842-ca.1400)|français ancien (842-ca.1400)
232
+ frr|||Northern Frisian|frison septentrional
233
+ frs|||Eastern Frisian|frison oriental
234
+ fry||fy|Western Frisian|frison occidental
235
+ ful||ff|Fulah|peul
236
+ fur|||Friulian|frioulan
237
+ gaa|||Ga|ga
238
+ gay|||Gayo|gayo
239
+ gba|||Gbaya|gbaya
240
+ gem|||Germanic (Other)|germaniques, autres langues
241
+ geo|kat|ka|Georgian|géorgien
242
+ ger|deu|de|German|allemand
243
+ gez|||Geez|guèze
244
+ gil|||Gilbertese|kiribati
245
+ gla||gd|Gaelic; Scottish Gaelic|gaélique; gaélique écossais
246
+ gle||ga|Irish|irlandais
247
+ glg||gl|Galician|galicien
248
+ glv||gv|Manx|manx; mannois
249
+ gmh|||German, Middle High (ca.1050-1500)|allemand, moyen haut (ca. 1050-1500)
250
+ goh|||German, Old High (ca.750-1050)|allemand, vieux haut (ca. 750-1050)
251
+ gon|||Gondi|gond
252
+ gor|||Gorontalo|gorontalo
253
+ got|||Gothic|gothique
254
+ grb|||Grebo|grebo
255
+ grc|||Greek, Ancient (to 1453)|grec ancien (jusqu'à 1453)
256
+ gre|ell|el|Greek, Modern (1453-)|grec moderne (après 1453)
257
+ grn||gn|Guarani|guarani
258
+ gsw|||Swiss German; Alemannic; Alsatian|suisse alémanique; alémanique; alsacien
259
+ guj||gu|Gujarati|goudjrati
260
+ gwi|||Gwich'in|gwich'in
261
+ hai|||Haida|haida
262
+ hat||ht|Haitian; Haitian Creole|haïtien; créole haïtien
263
+ hau||ha|Hausa|haoussa
264
+ haw|||Hawaiian|hawaïen
265
+ heb||he|Hebrew|hébreu
266
+ her||hz|Herero|herero
267
+ hil|||Hiligaynon|hiligaynon
268
+ him|||Himachali|himachali
269
+ hin||hi|Hindi|hindi
270
+ hit|||Hittite|hittite
271
+ hmn|||Hmong|hmong
272
+ hmo||ho|Hiri Motu|hiri motu
273
+ hsb|||Upper Sorbian|haut-sorabe
274
+ hun||hu|Hungarian|hongrois
275
+ hup|||Hupa|hupa
276
+ iba|||Iban|iban
277
+ ibo||ig|Igbo|igbo
278
+ ice|isl|is|Icelandic|islandais
279
+ ido||io|Ido|ido
280
+ iii||ii|Sichuan Yi; Nuosu|yi de Sichuan
281
+ ijo|||Ijo languages|ijo, langues
282
+ iku||iu|Inuktitut|inuktitut
283
+ ile||ie|Interlingue; Occidental|interlingue
284
+ ilo|||Iloko|ilocano
285
+ ina||ia|Interlingua (International Auxiliary Language Association)|interlingua (langue auxiliaire internationale)
286
+ inc|||Indic (Other)|indo-aryennes, autres langues
287
+ ind||id|Indonesian|indonésien
288
+ ine|||Indo-European (Other)|indo-européennes, autres langues
289
+ inh|||Ingush|ingouche
290
+ ipk||ik|Inupiaq|inupiaq
291
+ ira|||Iranian (Other)|iraniennes, autres langues
292
+ iro|||Iroquoian languages|iroquoises, langues (famille)
293
+ ita||it|Italian|italien
294
+ jav||jv|Javanese|javanais
295
+ jbo|||Lojban|lojban
296
+ jpn||ja|Japanese|japonais
297
+ jpr|||Judeo-Persian|judéo-persan
298
+ jrb|||Judeo-Arabic|judéo-arabe
299
+ kaa|||Kara-Kalpak|karakalpak
300
+ kab|||Kabyle|kabyle
301
+ kac|||Kachin; Jingpho|kachin; jingpho
302
+ kal||kl|Kalaallisut; Greenlandic|groenlandais
303
+ kam|||Kamba|kamba
304
+ kan||kn|Kannada|kannada
305
+ kar|||Karen languages|karen, langues
306
+ kas||ks|Kashmiri|kashmiri
307
+ kau||kr|Kanuri|kanouri
308
+ kaw|||Kawi|kawi
309
+ kaz||kk|Kazakh|kazakh
310
+ kbd|||Kabardian|kabardien
311
+ kha|||Khasi|khasi
312
+ khi|||Khoisan (Other)|khoisan, autres langues
313
+ khm||km|Central Khmer|khmer central
314
+ kho|||Khotanese|khotanais
315
+ kik||ki|Kikuyu; Gikuyu|kikuyu
316
+ kin||rw|Kinyarwanda|rwanda
317
+ kir||ky|Kirghiz; Kyrgyz|kirghiz
318
+ kmb|||Kimbundu|kimbundu
319
+ kok|||Konkani|konkani
320
+ kom||kv|Komi|kom
321
+ kon||kg|Kongo|kongo
322
+ kor||ko|Korean|coréen
323
+ kos|||Kosraean|kosrae
324
+ kpe|||Kpelle|kpellé
325
+ krc|||Karachay-Balkar|karatchai balkar
326
+ krl|||Karelian|carélien
327
+ kro|||Kru languages|krou, langues
328
+ kru|||Kurukh|kurukh
329
+ kua||kj|Kuanyama; Kwanyama|kuanyama; kwanyama
330
+ kum|||Kumyk|koumyk
331
+ kur||ku|Kurdish|kurde
332
+ kut|||Kutenai|kutenai
333
+ lad|||Ladino|judéo-espagnol
334
+ lah|||Lahnda|lahnda
335
+ lam|||Lamba|lamba
336
+ lao||lo|Lao|lao
337
+ lat||la|Latin|latin
338
+ lav||lv|Latvian|letton
339
+ lez|||Lezghian|lezghien
340
+ lim||li|Limburgan; Limburger; Limburgish|limbourgeois
341
+ lin||ln|Lingala|lingala
342
+ lit||lt|Lithuanian|lituanien
343
+ lol|||Mongo|mongo
344
+ loz|||Lozi|lozi
345
+ ltz||lb|Luxembourgish; Letzeburgesch|luxembourgeois
346
+ lua|||Luba-Lulua|luba-lulua
347
+ lub||lu|Luba-Katanga|luba-katanga
348
+ lug||lg|Ganda|ganda
349
+ lui|||Luiseno|luiseno
350
+ lun|||Lunda|lunda
351
+ luo|||Luo (Kenya and Tanzania)|luo (Kenya et Tanzanie)
352
+ lus|||Lushai|lushai
353
+ mac|mkd|mk|Macedonian|macédonien
354
+ mad|||Madurese|madourais
355
+ mag|||Magahi|magahi
356
+ mah||mh|Marshallese|marshall
357
+ mai|||Maithili|maithili
358
+ mak|||Makasar|makassar
359
+ mal||ml|Malayalam|malayalam
360
+ man|||Mandingo|mandingue
361
+ mao|mri|mi|Maori|maori
362
+ map|||Austronesian (Other)|malayo-polynésiennes, autres langues
363
+ mar||mr|Marathi|marathe
364
+ mas|||Masai|massaï
365
+ may|msa|ms|Malay|malais
366
+ mdf|||Moksha|moksa
367
+ mdr|||Mandar|mandar
368
+ men|||Mende|mendé
369
+ mga|||Irish, Middle (900-1200)|irlandais moyen (900-1200)
370
+ mic|||Mi'kmaq; Micmac|mi'kmaq; micmac
371
+ min|||Minangkabau|minangkabau
372
+ mis|||Uncoded languages|langues non codées
373
+ mkh|||Mon-Khmer (Other)|môn-khmer, autres langues
374
+ mlg||mg|Malagasy|malgache
375
+ mlt||mt|Maltese|maltais
376
+ mnc|||Manchu|mandchou
377
+ mni|||Manipuri|manipuri
378
+ mno|||Manobo languages|manobo, langues
379
+ moh|||Mohawk|mohawk
380
+ mol||mo|Moldavian|moldave
381
+ mon||mn|Mongolian|mongol
382
+ mos|||Mossi|moré
383
+ mul|||Multiple languages|multilingue
384
+ mun|||Munda languages|mounda, langues
385
+ mus|||Creek|muskogee
386
+ mwl|||Mirandese|mirandais
387
+ mwr|||Marwari|marvari
388
+ myn|||Mayan languages|maya, langues
389
+ myv|||Erzya|erza
390
+ nah|||Nahuatl languages|nahuatl, langues
391
+ nai|||North American Indian|indiennes d'Amérique du Nord, autres langues
392
+ nap|||Neapolitan|napolitain
393
+ nau||na|Nauru|nauruan
394
+ nav||nv|Navajo; Navaho|navaho
395
+ nbl||nr|Ndebele, South; South Ndebele|ndébélé du Sud
396
+ nde||nd|Ndebele, North; North Ndebele|ndébélé du Nord
397
+ ndo||ng|Ndonga|ndonga
398
+ nds|||Low German; Low Saxon; German, Low; Saxon, Low|bas allemand; bas saxon; allemand, bas; saxon, bas
399
+ nep||ne|Nepali|népalais
400
+ new|||Nepal Bhasa; Newari|nepal bhasa; newari
401
+ nia|||Nias|nias
402
+ nic|||Niger-Kordofanian (Other)|nigéro-congolaises, autres langues
403
+ niu|||Niuean|niué
404
+ nno||nn|Norwegian Nynorsk; Nynorsk, Norwegian|norvégien nynorsk; nynorsk, norvégien
405
+ nob||nb|Bokmål, Norwegian; Norwegian Bokmål|norvégien bokmål
406
+ nog|||Nogai|nogaï; nogay
407
+ non|||Norse, Old|norrois, vieux
408
+ nor||no|Norwegian|norvégien
409
+ nqo|||N'Ko|n'ko
410
+ nso|||Pedi; Sepedi; Northern Sotho|pedi; sepedi; sotho du Nord
411
+ nub|||Nubian languages|nubiennes, langues
412
+ nwc|||Classical Newari; Old Newari; Classical Nepal Bhasa|newari classique
413
+ nya||ny|Chichewa; Chewa; Nyanja|chichewa; chewa; nyanja
414
+ nym|||Nyamwezi|nyamwezi
415
+ nyn|||Nyankole|nyankolé
416
+ nyo|||Nyoro|nyoro
417
+ nzi|||Nzima|nzema
418
+ oci||oc|Occitan (post 1500); Provençal|occitan (après 1500); provençal
419
+ oji||oj|Ojibwa|ojibwa
420
+ ori||or|Oriya|oriya
421
+ orm||om|Oromo|galla
422
+ osa|||Osage|osage
423
+ oss||os|Ossetian; Ossetic|ossète
424
+ ota|||Turkish, Ottoman (1500-1928)|turc ottoman (1500-1928)
425
+ oto|||Otomian languages|otomangue, langues
426
+ paa|||Papuan (Other)|papoues, autres langues
427
+ pag|||Pangasinan|pangasinan
428
+ pal|||Pahlavi|pahlavi
429
+ pam|||Pampanga; Kapampangan|pampangan
430
+ pan||pa|Panjabi; Punjabi|pendjabi
431
+ pap|||Papiamento|papiamento
432
+ pau|||Palauan|palau
433
+ peo|||Persian, Old (ca.600-400 B.C.)|perse, vieux (ca. 600-400 av. J.-C.)
434
+ per|fas|fa|Persian|persan
435
+ phi|||Philippine (Other)|philippines, autres langues
436
+ phn|||Phoenician|phénicien
437
+ pli||pi|Pali|pali
438
+ pol||pl|Polish|polonais
439
+ pon|||Pohnpeian|pohnpei
440
+ por||pt|Portuguese|portugais
441
+ pra|||Prakrit languages|prâkrit
442
+ pro|||Provençal, Old (to 1500)|provençal ancien (jusqu'à 1500)
443
+ pus||ps|Pushto; Pashto|pachto
444
+ qaa-qtz|||Reserved for local use|réservée à l'usage local
445
+ que||qu|Quechua|quechua
446
+ raj|||Rajasthani|rajasthani
447
+ rap|||Rapanui|rapanui
448
+ rar|||Rarotongan; Cook Islands Maori|rarotonga; maori des îles Cook
449
+ roa|||Romance (Other)|romanes, autres langues
450
+ roh||rm|Romansh|romanche
451
+ rom|||Romany|tsigane
452
+ rum|ron|ro|Romanian|roumain
453
+ run||rn|Rundi|rundi
454
+ rup|||Aromanian; Arumanian; Macedo-Romanian|aroumain; macédo-roumain
455
+ rus||ru|Russian|russe
456
+ sad|||Sandawe|sandawe
457
+ sag||sg|Sango|sango
458
+ sah|||Yakut|iakoute
459
+ sai|||South American Indian (Other)|indiennes d'Amérique du Sud, autres langues
460
+ sal|||Salishan languages|salish, langues
461
+ sam|||Samaritan Aramaic|samaritain
462
+ san||sa|Sanskrit|sanskrit
463
+ sas|||Sasak|sasak
464
+ sat|||Santali|santal
465
+ scc|srp|sr|Serbian|serbe
466
+ scn|||Sicilian|sicilien
467
+ sco|||Scots|écossais
468
+ scr|hrv|hr|Croatian|croate
469
+ sel|||Selkup|selkoupe
470
+ sem|||Semitic (Other)|sémitiques, autres langues
471
+ sga|||Irish, Old (to 900)|irlandais ancien (jusqu'à 900)
472
+ sgn|||Sign Languages|langues des signes
473
+ shn|||Shan|chan
474
+ sid|||Sidamo|sidamo
475
+ sin||si|Sinhala; Sinhalese|singhalais
476
+ sio|||Siouan languages|sioux, langues
477
+ sit|||Sino-Tibetan (Other)|sino-tibétaines, autres langues
478
+ sla|||Slavic (Other)|slaves, autres langues
479
+ slo|slk|sk|Slovak|slovaque
480
+ slv||sl|Slovenian|slovène
481
+ sma|||Southern Sami|sami du Sud
482
+ sme||se|Northern Sami|sami du Nord
483
+ smi|||Sami languages (Other)|sami, autres langues
484
+ smj|||Lule Sami|sami de Lule
485
+ smn|||Inari Sami|sami d'Inari
486
+ smo||sm|Samoan|samoan
487
+ sms|||Skolt Sami|sami skolt
488
+ sna||sn|Shona|shona
489
+ snd||sd|Sindhi|sindhi
490
+ snk|||Soninke|soninké
491
+ sog|||Sogdian|sogdien
492
+ som||so|Somali|somali
493
+ son|||Songhai languages|songhai, langues
494
+ sot||st|Sotho, Southern|sotho du Sud
495
+ spa||es|Spanish; Castilian|espagnol; castillan
496
+ srd||sc|Sardinian|sarde
497
+ srn|||Sranan Tongo|sranan tongo
498
+ srr|||Serer|sérère
499
+ ssa|||Nilo-Saharan (Other)|nilo-sahariennes, autres langues
500
+ ssw||ss|Swati|swati
501
+ suk|||Sukuma|sukuma
502
+ sun||su|Sundanese|soundanais
503
+ sus|||Susu|soussou
504
+ sux|||Sumerian|sumérien
505
+ swa||sw|Swahili|swahili
506
+ swe||sv|Swedish|suédois
507
+ syc|||Classical Syriac|syriaque classique
508
+ syr|||Syriac|syriaque
509
+ tah||ty|Tahitian|tahitien
510
+ tai|||Tai (Other)|thaïes, autres langues
511
+ tam||ta|Tamil|tamoul
512
+ tat||tt|Tatar|tatar
513
+ tel||te|Telugu|télougou
514
+ tem|||Timne|temne
515
+ ter|||Tereno|tereno
516
+ tet|||Tetum|tetum
517
+ tgk||tg|Tajik|tadjik
518
+ tgl||tl|Tagalog|tagalog
519
+ tha||th|Thai|thaï
520
+ tib|bod|bo|Tibetan|tibétain
521
+ tig|||Tigre|tigré
522
+ tir||ti|Tigrinya|tigrigna
523
+ tiv|||Tiv|tiv
524
+ tkl|||Tokelau|tokelau
525
+ tlh|||Klingon; tlhIngan-Hol|klingon
526
+ tli|||Tlingit|tlingit
527
+ tmh|||Tamashek|tamacheq
528
+ tog|||Tonga (Nyasa)|tonga (Nyasa)
529
+ ton||to|Tonga (Tonga Islands)|tongan (Îles Tonga)
530
+ tpi|||Tok Pisin|tok pisin
531
+ tsi|||Tsimshian|tsimshian
532
+ tsn||tn|Tswana|tswana
533
+ tso||ts|Tsonga|tsonga
534
+ tuk||tk|Turkmen|turkmène
535
+ tum|||Tumbuka|tumbuka
536
+ tup|||Tupi languages|tupi, langues
537
+ tur||tr|Turkish|turc
538
+ tut|||Altaic (Other)|altaïques, autres langues
539
+ tvl|||Tuvalu|tuvalu
540
+ twi||tw|Twi|twi
541
+ tyv|||Tuvinian|touva
542
+ udm|||Udmurt|oudmourte
543
+ uga|||Ugaritic|ougaritique
544
+ uig||ug|Uighur; Uyghur|ouïgour
545
+ ukr||uk|Ukrainian|ukrainien
546
+ umb|||Umbundu|umbundu
547
+ und|||Undetermined|indéterminée
548
+ urd||ur|Urdu|ourdou
549
+ uzb||uz|Uzbek|ouszbek
550
+ vai|||Vai|vaï
551
+ ven||ve|Venda|venda
552
+ vie||vi|Vietnamese|vietnamien
553
+ vol||vo|Volapük|volapük
554
+ vot|||Votic|vote
555
+ wak|||Wakashan languages|wakashennes, langues
556
+ wal|||Walamo|walamo
557
+ war|||Waray|waray
558
+ was|||Washo|washo
559
+ wel|cym|cy|Welsh|gallois
560
+ wen|||Sorbian languages|sorabes, langues
561
+ wln||wa|Walloon|wallon
562
+ wol||wo|Wolof|wolof
563
+ xal|||Kalmyk; Oirat|kalmouk; oïrat
564
+ xho||xh|Xhosa|xhosa
565
+ yao|||Yao|yao
566
+ yap|||Yapese|yapois
567
+ yid||yi|Yiddish|yiddish
568
+ yor||yo|Yoruba|yoruba
569
+ ypk|||Yupik languages|yupik, langues
570
+ zap|||Zapotec|zapotèque
571
+ zbl|||Blissymbols; Blissymbolics; Bliss|symboles Bliss; Bliss
572
+ zen|||Zenaga|zenaga
573
+ zha||za|Zhuang; Chuang|zhuang; chuang
574
+ znd|||Zande languages|zandé, langues
575
+ zul||zu|Zulu|zoulou
576
+ zun|||Zuni|zuni
577
+ zxx|||No linguistic content|pas de contenu linguistique
578
+ zza|||Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki|zaza; dimili; dimli; kirdki; kirmanjki; zazaki