GithubHelp home page GithubHelp logo

apjanke / ronn-ng Goto Github PK

View Code? Open in Web Editor NEW
71.0 6.0 14.0 587 KB

Ronn-NG: An updated fork of ronn. Build man pages from Markdown.

License: MIT License

Ruby 45.80% CSS 4.49% HTML 26.36% Roff 22.14% Shell 1.22%
manpages documentation

ronn-ng's Introduction

Ronn-NG

Ronn-NG is a new, currently-maintained fork of the defunct original Ronn project.

Ronn builds manuals. It converts simple, human readable textfiles to roff for terminal display, and also to HTML for the web.

The source format includes all of Markdown but has a more rigid structure and syntax extensions for features commonly found in manpages (definition lists, link notation, etc.). The ronn-format(7) man page defines the format in detail.

The *.ronn files found in the man/ directory show off a wide range of ronn capabilities:

As an alternative, you might want to check out pandoc which can also convert markdown into roff manual pages.

Installation

Install with Homebrew on macOS:

brew tap apjanke/ronn-ng
brew install ronn-ng

Install with gem anywhere that supports it:

gem install ronn-ng

See INSTALLING.md for details on other systems and installation methods.

Examples

Build roff and HTML output files for one or more input files:

$ ronn man/ronn.5.ronn
roff: man/ronn.5
html: man/ronn.5.html

Generate only a standalone HTML version of one or more files:

$ ronn --html man/markdown.5.ronn
html: man/markdown.5.html

Build roff versions of all ronn files in a directory:

$ ronn --roff man/*.ronn

View a ronn file as if it were a manpage without building intermediate files:

$ ronn --man man/markdown.5.ronn

View roff output with man(1):

$ man man/ronn.5

The ronn(1) man page includes comprehensive documentation on ronn command line options.

Background

Some think Unix man pages are a poor and outdated form of documentation. Ronn-NG disagrees:

  • Manpages follow a well defined structure that's immediately familiar. This gives developers a starting point when documenting new tools, libraries, and formats.

  • Manpages get to the point. Because they're written in an inverted style, with a SYNOPSIS section followed by additional detail, prose and references to other sources of information, manpages provide the best of both cheat sheet and reference style documentation.

  • Historically, manpages use an extremely — unbelievably — limited set of text formatting capabilities. You get a couple of headings, lists, bold, underline and no more. This is a feature.

  • Although two levels of section hierarchy are technically supported, most manpages use only a single level. Unwieldy document hierarchies complicate otherwise good documentation. Remember that Feynman covered all of physics — heavenly bodies through QED — with only two levels of document hierarchy (The Feynman Lectures on Physics, 1970).

  • The classical terminal manpage display is typographically well thought out. Big bold section headings, justified monospace text, nicely indented paragraphs, intelligently aligned definition lists, and an informational header and footer.

  • Manpages have a simple referencing syntax; e.g., sh(1), fork(2), markdown(7). HTML versions can use this to generate links between pages.

Unfortunately, figuring out how to create a manpage is a fairly tedious process. The roff/mandoc/mdoc macro languages are highly extensible, fractured between multiple dialects, and include a bunch of device-specific stuff irrelevant to modern publishing tools. Ronn aims to solve that problem.

Requirements

Ronn-NG requires Ruby 2.4 or newer.

Ruby 3.x support is a work in progress as of Ronn-NG 0.10.1 (December 2022).

If you are installing Ronn-NG as a standalone program (the usual way to use it), it includes all its Ruby libraries, and has no other dependencies. If you are using Ronn-NG as a gem or other library, it requires gems as listed in ronn-ng.gemspec.

Project Management

The project home page is at https://github.com/apjanke/ronn-ng. Bug reports, feature requests, and patch submissions are welcome.

Ronn-NG was forked from the original Ronn project in 2018 after Ronn development had been defunct for a couple years, and Andrew wanted some bugs fixed.

License and Copying

MIT License.

Ronn is Copyright (C) 2010 Ryan Tomayko.

New Ronn-NG material is Copyright (C) 2018-2022 Andrew Janke and other contributors.

See the file LICENSE.txt for information of licensing and distribution.

Build Status

Travis build status

ronn-ng's People

Contributors

adamv avatar adminspotter avatar apjanke avatar defunkt avatar deivid-rodriguez avatar dependabot[bot] avatar foxboron avatar martin-ueding avatar mttbernardini avatar nabijaczleweli avatar rcrowley avatar richardkmichael avatar rtomayko avatar sloonz avatar sometimesfood avatar spacewander avatar sunaku avatar tnir avatar tswicegood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ronn-ng's Issues

Test failure: test_produces_html_instead_of_roff_with_the_html_argument

On master:

$ rake test                                                                            master
NOTE: Gem::Specification#has_rdoc= is deprecated with no replacement. It will be removed on or after 2018-12-01.
Gem::Specification#has_rdoc= called from (eval):92.
Loaded suite /usr/local/bin/rake
Started
........................................................F
==============================================================================================
/Users/janke/local/repos/ronn-ng/test/test_ronn.rb:45:in `block in <class:RonnTest>'
Failure: test_produces_html_instead_of_roff_with_the_html_argument(RonnTest):
  </<meta\ name='generator'\ value='Ronn\/v0\.7\.3\ \(http:\/\/github\.com\/rtomayko\/ronn\/tree\/0\.7\.3\)'>/> was expected to be =~
  <"<!DOCTYPE html><html><head><meta http-equiv='content-type' content='text/html;charset=utf8'><meta name='generator' content='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'><title>hello(1) - hello world</title><style type='text/css' media='all'>/* style: man */body#manpage {margin:0}.mp {max-width:100ex;padding:0 9ex 1ex 4ex}.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}.mp h2 {margin:10px 0 0 0}.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}.mp h3 {margin:0 0 0 4ex}.mp dt {margin:0;clear:left}.mp dt.flush {float:left;width:8ex}.mp dd {margin:0 0 0 9ex}.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}.mp pre {margin-bottom:20px}.mp pre+h2,.mp pre+h3 {margin-top:22px}.mp h2+pre,.mp h3+pre {margin-top:5px}.mp img {display:block;margin:auto}.mp h1.man-title {display:none}.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}.mp h2 {font-size:16px;line-height:1.25}.mp h1 {font-size:20px;line-height:2}.mp {text-align:justify;background:#fff}.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}.mp u {text-decoration:underline}.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}.mp b.man-ref {font-weight:normal;color:#434241}.mp pre {padding:0 4ex}.mp pre code {font-weight:normal;color:#434241}.mp h2+pre,h3+pre {padding-left:0}ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}ol.man-decor {width:100%}ol.man-decor li.tl {text-align:left}ol.man-decor li.tc {text-align:center;letter-spacing:4px}ol.man-decor li.tr {text-align:right;float:right}</style></head><!--The following styles are deprecated and will be removed at some point:div#man, div#man ol.man, div#man ol.head, div#man ol.man.The .man-page, .man-decor, .man-head, .man-foot, .man-title, and.man-navigation should be used instead.--><body id='manpage'><div class='mp' id='man'><div class='man-navigation' style='display:none'><a href='#NAME'>NAME</a></div><ol class='man-decor man-head man head'><li class='tl'>hello(1)</li><li class='tc'></li><li class='tr'>hello(1)</li></ol><h2 id='NAME'>NAME</h2><p class='man-name'><code>hello</code> - <span class='man-whatis'>hello world</span></p><ol class='man-decor man-foot man foot'><li class='tl'></li><li class='tc'>December 2018</li><li class='tr'>hello(1)</li></ol></div></body></html>">.
==============================================================================================
.....
Finished in 4.208574 seconds.
----------------------------------------------------------------------------------------------
62 tests, 114 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
98.3871% passed
----------------------------------------------------------------------------------------------
14.73 tests/s, 27.09 assertions/s

Cut 0.9.0 release

The migration to kramdown justifies a new release, and a minor version bump. Cut an 0.9.0 once #28 is done.

"toc" stylesheet links are broken

Generating html from a CHANGELOG i found that old versions of "ronn" generate a Table of Contents with links that actually take you to the release you clicked. With "ronn-ng" that is not the case anymore. Also tried most recent 0.9.1 in debian11.

Steps to reproduce:

git clone https://github.com/apjanke/ronn-ng
cd ronn-ng
docker run -v $(pwd):/this/:rw --rm -t -i debian:bullseye
apt-get update -qq; apt-get install ronn -y
cd /this
ronn -h CHANGES --style=dark,toc --pipe > CHANGES.html

Browse to <path-to-clone>/CHANGES.html and click those links.

Deprecated CSS styles in HTML output

There are some deprecated CSS styles.

The generated HTML documents contain this:

<!--
  The following styles are deprecated and will be removed at some point:
  div#man, div#man ol.man, div#man ol.head, div#man ol.man.

  The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
  .man-navigation should be used instead.
-->

Learn what that means and why they're deprecated, and do something to resolve it.

Runtime error in rdiscount ('no_superscript' missing)

When running ronn, it exits with the error that no_superscript is not defined (see below for the error and stacktrace.)
I found #5, and noticed that the missing function was only introduced in rdiscount version 2.1.6 (as per here). So I'm guessing this is simply a matter of updating the dependency version.

ronn -r --pipe --date=2018-03-01 man-page.1.ronn > man-page.1
Traceback (most recent call last):
        11: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/bin/ronn:23:in `<main>'
        10: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/bin/ronn:23:in `load'
         9: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/ronn-ng-0.8.0/bin/ronn:183:in `<top (required)>'
         8: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/ronn-ng-0.8.0/bin/ronn:183:in `map'
         7: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/ronn-ng-0.8.0/bin/ronn:183:in `block in <top (required)>'
         6: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/ronn-ng-0.8.0/bin/ronn:183:in `new'
         5: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/ronn-ng-0.8.0/lib/ronn/document.rb:80:in `initialize'
         4: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/ronn-ng-0.8.0/lib/ronn/document.rb:208:in `sniff'
         3: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/ronn-ng-0.8.0/lib/ronn/document.rb:208:in `new'
         2: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/rdiscount-2.0.7/lib/rdiscount.rb:93:in `initialize'
         1: from /usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/rdiscount-2.0.7/lib/rdiscount.rb:93:in `each'
/usr/local/Cellar/ronn-ng/0.8.0/libexec/gems/rdiscount-2.0.7/lib/rdiscount.rb:93:in `block in initialize': undefined method `no_superscript=' for #<RDiscount:0x00007ff5da144650> (NoMethodError)

<dot.> and <with:colon> implicit escaping of angle brackets isn't working

Exposed by adding a roff test for angle_bracket_syntax, following #48.

Low priority - looks to me like this has been broken for a while, and nobody has noticed it or complained, which means that probably nobody is using this feature.

You can now see a warning that's issued when this syntax is encountered:

bundle exec rake test
Loaded suite /usr/local/lib/ruby/gems/2.7.0/bin/rake
Started
......................................warn: unrecognized inline tag: ["dot."]
................................
Finished in 13.540875 seconds.
-------------------------------------------------------------------------------------------------------------------------------------------------------
70 tests, 112 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------
5.17 tests/s, 8.27 assertions/s

