修改有效的rst文本以适应给定的宽度

reflowrst的Python项目详细描述


安装

>>> sudo pip install reflowrst

用法

示例:

>>> from reflowrst import reflow
>>> text = 'Here is a paragraph that is far too long and will need to wrap.'
>>> print(reflow(text, 47))
Here is a paragraph that is far too long and
will need to wrap.

您还可以使用0获得最长的rst文本格式 为了空间例如:

>>> paragraph = '''Here is a paragraph that is far too long and
will need to wrap.'''
>>> print(reflow(paragraph, 0))
Here is a paragraph that is far too long and will need to wrap.

待办事项

  • 冠军
  • {转换
  • {段落
  • {项目符号列表
  • {枚举列表
  • {定义
  • {字段
  • {选项
  • {文字块
  • ☆引用的文字块
  • 线块
  • {方块引号
  • ☆Doctest区块
  • {网格表
  • {简单表格
  • {脚注
  • {引文
  • {指令

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java编辑并重新运行spring引导单元测试,无需重新加载上下文即可加快测试速度   为什么我不能做演员?   java为什么是线程。join通常用于停止安卓中的线程   java从weblogic服务器调用JSON POST REST服务时收到400:错误请求   java在DeviceAdmin模式禁用时设置身份验证?   java SortedMap的keySet()能否始终安全地强制转换到SortedSet?   安卓 java。lang.NoSuchMethodException可包裹类   java JOGL库安装   javatomcat内存管理   java使用getString()中的变量   java将最小星号设置为评级栏   Java中字符串相等的println()方法。。。它到底是如何工作的?   java如何从文本中输出的数组中放入随机图像