精华内容
下载资源
问答
  • var retext = require ( 'retext' ) ; var inspect = require ( 'unist-util-inspect' ) ; var language = require ( 'retext-language' ) ; retext ( ) . use ( language ) . use ( function ( ) { return ...
  • ReText: 简单但强大的Markdown和reStructuredText编辑器
  • npm install retext-readability 用 假设我们有以下文件example.txt : The cat sat on the mat The constellation also contains an isolated neutron star—Calvera—and H1504+65, the hottest white dwarf yet...
  • ReText是一款使用 Markdown 语法和 reStructuredText (reST) 结构的文本编辑器,编辑的内容支持导出到 PDF、ODT 和 HTML 以及纯文本,支持即时预览、网页生成以及 HTML 语法高亮、全屏模式,可导出文件到 Google ...
  • 欢迎使用ReTextReText是Markdown和reStructuredText标记语言的简单但功能强大的编辑器。 还可以使用Python模块添加对支持。 要安装ReText,请确保已安装 (3.6或更高版本),然后运行pip3 install ReText 。 ...
  • PostHTML-Retext 插件封装在可扩展的分析系统和处理自然语言 用法 var fs = require ( 'fs' ) , posthtml = require ( 'posthtml' ) , html = fs . readFileSync ( 'path/to/file.html' ) ; posthtml ( ) . use ...
  • var retext = require ( 'retext' ) var japanese = require ( 'retext-japanese' ) var inspect = require ( 'unist-util-inspect' ) var options = { position : true , pos : false , dicDir : '../dict/' //...
  • retext

    千次阅读 2015-12-03 02:09:03
    Retext安装配置目录Retext安装配置 目录 Retext安装 Retext样式配置 Retext样式配置文件 基础语法 内容设置 Retext功能扩展配置 数学公式支持添加 代码高亮 参考文献 Retext安装sudo add-apt-repository ppa:mitya57...

    Retext安装配置

    目录

    Retext安装

    sudo add-apt-repository ppa:mitya57
    sudo apt-get update
    sudo get-apt install retext

    系统环境:Ubuntu14.04

    Retext样式配置

    新装好的引用和代码和正文的区分并不明显,而且整个文档的字体显示也不好看。之所以会出现这种情况,是因为[没有给ReText指定相应的CSS文件][1]。唯一的遗憾是ReText的某些配置无法通过菜单来完成,必须手动修改[配置文件][2].

    ~/.config/ReText project/ReText.conf

    内容修改为

    [General]
    styleSheet=path/github.css
    useWebKit=true
    autoSave=true

    github参考样式:https://github.com/nicolashery/markdownpad-github

    PS:path最好设置为绝对路径1.

    Retext样式配置文件

    基础语法:

    [General]
    Setting1=Value1
    Setting2=Value2

    内容设置

    • font, fontSize: Default font used in the resulting text, this doesn’t affect editor.
    • editorFont, editorFontSize: The same for editor.
    • styleSheet, appStyleSheet: Load CSS styles from file, provide canonical file name. appStyleSheet is used for +configuring the application window’s style. See the documentation for details.
      autoSave: Auto-save files. Value should be either true or false.
    • autoPlainText: Set to false if you don’t want ReText to automatically enable plain text mode on unknown file formats.
    • restorePreviewState: Restore live preview if it was enabled on last close.
    • spellCheck, spellCheckLocale: Enable spell checking by default, spellCheck should be either true or false, spellCheckLocale is language code (example: en_US).
    • useWebKit: Use QtWebKit engine for text rendering.
    • iconTheme: Force ReText to use the given icon theme (works only on X11 systems, on other systems you should use the icons pack or create your own).
    • tabWidth: number of spaces the Tab key inserts.
    • tabInsertsSpaces: whether Tab key should insert spaces instead of the tabulation character (on by default).
    • rightMargin: number of characters to display a margin line after.
    • handleWebLinks: (WebKit mode only) whether links should be opened in an external web browser (on by default).
    • saveWindowGeometry: set to true if you want ReText to save your window geometry and restore it on startup.
    • defaultMarkup: default markup name (usually Markdown or reStructuredText; case insensitive).
    • defaultCodec: default files encoding (mostly useful for Windows users). See the documentation for the list of possible encodings.

    更多配置请参考这儿.

    Retext功能扩展配置

    MathJax是如此的出名和优秀,所以ReText也有相应的MathJax扩展,不过这次修改的配置文件是

    ~/.config/markdown-extensions.txt

    数学公式支持添加:

    mathjax

    代码高亮

    codehilite

    环境配置 →sudo apt-get install python-pygments

    重新启动即可。

    参考文献

    [1] http://www.cnblogs.com/youxia/p/linux014.html

    [2] http://sourceforge.net/p/retext/wiki/Configuration%20file/


    1. 在我的电脑上只能用绝对路径才有效果,可以试试其他方法。
    展开全文
  • retext是一种自然语言处理器,由部分提供支持。 介绍 retext是一个生态系统,用于处理自然语言来完成各种事情:,或。 访问 ,仔细阅读其“部分以获取概述 阅读的自述文件以获取技术介绍 浏览以了解有关生态系统的...
  • var retext = require ( 'retext' ) var smartypants = require ( 'retext-smartypants' ) var file = retext ( ) . use ( smartypants ) . processSync ( 'He said, "A \'simple\' english sentence. . ."' ) ...
  • var retext = require ( 'retext' ) ; var dom = require ( 'retext-dom' ) ; var processor = retext ( ) . use ( dom ) ; processor . process ( 'A simple English sentence.' , function ( err , file , $node ...
  • var retext = require ( 'retext' ) var spell = require ( 'retext-spell' ) var dictionary = require ( 'dictionary-en-gb' ) var report = require ( 'vfile-reporter' ) retext ( ) . use ( spell , ...
  • npm install retext-sentiment 用 假设我们有以下文件example.txt : I hate forgetting to bring a book somewhere I definitely should have brought a book to. This product is not bad at all. Hai sexy! :...
  • npm install retext-passive 用 假设我们有以下文件example.txt : He was withheld while we were being fed. …我们的脚本example.js如下所示: var vfile = require ( 'to-vfile' ) var report = require ( '...
  • retext-pos 插件以添加词性(POS)标签。 对于其他插件很有用,因为它将信息添加到节点。 安装 : npm install retext-pos 用 var retext = require ( 'retext' ) var inspect = require ( 'unist-util-inspect'...
  • npm install retext-quotes 用 假设我们有以下文件example.txt : A sentence "with quotes, 'nested' quotes, and '80s apostrophes." …我们的脚本example.js如下所示: var vfile = require ( 'to-vfile' ) var...
  • 备注预设皮棉retext-english 预设,用于使用自动校对英文文本。 安装 $ npm install --save-dev remark-preset-lint-retext-english 用法 在package.json中设置以下内容: { " remarkConfig " : { " plugins " :...
  • 重述句子间隔 插件来检查句子之间的间距。...var retext = require ( 'retext' ) var spacing = require ( 'retext-sentence-spacing' ) retext ( ) . use ( spacing ) . process ( vfile . readSync
  • npm install retext-repeated-words 用 假设我们有以下文件example.txt : Well, it it doesn’t have to to be. Like a fish in the the sea. …我们的脚本example.js如下所示: var vfile = require ( 'to-vfile...
  • 亵渎亵渎 插件以检查措辞。 使用确保。 安装 : npm install retext-profanities 用 假设我们有以下文件example.txt : He’s pretty set on beating your butt for ...var profanities = require ( 'retext-pro
  • 重述 插件,以检查措辞不力和缓解情况。...var retext = require ( 'retext' ) var intensify = require ( 'retext-intensify' ) retext ( ) . use ( intensify ) . process ( vfile . readSync ( 'example.tx
  • 简化文字 插件可检查短语以查找更简单的替代方法。 安装 : npm install retext-...var retext = require ( 'retext' ) var simplify = require ( 'retext-simplify' ) retext ( ) . use ( simplify ) . pro
  • npm install retext-diacritics 用 假设我们有以下文件example.txt : Beyonce is the creme fresh on his resume. …我们的脚本example.js如下所示: var vfile = require ( 'to-vfile' ) var report = require ...
  • npm install retext-contractions 用 假设我们有以下文件example.txt : Well, it does’nt have to be so bad yall, it isnt like the 80’s. …我们的脚本example.js如下所示: var vfile = require ( 'to-vfile...
  • Centos 安装 retext

    2017-03-02 15:51:42
    摘要:因为最近写界面的时候需要设置一个帮助的选项,所以希望点击帮助的时候可以弹出一个html的说明书,之前没有接触过,在网上搜了一下相关的资料,知道Retext 是Linux 下的MarkDown编辑器,可是实时的实现效果,...

    摘要:因为最近写界面的时候需要设置一个帮助的选项,所以希望点击帮助的时候可以弹出一个html的说明书,之前没有接触过,在网上搜了一下相关的资料,知道Retext 是Linux 下的MarkDown编辑器,可是实时的实现效果,因此花了一天的时间把它装上了,期间碰到了一些棘手的问题,在搜索了很多人的文章之后都一一得到了解决,所以想着把这些内容记录下来,可以供给需要的人进行参考:


    参考的一些很有用的文章链接:

    http://blog.csdn.net/ztsinghua/article/details/48382309

    http://blog.csdn.net/ashimidashajia/article/details/48937553

    http://blog.csdn.net/healthy_coder/article/details/50370316

    https://segmentfault.com/q/1010000004444701

    https://www.zhihu.com/question/20409634

    以上的这些链接在这个过程中都对我提供了比较大的帮助


    正文:

    1)首先应该下载RetexT以及各类的安装包,具体下载安装包的方法以及链接详见第一个链接的文章,我就不再赘述

    2)在安装Retext之前你首先需要安装Python3

           安装Python的教程网上非常多,安装起来也很简单,只是需要安装的版本大于3.2,我安装的是3.4

           注意:教程(第一个链接中)提到装Python以及Qt都是通过从epel仓库中通过yum安装,我没有尝试过(我都是下载安装包进行的安装),但是还是配置了epel仓库,cent中可以通过yum进行安装:<sudo yum -y install epel-release>,


    3)安装Qt5

        Qt的安装很简单,安装的过程都是界面话的操作,直接在Qt的官网下载相应的安装包,然后进行安装就可以了,只是安装过后需要添加qmake的环境变量,不然的话新的不能使用。


    4)安装PyQt5

          安装PyQt5是我花费时间最长的一步,因为在这其中出现了很多的问题

          a、问题一

        首先你需要对安装包里的文件configure.py进行编译,以生成Makefile文件,这里尤其需要注意的是之后需要加上qmake的参数,这里的qmake的路径一定要正确,不然的话就有可能出现错误

          b、问题二

        然后又出现错误了:Error: This version of PyQt5 and the commercial version of Qt have incompatiblelicenses.
        与Qt的协议冲突了

        修改configure.py,注释掉与协议冲突的代码:

    	# Common checks.
    	#if introspecting and target_config.qt_licensee != 'Open Source' and ltype == 'GPL':
            #   error(
            #         "This version of PyQt5 and the commercial version of Qt have "
            #         "incompatible licenses.")
        重新对configure.py执行一次,这次就可以通过并且生成Makefile文件

          c、问题三

        接下来就要执行make、make install命令了,然而又出现错误

        

          error: 'qgeolocation.h' file not found
          #include <qgeolocation.h>
                   ^
          1 error generated.
          make[1]: *** [sipQtPositioningcmodule.o] Error 1
          make: *** [sub-QtPositioning-make_first-ordered] Error 2

        解决办法:/PyQt-gpl-5.5.1/QtPositioning下创建一个qgeolocation.h 文件,并将以下代码拷贝进去,保存,重新运行即可

     

    /****************************************************************************
    **
    ** Copyright (C) 2015 The Qt Company Ltd.
    ** Contact: http://www.qt.io/licensing/
    **
    ** This file is part of the QtPositioning module of the Qt Toolkit.
    **
    ** $QT_BEGIN_LICENSE:LGPL21$
    ** Commercial License Usage
    ** Licensees holding valid commercial Qt licenses may use this file in
    ** accordance with the commercial license agreement provided with the
    ** Software or, alternatively, in accordance with the terms contained in
    ** a written agreement between you and The Qt Company. For licensing terms
    ** and conditions see http://www.qt.io/terms-conditions. For further
    ** information use the contact form at http://www.qt.io/contact-us.
    **
    ** GNU Lesser General Public License Usage
    ** Alternatively, this file may be used under the terms of the GNU Lesser
    ** General Public License version 2.1 or version 3 as published by the Free
    ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
    ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
    ** following information to ensure the GNU Lesser General Public License
    ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
    ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    **
    ** As a special exception, The Qt Company gives you certain additional
    ** rights. These rights are described in The Qt Company LGPL Exception
    ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    **
    ** $QT_END_LICENSE$
    **
    ****************************************************************************/
    
    #ifndef QGEOLOCATION_H
    #define QGEOLOCATION_H
    
    #include <QtCore/QSharedDataPointer>
    #include <QtCore/QMetaType>
    #include <QtPositioning/qpositioningglobal.h>
    
    QT_BEGIN_NAMESPACE
    
    class QGeoAddress;
    class QGeoCoordinate;
    class QGeoRectangle;
    class QGeoLocationPrivate;
    
    class Q_POSITIONING_EXPORT QGeoLocation
    {
    public:
        QGeoLocation();
        QGeoLocation(const QGeoLocation &other);
    
        ~QGeoLocation();
    
        QGeoLocation &operator=(const QGeoLocation &other);
    
        bool operator==(const QGeoLocation &other) const;
        bool operator!=(const QGeoLocation &other) const {
            return !(other == *this);
        }
    
        QGeoAddress address() const;
        void setAddress(const QGeoAddress &address);
        QGeoCoordinate coordinate() const;
        void setCoordinate(const QGeoCoordinate &position);
        QGeoRectangle boundingBox() const;
        void setBoundingBox(const QGeoRectangle &box);
    
        bool isEmpty() const;
    
    private:
        QSharedDataPointer<QGeoLocationPrivate> d;
    };
    
    Q_DECLARE_TYPEINFO(QGeoLocation, Q_MOVABLE_TYPE);
    
    QT_END_NAMESPACE
    
    Q_DECLARE_METATYPE(QGeoLocation)
    
    #endif
            这样算是成功的将PyQt5安装好了!检测是否安装好:

    python
    >>> import PyQt5
    >>> help(PyQt5)


    5、安装retext

    终于到了安装Retext这一步了,此时还需要利用Python-pip安装一些依赖包,又出现问题了可怜

    我找不到自己的python-pip装在了哪里,后来知道python 3.4之后是都自带的pip

    所以直接使用命令python -m pip 就可以安装

    需要安装的有 python -m pip markups

     python -m pip markdown

     python -m pip docutils

     python -m pip pyenchant

    安装完这些依赖项之后就可以安装retext啦

    cd ReText-x.x.x
    sudo python setup.py install

    安装完成后在终端输入retext之后。你就可以开始使用retext啦

      文章最开始给出的连接中最后一个连接就是教你怎么使用RETEXT的,很实用哦


    【业余记录,有不足的地方还希望批评指正】微笑



         

      


    展开全文
  • var retext = require ( 'retext' ) ; var inspect = require ( 'unist-util-inspect' ) ; var direction = require ( 'retext-directionality' ) ; retext ( ) . use ( direction ) . use ( function ( ) { ...
  • npm install retext-equality 用 假设我们有以下文件example.txt : He’s pretty set on beating your butt for sheriff. …我们的脚本example.js如下所示: var vfile = require ( 'to-vfile' ) var report = ...
  • var retext = require ( 'retext' ) var emoji = require ( 'retext-emoji' ) var file = retext ( ) . use ( emoji , { convert : 'encode' } ) . processSync ( 'I’m going to bed. :zzz:' ) console . log ( ...
  • 备注文字 插件可以桥接或变异来。 笔记! 此插件已准备就绪,可用于remark中的新解析器( )。 无需更改:它现在的工作方式与以前完全相同! 安装 : npm install remark-retext ...var remark2retext = require
  • 欢迎使用ReTextReText是Markdown和reStructuredText标记语言的简单但功能强大的编辑器。 还可以使用Python模块添加对自定义标记的支持。 要安装ReText,请确保您拥有Pyth Welcome to ReTextReText是Markdown和...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 871
精华内容 348
关键字:

ReText