And the text disappears from the roff output:

.P
or when \fB<WORD>\fR is enclosed in backticks\.
.P
or when \fIWORD\fR has a

Crash if using mini_portile2 version 2.5.0

The MacPorts repository has mini_portile2 version 2.5.0. If version 2.4.0 is missing, ronn-ng crashes.

Is version 2.4.0 mandatory, or is it possible to upgrade to 2.5.0? And if so, how can this be done? I don't understand Ruby projects, so I tried to raise the version in Germfile.lock, but apparently, the version is being set somewhere else.

At startup, I have the following log:

Traceback (most recent call last):
	12: from /opt/local/bin/ronn-2.7:23:in `<main>'
	11: from /opt/local/lib/ruby2.7/2.7.0/rubygems.rb:295:in `activate_bin_path'
	10: from /opt/local/lib/ruby2.7/2.7.0/rubygems.rb:295:in `synchronize'
	 9: from /opt/local/lib/ruby2.7/2.7.0/rubygems.rb:296:in `block in activate_bin_path'
	 8: from /opt/local/lib/ruby2.7/2.7.0/rubygems/specification.rb:1373:in `activate'
	 7: from /opt/local/lib/ruby2.7/2.7.0/rubygems/specification.rb:1391:in `activate_dependencies'
	 6: from /opt/local/lib/ruby2.7/2.7.0/rubygems/specification.rb:1391:in `each'
	 5: from /opt/local/lib/ruby2.7/2.7.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
	 4: from /opt/local/lib/ruby2.7/2.7.0/rubygems/specification.rb:1373:in `activate'
	 3: from /opt/local/lib/ruby2.7/2.7.0/rubygems/specification.rb:1391:in `activate_dependencies'
	 2: from /opt/local/lib/ruby2.7/2.7.0/rubygems/specification.rb:1391:in `each'
	 1: from /opt/local/lib/ruby2.7/2.7.0/rubygems/specification.rb:1402:in `block in activate_dependencies'
/opt/local/lib/ruby2.7/2.7.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'mini_portile2' (~> 2.4.0) - did find: [mini_portile2-2.5.0] (Gem::MissingSpecVersionError)
Checked in 'GEM_PATH=/Users/judaew/.gem/ruby/2.7.0:/opt/local/lib/ruby2.7/gems/2.7.0', execute `gem env` for more information

macports/macports-ports#9116

gem-env.txt

"warn: unrecognized inline tag" for "p" and "h2"

[~/local/repos/git-lfs]
$ make man                                                                                                     testing-ronn-ng
ronn  -r --pipe < docs/man/git-lfs-checkout.1.ronn > man/git-lfs-checkout.1
ronn  -r --pipe < docs/man/git-lfs-clean.1.ronn > man/git-lfs-clean.1
ronn  -r --pipe < docs/man/git-lfs-clone.1.ronn > man/git-lfs-clone.1
ronn  -r --pipe < docs/man/git-lfs-config.5.ronn > man/git-lfs-config.5
ronn  -r --pipe < docs/man/git-lfs-env.1.ronn > man/git-lfs-env.1
ronn  -r --pipe < docs/man/git-lfs-ext.1.ronn > man/git-lfs-ext.1
ronn  -r --pipe < docs/man/git-lfs-fetch.1.ronn > man/git-lfs-fetch.1
ronn  -r --pipe < docs/man/git-lfs-filter-process.1.ronn > man/git-lfs-filter-process.1
ronn  -r --pipe < docs/man/git-lfs-fsck.1.ronn > man/git-lfs-fsck.1
ronn  -r --pipe < docs/man/git-lfs-install.1.ronn > man/git-lfs-install.1
ronn  -r --pipe < docs/man/git-lfs-lock.1.ronn > man/git-lfs-lock.1
ronn  -r --pipe < docs/man/git-lfs-locks.1.ronn > man/git-lfs-locks.1
ronn  -r --pipe < docs/man/git-lfs-logs.1.ronn > man/git-lfs-logs.1
ronn  -r --pipe < docs/man/git-lfs-ls-files.1.ronn > man/git-lfs-ls-files.1
warn: unrecognized inline tag: ["h2"]
ronn  -r --pipe < docs/man/git-lfs-migrate.1.ronn > man/git-lfs-migrate.1
ronn  -r --pipe < docs/man/git-lfs-pointer.1.ronn > man/git-lfs-pointer.1
ronn  -r --pipe < docs/man/git-lfs-post-checkout.1.ronn > man/git-lfs-post-checkout.1
ronn  -r --pipe < docs/man/git-lfs-post-merge.1.ronn > man/git-lfs-post-merge.1
ronn  -r --pipe < docs/man/git-lfs-pre-push.1.ronn > man/git-lfs-pre-push.1
ronn  -r --pipe < docs/man/git-lfs-prune.1.ronn > man/git-lfs-prune.1
ronn  -r --pipe < docs/man/git-lfs-pull.1.ronn > man/git-lfs-pull.1
ronn  -r --pipe < docs/man/git-lfs-push.1.ronn > man/git-lfs-push.1
ronn  -r --pipe < docs/man/git-lfs-smudge.1.ronn > man/git-lfs-smudge.1
ronn  -r --pipe < docs/man/git-lfs-status.1.ronn > man/git-lfs-status.1
ronn  -r --pipe < docs/man/git-lfs-track.1.ronn > man/git-lfs-track.1
warn: unrecognized inline tag: ["p"]
warn: unrecognized inline tag: ["p"]
warn: unrecognized inline tag: ["p"]
ronn  -r --pipe < docs/man/git-lfs-uninstall.1.ronn > man/git-lfs-uninstall.1
ronn  -r --pipe < docs/man/git-lfs-unlock.1.ronn > man/git-lfs-unlock.1
ronn  -r --pipe < docs/man/git-lfs-untrack.1.ronn > man/git-lfs-untrack.1
warn: unrecognized inline tag: ["p"]
ronn  -r --pipe < docs/man/git-lfs-update.1.ronn > man/git-lfs-update.1
ronn  -r --pipe < docs/man/git-lfs.1.ronn > man/git-lfs.1

Fix this.

That warning message is not very useful, either. Needs to give more context. Should also probably prefix it with "ronn: ".

gemspec has_rdoc is deprecated

$ rake test                                                                            master
NOTE: Gem::Specification#has_rdoc= is deprecated with no replacement. It will be removed on or after 2018-12-01.
Gem::Specification#has_rdoc= called from (eval):92.

Nested lists don't work

Legacy bug report: rtomayko/ronn#55

Nested lists that look like definition lists don't render properly. In some cases, the nested list is omitted entirely.

Test file at https://github.com/apjanke/ronn-ng/blob/master/test/nested_list.ronn.

nested_list test
================

## TEST

* foo:
  Blablabla.

* bar:
  Blablabla.

  - bar-foo:
    Bububu.

  - bar-baz:
    Bububu.

* baz:
  Blablabla.

Results:

$ bin/ronn --roff --pipe test/nested_list.ronn
warn: unrecognized inline tag: ["dl"]
.\" generated with Ronn-NG/v0.8.0
.\" http://github.com/apjanke/ronn-ng/tree/0.8.0-SNAPSHOT
.TH "NESTED_LIST" "" "December 2018" "" ""
.SH "TEST"
.TP
foo
Blablabla\.
.TP
bar
Blablabla\.
.TP
baz
Blablabla\.

The inner nested list is missing. Looks like it's because the dt is being passed through the inline filter, which can't handle nested lists.

Redo VERSION logic to use '-SNAPSHOT'

I'm not sure I like the current version mechanism that represents the current version as the prior version plus a git offset. I'd rather have it report the upcoming version and use a prerelease tag like -SNAPSHOT on it.

Markdown code block syntax doesn't convert to roff's .EX/.EE syntax

Look at man 3 printf

image

.EX
printf("%*d", width, num);
.EE

To markup example code, they use roff's .EX/.EE syntax

Now I tried to convert
https://github.com/MicrosoftDocs/cpp-docs/blob/master/docs/c-runtime-library/reference/rand.md

However, ronn-ng didn't use this syntax.

For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).

## Example

```C
// crt_rand.c
// This program seeds the random-number generator
// with the time, then exercises the rand function.
//

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

