Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    Rbpar 0.2.0

    Download button

    Downloads: 303  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.1/5)
    6 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Ismo Puustinen | More programs
    GPL / FREE
    January 28th, 2008, 01:38 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Rbpar description

    Rbpar is a program and an accompanying library suite designed for formatting text paragraphs.

    Rbpar is a program and an accompanying library suite designed for formatting text paragraphs. In this sense, it resembles very much the venerable UNIX programs fmt and par. The difference is that rbpar sports a more modern design: it is written completely with Ruby and offers an internal API for several paragraph formatting tasks. However, the more advanced features that fmt and par provide are currently not implemented in rbpar.

    The library includes an implementation of the optimal line breaking algorithm by Donald E. Knuth. The library also has a semi-intelligent paragraph parser that is not confused by email quotes: this is due to the fact that rbpar was first designed for email writing. Rbpar ships with a full suite of unit tests, which are designed to make further refactoring and development easier.

    The program executable 'rbpar.rb' is installed to the executable path by default. The program read input from stdin and outputs formatted paragraphs to stdout. A working Ruby environment is required for running rbpar.

    USAGE

    rbpar.rb [-v] [-w < number >]

    rbpar.rb accepts the following parameters:

    -w, --width : Set the desired line width
    -v, --vim : Use vim-style line endings (with an ending space)

    Example usage to format a text file:

    cat unprocessed.txt | rbpar.rb > processed.txt

    VIM INTEGRATION

    To make vim 'gq' operator use rbpar, use the following command either in vim command menu or in your vimrc file:

    set formatprg=rbpar.rb -w 63 -v

    This sets the desired line width to be 62 characters. One extra space is inserted after every line that does not end a paragraph. This enables vim (with format-option 'w') to understand the paragraph lines. This is handy when using the 'auto-format' format option. See vim help for 'formatoptions', 'fo-table' and 'auto-format' for details.

    What's New in This Release:

    · Speedups, bugfixes, cleanups, and support for DOS-style end-of-line characters were added.
    · This version is about two times as fast as 0.1.0.



    Product's homepage

      


    TAGS:

    text formatter | paragraph formatter | ruby library | fmt | par | ruby

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM