适用于Python的MediaWiki兼容解析器。
项目描述
smc.mw
一个适用于Python的MediaWiki兼容解析器。
当前状态
使用
运行测试
$ make -C tests
测试结果可以在 tests/out/report.html 中找到。
也提供了一个命令行工具(安装为“mw”)
$ echo "''Hello World''" | python smc/mw/tool.py <html><body><p><i>Hello World</i> </p></body></html>
差异
有关具体差异,请参阅 测试结果。
__TOC__ 和其他魔法词必须单独占一行,而MediaWiki允许它们出现在任何地方,有些奇怪的后果。
目前不支持:__NOEDITSECTION__、__NEWSECTIONLINK、__NONEWSECTIONLINK__。
待办事项
测试843:提取部分,<pre>围绕虚假标题(bug 10309)。这应该得到修复,因为它也影响了解析器扩展(数学元素等)。为此,预处理器语法需要包括特定(但不是所有)解析的XML元素(反例:div元素对标题是透明的,而pre元素不是)。
感谢
解析器使用ResQSoft Inc.和Juancarlo Añez的PEG语法解析器生成器grako。
版权
smc.mw
版权(C)2013 semantics GmbH。保留所有权利。
有关许可,请参阅文件 LICENSE.txt。
semantics Kommunikationsmanagement GmbH Viktoriaallee 45 D-52066 Aachen Germany email: info(at)semantics.de url: http://www.semantics.de/
jquery
smc.mw 在测试套件中包含了 jquery,位于 tests/static/jquery-1.10.1.min.js
Copyright 2013 jQuery Foundation and other contributors https://jqueryjs.cn/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
测试数据
位于 tests/data/parserTests.txt 和 tests/extra-data/*.txt 的测试数据是直接从 MediaWiki 项目复制过来的
MediaWiki Parser test cases Some taken from http://meta.wikimedia.org/wiki/Parser_testing All (C) their respective authors and released under the GPL
tidylib
位于 tests/mytidylib 的 tidylib 实现是从 PyTidyLib 版本 0.2.1 衍生而来
Copyright 2009 Jason Stitt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
项目详情
关闭
smc.mw-0.3.zip 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | a09e1212b0f8c19339cc573d95b7354dbd9450f49e3a891b1c17834ac059ef2e |
|
MD5 | d2c5ec82e8e82352842a5f6e1a236a6d |
|
BLAKE2b-256 | 3c24bf79e2983466cd642d47316dc193a756cdab20ae9101f66adc2c053fc6f2 |