void SimpleRandDemo( int n )
{
   // Print n random numbers.
   int i;
   for( i = 0; i < n; i++ )
      printf( "  %6d\n", rand() );
}

void RangedRandDemo( int range_min, int range_max, int n )
{
   // Generate random numbers in the half-closed interval
   // [range_min, range_max). In other words,
   // range_min <= random number < range_max
   int i;
   for ( i = 0; i < n; i++ )
   {
      int u = (double)rand() / (RAND_MAX + 1) * (range_max - range_min)
            + range_min;
      printf( "  %6d\n", u);
   }
}

int main( void )
{
   // Seed the random-number generator with the current time so that
   // the numbers will be different every time we run.
   srand( (unsigned)time( NULL ) );

   SimpleRandDemo( 10 );
   printf("\n");
   RangedRandDemo( -100, 100, 10 );
}
```
For more information, see Compatibility \fI\.\./\.\./c\-runtime\-library/compatibility\.md\fR\.
.SH "Example"
```C // crt_rand_s\.c // This program illustrates how to generate random // integer or floating point numbers in a specified range\.
.P
// Remembering to define _CRT_RAND_S prior // to inclusion statement\. #define _CRT_RAND_S#include
.P
int main( void ) { int i; unsigned int number; double max = 100\.0; errno_t err;
.IP "" 4
.nf
// Display 10 random integers in the range [ 1,10 ]\.
for( i = 0; i < 10;i++ )
{
    err = rand_s( &number );
    if (err != 0)
    {
        printf_s("The rand_s function failed!\en");
    }
    printf_s( "  %u\en", (unsigned int) ((double)number /
                   ((double) UINT_MAX + 1 ) * 10\.0) + 1);
}

printf_s("\en");

// Display 10 random doubles in [0, max)\.
for (i = 0; i < 10;i++ )
{
    err = rand_s( &number );
    if (err != 0)
    {
        printf_s("The rand_s function failed!\en");
    }
    printf_s( "  %g\en", (double) number /
                      ((double) UINT_MAX + 1) * max );
} } ```
.fi
.IP "" 0

Wrong list layout when only one argument is used

Thanks for ronn-ng, as writing manpages in markdown is very comfortable.

System

Debian Bullseye (testing)

ronn/testing,testing,unstable,unstable,now 0.9.1-1 all  [installiert]
  tool to build manuals from Markdown

ruby-ronn/testing,testing,unstable,unstable,now 0.9.1-1 all  [Installiert,automatisch]
  library to build manuals from Markdown

Issue

When I have only one argument in a list the list is not rendered as I expect it.

## COMMANDS    
    
* `-d`, `--debug`:    
Show debug information.    
    
* `-d`:    
Show debug information.  

I would expect both to render the same but they are rendered differently:

2020-12-04-154056_scrot

It looks a bit weird if there is no linebreak before some descriptions.

Set up a CI server

Set up a CI server for Ronn-NG, probably Jenkins or CircleCI. Have it build and run the tests for each PR. Get a badge integrated on the GitHub PR display, and maybe the main page.

Probably add a Rubocop/lint check as part of the tests, so offenses get called out on PRs.

undefined method `position' for #<Nokogiri::XML::Element:0x0000000002465008> (NoMethodError)

