nom icon indicating copy to clipboard operation
nom copied to clipboard

Replaces broken tutorial code with working example

Open ltrujello opened this issue 2 years ago • 2 comments

Hi,

This is a simple PR to fix some code in the documentation. The documentation itself is well written and gives newcomers a great idea for how this library is meant to be used, but the example code doesn't work. Others have pointed this out here.

I followed what the documentation code was attempting to do (it was trying to use the library as an example to parse HTTP request lines). So I put together the bare minimum to get the intended example working, keeping the original comments/typing as well.

I think this will get newcomers up and running with the library much faster and they'll be more motivated to use the library if the example code is working. Personally I still found the docs useful in understanding this library.

ltrujello avatar Dec 02 '22 08:12 ltrujello

As an alternative, I've been experimenting with different ideas for nom in a fork which includes pulling the various markdown files into docs.rs which

  • Puts all documentation in one place
  • Ensures the documentation at least compiles

See https://github.com/epage/nom-experimental/pull/1

epage avatar Dec 02 '22 14:12 epage

Looks very cool! Feel free to take what I wrote up if you like.

ltrujello avatar Dec 03 '22 01:12 ltrujello