连接nebu发布实用程序
nebuchadnezzar的Python项目详细描述
cnx nebu发布实用程序
这是一个与连接内容交互的命令行接口。这些工具主要用于将内容发布到cnx.org网站。
此软件需要:
- python>;=3.5
- libmagic(Linux上的libmagic1)
- Jre=6
安装
- 安装python3(在OSX上,您可以运行brew install python3)
- 在终端中运行pip3 install --upgrade pip setuptools以升级python工具
- 确保安装了libmagic(在linux上是默认的,在osx上使用brew install libmagic)
- 在终端中运行pip3 install nebuchadnezzar。
- 运行neb --help以验证应用程序是否已安装
开发
安装
- 安装python3(在OSX上,您可以运行brew install python3)
- 确保安装了libmagic(在linux上是默认的,在osx上使用brew install libmagic)
- 安装virtualenv(在OSX上,您可以运行pip3 install virtualenv)
- 初始化python虚拟环境:
- virtualenv ./venv/ --python=python3.5
- source ./venv/bin/activate
- pip3 install --upgrade pip setuptools
- python setup.py develop或(最好)pip3 install -e .
开发人员运行
- 打开新终端
- source ./venv/bin/activate
- 现在您可以运行各种命令:
- neb --help获取有关各种命令的帮助
测试
运行所有测试:make test
运行名为test_main:make test ---k test_main
的单个测试配置编辑器
准备
安装(自动atom配置)
- 启动Atom
- 安装linter-autocomplete-jing包
- 键入<;kbd>;<;kbd>;+<;kbd>;,<;kbd>;(对于Mac)打开“设置”(或单击菜单栏中的atom,preferences…)
- 单击左侧的install。
- 输入linter-autocomplete-jing,然后单击安装
- alternative:从命令行运行apm install linter-autocomplete-jing
- 运行neb atom-config(注意:这将覆盖您的atom配置文件。如果您希望自己更新配置文件,请参阅下面的“手动atom配置”。)
- 重新启动Atom
- 打开一个完整的拉链。(我从终端运行atom ~/Downloads/col1234_complete)
- 通过打开一个index.cnxml文件并在文件中的某个位置键入<figure>进行验证。你应该在标签旁边看到一个红色的标记,上面写着RNG: element "figure" missing required attribute "id"。
手动atom配置
仅当您没有运行上面的neb atom-config时,此步骤才是必需的。完成此步骤后,从“重新启动Atom”步骤继续执行上述说明。
通过单击菜单栏中的atom,config并复制和粘贴下面的(note:缩进很重要):
"*": core: customFileTypes: # Add this to the bottom of the customFileTypes area. # Note: Indentation is important! "text.xml": [ "index.cnxml" ] # And then this to the bottom of the file # 1. Make sure "linter-autocomplete-jing" only occurs once in this file! # 1. make sure it is indented by 2 spaces just like it is in this example. "linter-autocomplete-jing": displaySchemaWarnings: true rules: [ { priority: 1 test: pathRegex: ".cnxml$" outcome: schemaProps: [ { lang: "rng" path: "~/.neb/cnxml-validation/cnxml/xml/cnxml/schema/rng/0.7/cnxml-jing.rng" } ] } ]
许可证
本软件受GNU Affero通用条款的约束 公共许可3.0版(AGPL)。有关详细信息,请参见LICENSE.txt。 版权所有(c)2016-2018赖斯大学