In order to generate bundler's man pages, we currently use the ronn gem. However, this gem and its dependencies have not been updated for years, and just now I found out that they started segfaulting in some situations.

I tried replacing ronn with ronn-ng. It did generate some man pages (didn't check correctness, but it didn't crash), but it ended up crashing with the following error

/home/travis/.rvm/rubies/ruby-2.6.1/bin/ruby -S ronn --roff --pipe man/gemfile.5.ronn > man/gemfile.5
warn: unrecognized inline tag: ["p"]
warn: unrecognized inline tag: ["p"]
warn: unrecognized inline tag: ["p"]
Traceback (most recent call last):
	23: from /home/travis/.rvm/gems/ruby-2.6.1/bin/ronn:23:in `<main>'
	22: from /home/travis/.rvm/gems/ruby-2.6.1/bin/ronn:23:in `load'
	21: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/bin/ronn:184:in `<top (required)>'
	20: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/bin/ronn:184:in `each'
	19: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/bin/ronn:199:in `block in <top (required)>'
	18: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/bin/ronn:199:in `each'
	17: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/bin/ronn:220:in `block (2 levels) in <top (required)>'
	16: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/document.rb:238:in `convert'
	15: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/document.rb:243:in `to_roff'
	14: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/document.rb:243:in `new'
	13: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/roff.rb:18:in `initialize'
	12: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/roff.rb:91:in `block_filter'
	11: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/roff.rb:88:in `block_filter'
	10: from /home/travis/.rvm/gems/ruby-2.6.1/gems/nokogiri-1.10.1/lib/nokogiri/xml/node_set.rb:237:in `each'
	 9: from /home/travis/.rvm/gems/ruby-2.6.1/gems/nokogiri-1.10.1/lib/nokogiri/xml/node_set.rb:237:in `upto'
	 8: from /home/travis/.rvm/gems/ruby-2.6.1/gems/nokogiri-1.10.1/lib/nokogiri/xml/node_set.rb:238:in `block in each'
	 7: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/roff.rb:88:in `block in block_filter'
	 6: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/roff.rb:160:in `block_filter'
	 5: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/roff.rb:88:in `block_filter'
	 4: from /home/travis/.rvm/gems/ruby-2.6.1/gems/nokogiri-1.10.1/lib/nokogiri/xml/node_set.rb:237:in `each'
	 3: from /home/travis/.rvm/gems/ruby-2.6.1/gems/nokogiri-1.10.1/lib/nokogiri/xml/node_set.rb:237:in `upto'
	 2: from /home/travis/.rvm/gems/ruby-2.6.1/gems/nokogiri-1.10.1/lib/nokogiri/xml/node_set.rb:238:in `block in each'
	 1: from /home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/roff.rb:88:in `block in block_filter'
/home/travis/.rvm/gems/ruby-2.6.1/gems/ronn-ng-0.8.0.SNAPSHOT/lib/ronn/roff.rb:165:in `block_filter': undefined method `position' for #<Nokogiri::XML::Element:0x0000000002465008> (NoMethodError)

In order to reproduce, you can clone bundler, replace the ronn development dependency with ronn-ng, and then run bin/rake spec:deps followed by bin/rake man:build.

Thanks!

roff output contains <var>…</var> if \< and \> are used in Markdown

Hi,

Backgorund

Github didn't render the following synopsis as wanted:

`pxzgrep` [`-p`<n>] [`-V`] [<xzgrep options>] <pattern> <file1> <file2> [<more files>]

It was rendered by Github to

pxzgrep [-p] [-V] [] []

Which is actually correct as it parsed the words in angle brackets as HTML tags.

ronn though parsed it as wanted and rendered the parts in angle brackets in green (probably italics elsewhere):

pxzgrep [-pn] [-V] [xzgrep options] pattern file1 file2 [more files]

So I changed it to use escaped angle brackets as common in Markdown:

`pxzgrep` [`-p`\<n\>] [`-V`] [\<xzgrep options\>] \<pattern\> \<file1\> \<file2\> [\<more files\>]

Now Github shows it as wanted:

pxzgrep [-p<n>] [-V] [<xzgrep options>] <pattern> <file1> <file2> [<more files>]

Issue

But instead the output in the ronn-generated man page now looks like this:

pxzgrep  [-p<var>n</var>]  [-V] [<var>xzgrep options</var>] <var>pattern</var> <var>file1</var <var>file2</var> [<var>more files</var>]

It looks like HTML syntax inside roff which is surely not what's wanted.

Version

ronn version 0.9.1 as packaged in Debian Unstable in package version 0.9.1-1.

Add Homebrew formula

Since ronn-ng is a binary that comes with shell completion files and the like, a straight gem install isn't adequate to get it all set up. Better to have it distributed by package managers.

Create a Homebrew formula in a custom tap to get it started.

Need to figure out what to do for Linux, too. I don't want to maintain packages for the various Linux distros.

crash - `gsub': incompatible encoding regexp match

After a fresh ronn install with apt install ronn (Ronn-NG v0.8.0) on Kubuntu 20.04, I get this error:

ronn --roff --pipe ./doc/amethyst_man.md > ./build/report/amethyst.1
Traceback (most recent call last):
        23: from /usr/bin/ronn:184:in `<main>'
        22: from /usr/bin/ronn:184:in `each'
        21: from /usr/bin/ronn:199:in `block in <main>'
        20: from /usr/bin/ronn:199:in `each'
        19: from /usr/bin/ronn:220:in `block (2 levels) in <main>'
        18: from /usr/lib/ruby/vendor_ruby/ronn/document.rb:240:in `convert'
        17: from /usr/lib/ruby/vendor_ruby/ronn/document.rb:245:in `to_roff'
        16: from /usr/lib/ruby/vendor_ruby/ronn/document.rb:245:in `new'
        15: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:18:in `initialize'
        14: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:91:in `block_filter'
        13: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:88:in `block_filter'
        12: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:237:in `each'
        11: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:237:in `upto'
        10: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:238:in `block in each'
         9: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:88:in `block in block_filter'
         8: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:120:in `block_filter'
         7: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:243:in `inline_filter'
         6: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:237:in `each'
         5: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:237:in `upto'
         4: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:238:in `block in each'
         3: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:243:in `block in inline_filter'
         2: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:247:in `inline_filter'
         1: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:354:in `write'
/usr/lib/ruby/vendor_ruby/ronn/roff.rb:354:in `gsub': incompatible encoding regexp match (Windows-31J regexp with UTF-8 string) (Encoding::CompatibilityError)

The single quote char (ASCII 39) is rendered as UTF apostrophe in roff

Thank you for the very useful tool.

Unfortunately I have found an issue: ronn translates single quote chars (this ') into apostrophe (this ´).

This causes a number of drawbacks:

  • code blocks cannot be copy-paste into source code files
  • debian lintian complaints:
    "acute-accent-in-manual-page: This manual page uses the \' groff sequence. Usually, the intent to generate an apostrophe, but that sequence actually renders as a an acute accent."

The following file is an example of erroneously rendered man page.
quote_error.7.ronn.txt

IMHO the single quote should be a control char only when it is at the beginning of a line, so it shouldn't be escaped.
Here the following patch seems to generate the right roff translation of the man pages.

diff --git a/lib/ronn/roff.rb b/lib/ronn/roff.rb
index 3af434e..ac65042 100644
--- a/lib/ronn/roff.rb
+++ b/lib/ronn/roff.rb
@@ -339,7 +339,7 @@ module Ronn
       text.gsub!(/&#(\d+);/) { $1.to_i.chr }                # dec entities
       text.gsub!('\\', '\e')                                # backslash
       text.gsub!('...', '\|.\|.\|.')                        # ellipses
-      text.gsub!(/['.-]/) { |m| "\\#{m}" }                  # control chars
+      text.gsub!(/[.-]/) { |m| "\\#{m}" }                   # control chars
       ent.each do |key, val|
         text.gsub!(key, val)
       end

HTML-style comment causes RuntimeError

nabijaczleweli@babtop:/tmp$ cat owo.md
There exists no other user-land tool for decrypting this. <!-- (TODO: make an LD_PRELOADable for extracting the key maybe) -->
nabijaczleweli@babtop:/tmp$ ronn owo.md
     roff: ./owo
Traceback (most recent call last):
        21: from /usr/bin/ronn:196:in `<main>'
        20: from /usr/bin/ronn:196:in `each'
        19: from /usr/bin/ronn:211:in `block in <main>'
        18: from /usr/bin/ronn:211:in `each'
        17: from /usr/bin/ronn:221:in `block (2 levels) in <main>'
        16: from /usr/lib/ruby/vendor_ruby/ronn/document.rb:243:in `convert'
        15: from /usr/lib/ruby/vendor_ruby/ronn/document.rb:248:in `to_roff'
        14: from /usr/lib/ruby/vendor_ruby/ronn/document.rb:248:in `new'
        13: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:18:in `initialize'
        12: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:95:in `block_filter'
        11: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:92:in `block_filter'
        10: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:237:in `each'
         9: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:237:in `upto'
         8: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:238:in `block in each'
         7: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:92:in `block in block_filter'
         6: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:124:in `block_filter'
         5: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:247:in `inline_filter'
         4: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:237:in `each'
         3: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:237:in `upto'
         2: from /usr/lib/ruby/vendor_ruby/nokogiri/xml/node_set.rb:238:in `block in each'
         1: from /usr/lib/ruby/vendor_ruby/ronn/roff.rb:247:in `block in inline_filter'
/usr/lib/ruby/vendor_ruby/ronn/roff.rb:305:in `inline_filter': unexpected node: #<Nokogiri::XML::Comment:0x2f8 " (TODO: make an LD_PRELOADable for extracting the key maybe) "> (RuntimeError)

Specifying both --html and --fragment outputs just the fragment

Consider:

nabijaczleweli@tarta:~/code/klapki/man$ ls
index.txt  klapki.md
nabijaczleweli@tarta:~/code/klapki/man$ ronn -f5 klapki.md
html_fragment: ./klapki.8.html_fragment
nabijaczleweli@tarta:~/code/klapki/man$ ls
index.txt  klapki.8.html_fragment  klapki.md

Manpages generated via --pipe don't have .TH macro

It seems like the only method for getting a complete manpage is for ronn to pull the manpage title and section (first two elements of the .TH roff macro) from the filename, e.g. foo.3.md will be the FOO.3.MD manpage from section '3'. If the page is processed as a pipe, the .TH element is completely missing. There are no command-line flags to inject those two elements into the process, so any manpages processed in this way are incomplete.

Also, ronn uses the full filename as the page title, including the section number and .md extension. It's able to pull the section number out properly, but drops any parsing for the page title. A quick test with filename input.3.md:

.\" generated with Ronn-NG/v0.8.2
.\" http://github.com/apjanke/ronn-ng/tree/0.8.2
.TH "INPUT\.3\.MD" "3" "August 2019" "Testing" "Testing Manual"
.SH "NAME"
Testing \- a test of ronn
.SH "SYNOPSIS"
test stuff
.SH "DESCRIPTION"
This is a test manpage for testing out ronn\.
.SH "RELATED"
Nothing\.

That title ought to be "INPUT", rather than the full filename. If we drop the .md extension and call the file input.3, we get a proper title, but no longer any section number:

.TH "INPUT" "" "August 2019" "Testing" "Testing Manual"

I guess what I'm suggesting with all of this is a couple new command-line flags, --title and --section, both to allow ronn to function as a pipe, and also to ease the behaviours around its sensing of those parameters.

All this was done with the latest release:

$ ronn --version
Ronn-NG v0.8.2
http://github.com/apjanke/ronn-ng/tree/0.8.2

Incorrect attributes in generated `meta` tags

In the HTML output, there are a couple meta tags being generated by Ronn.

  <meta http-equiv='content-type' value='text/html;charset=utf8'>
  <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>

I think these are invalid. The meta element doesn't take a name attribute; it takes a content attribute instead. These should be:

  <meta http-equiv='content-type' content='text/html;charset=utf8'>
  <meta name='generator' content='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>

Copied from rtomayko/ronn#106

Linux packaging

For distribution on Linux, I'd like to get Ronn-NG supported by major Linux distributions' package managers. Figure out how to do that.

Questions to consider:

  • How to announce the project to Linux packagers?
  • How mature should the project be before doing so? How likely are package managers to accept it?
  • Would a Makefile with a make install that works on Linux be a good short-term substitute?

Spurious default empty title

Renzo Davoli writes:


If the --manual is missing ronn generates an empty central header.
e.g.

$	ronn -r ronn.1.ronn
     roff: ./ronn.1
$ man -l ronn.1
------------------------------------------------------------------------------
RONN(1)                                                                RONN(1)

NAME
       ronn - convert markdown files to manpages

.....
------------------------------------------------------------------------------

Taking a look at nroff generated source:

.\" generated with Ronn-NG/v0.8.0
.\" http://github.com/apjanke/ronn-ng/tree/0.8.0
.TH "RONN" "1" "October 2019" "" ""
.SH "NAME"
....

Ronn generates an empty header because .TH has "" as its fifth argument.

if I change the line to:

.TH "RONN" "1" "October 2019" ""

man generates the standard header for the manual section:

------------------------------------------------------------------------------
RONN(1)                     General Commands Manual                    RONN(1)

NAME
       ronn - convert markdown files to manpages

------------------------------------------------------------------------------

which is a nicer output.

The patch to solve this problem shouldn't be too complex.
If neither the option --manual nor the env var RONN_MANUAL are defined
skip the final arg of .SH.

(those who really want an empty header can use --manual " ").


I think this is a good idea. Let's make this the default behavior.

Add automatic linking to markdown

Hi,

I'm starting to work with your tool to make man-pages for my app.
I've managed to get the automatic linking feature working in the HTML files with index.txt.

I want to publish also the markdown version to GitHub Wiki, is there a way to make the automatic linking working also in markdown output? (--markdown option)

Thanks in advance

"open-ended dependency" warnings when building gem

Fix these.

$ rake package                                                             master
mkdir -p pkg/
updated ronn-ng.gemspec
gem build ronn-ng.gemspec
WARNING:  open-ended dependency on nokogiri (>= 1.9.0) is not recommended
  if nokogiri is semantically versioned, use:
    add_runtime_dependency 'nokogiri', '~> 1.9', '>= 1.9.0'
WARNING:  open-ended dependency on rdiscount (>= 2.0.7) is not recommended
  if rdiscount is semantically versioned, use:
    add_runtime_dependency 'rdiscount', '~> 2.0', '>= 2.0.7'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: ronn-ng
  Version: 0.8.0
  File: ronn-ng-0.8.0.gem
mv ronn-ng-0.8.0.gem pkg/ronn-ng-0.8.0.gem
    git archive --prefix=ronn-0.8.0/ --format=tar HEAD |
    gzip > pkg/ronn-ng-0.8.0.tar.gz

Set up rubygems distribution

Need to set up Rubygems distribution for my new Ronn-NG fork. It needs to be a distinct project/gem name ("ronn-ng"), but be a drop-in replacement for Ronn code-wise.

Cannot render circumflex

Copied from rtomayko/ronn#101.

The following Markdown snippet contains a circumflex but it is discarded (or converted to an "=") in the conversion to roff. There does not appear to be a way to render a circumflex.

[~/tmp/ronn-test/render-circumflex]
$ cat test.md                                                                                                                             ✘ 1
# test - render a circumflex

## DESCRIPTION

We are trying to render a circumflex.

y = 2^x

[~/tmp/ronn-test/render-circumflex]
$ ronn test.md
warn: cannot load such file -- ronn. adding /Users/janke/local/repos/ronn-ng/lib to RUBYLIB ...
     roff: ./test
warn: unrecognized inline tag: "sup"
     html: ./test.html                                           +man
[~/tmp/ronn-test/render-circumflex]
$ cat test
.\" generated with Ronn-NG/v0.7.3
.\" http://github.com/apjanke/ronn-ng/tree/0.7.3
.
.TH "TEST" "" "December 2018" "" ""
.
.SH "NAME"
\fBtest\fR \- render a circumflex
.
.SH "DESCRIPTION"
We are trying to render a circumflex\.
.
.P
y = 2
[~/tmp/ronn-test/render-circumflex]
$

Rendering acute accent instead of apostrophe

Some packages in Debian have this lintian report on rendering acute accent instead of apostrophe. This look like a bug in Roon-NG.

Testing file:

manpage(1) -- My manpage
============================================

## DESCRIPTION

This won't generate an apostrophe.

ronn invocation:

$ ronn --roff < test.md > test.1

Manual output:

.\" generated with Ronn-NG/v0.9.1
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
.TH "MANPAGE" "1" "December 2020" ""
.SH "NAME"
\fBmanpage\fR \- My manpage
.SH "DESCRIPTION"
This won\'t generate an apostrophe\.

It looks like \' should be '.

"Unrecognized inline tag" warnings ("dot." and "ws-name") in tests

Let's try to clean this up, shall we?

[ronn-ng] $ bundle exec rake test | cat
Loaded suite /usr/local/lib/ruby/gems/2.7.0/bin/rake
Started
......................................warn: unrecognized inline tag: ["dot."]
............warn: unrecognized inline tag: ["ws-name"]
warn: unrecognized inline tag: ["ws-name"]
....................
Finished in 13.130951 seconds.
-------------------------------------------------------------------------------
70 tests, 112 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-------------------------------------------------------------------------------
5.33 tests/s, 8.53 assertions/s
[ronn-ng] $

See also: #44 "When generating html, ronn-ng may convert ws-name...".

Support pandoc-compatible front matter

Related to #33, it would be great if ronn could support the front matter pandoc uses:

---
title: COMMAND
section: 1
header: User Commands
footer: command
---

NAME
====

command - short description

SYNOPSIS
========

**command** [*OPTION*]... ...

(for this specific Markdown source it would also need to support this style of headings too)

Roff output force-adds a specific NAME section

My markdown documents have their own NAME sections, because I want them to look mostly like manpages before I do any processing on them. ronn adds another NAME section, even though one already exists.

Testing file:

# Test #

## NAME ##

test - the test manpage

## DESCRIPTION ##

Testing items.  w00t!

ronn invocation:

$ ronn --roff --pipe --name 'Testing' --section=9 --manual='Testing manual' --organization='Testers, Inc.' --date='2019-08-19' < test.md > test.9

Manual output:

TESTING(9)                      Testing manual                      TESTING(9)

NAME
       Testing - Test

NAME
       test - the test manpage

DESCRIPTION
       Testing items. w00t!

Testers, Inc.                     August 2019                       TESTING(9)

It looks like there's some logic in Ronn::Document to handle the various ways in which the document name can enter the processing, but they seem to assume that they should always add a NAME section. If I move the contents of my NAME section into the top header in the Markdown document, and drop the --name command line flag, ronn will format the resulting manpages correctly, but I lose the manpage format - specifically the NAME section - that I want in the original Markdown documents.

When generating html, ronn-ng may convert &lt;ws-name&gt; to <ws-name> </ws-name>

When I try to convert a markdown file to html,

text below

git bulk [-g] ([-a]|[-w &lt;ws-name&gt;]) &lt;git command&gt; <br/>
git bulk --addworkspace &lt;ws-name&gt; &lt;ws-root-directory&gt; (--from &lt;URL or file&gt;) <br/>
git bulk --removeworkspace &lt;ws-name&gt; <br/>

is incorrectly converted to

<p>git bulk [-g] ([-a]|[-w <ws-name>]) <git command> </git></ws-name><br>
git bulk --addworkspace <ws-name> <ws-root-directory> (--from <url or file>) </url></ws-root-directory></ws-name><br>
git bulk --removeworkspace &lt;ws-name&gt; <br>

The markdown file I use is from https://github.com/tj/git-extras/blob/master/man/git-bulk.md.
The command I run is:

ronn -r \
        --manual "Git Extras" \
        --pipe \
        man/git-bulk.md > man/git-bulk.html

Write ".wrong" files with their proper extension

The "wrong" files generated by tests have the .wrong extension. So editors don't recognize them and highlight their syntax. Modify the file name creation logic to end the "wrong" files with the appropriate extension.

Invalid byte sequence in US-ASCII

Hi,

I just installed the last version of ronn-ng (0.9.0), I'm using Ruby 2.7.0p0 (2019-12-25 revision 647ee6f091).
I'm trying to build to HTML a ronn document and I've got this error.

Traceback (most recent call last):
	16: from /usr/local/bundle/bin/ronn:23:in `<main>'
	15: from /usr/local/bundle/bin/ronn:23:in `load'
	14: from /usr/local/bundle/gems/ronn-ng-0.9.0/bin/ronn:186:in `<top (required)>'
	13: from /usr/local/bundle/gems/ronn-ng-0.9.0/bin/ronn:186:in `each'
	12: from /usr/local/bundle/gems/ronn-ng-0.9.0/bin/ronn:201:in `block in <top (required)>'
	11: from /usr/local/bundle/gems/ronn-ng-0.9.0/bin/ronn:201:in `each'
	10: from /usr/local/bundle/gems/ronn-ng-0.9.0/bin/ronn:222:in `block (2 levels) in <top (required)>'
	 9: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:238:in `convert'
	 8: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:264:in `to_html'
	 7: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:272:in `to_html_fragment'
	 6: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:232:in `html'
	 5: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:325:in `process_html!'
	 4: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:310:in `input_html'
	 3: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:227:in `markdown'
	 2: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:319:in `process_markdown!'
	 1: from /usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:353:in `markdown_filter_heading_anchors'
/usr/local/bundle/gems/ronn-ng-0.9.0/lib/ronn/document.rb:353:in `split': invalid byte sequence in US-ASCII (ArgumentError)

Thanks

Replace hpricot with nokogiri

According to its GitHub page, hpricot has ended and is no longer supported. Find a currently-supported replacement, like Nokogiri.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.