README.md in ruby-dap-0.1.2 vs README.md in ruby-dap-0.1.3

- old
+ new

@@ -1,5 +1,7 @@ +[![Gem Version](https://badge.fury.io/rb/ruby-dap.svg)](https://badge.fury.io/rb/ruby-dap) [![Documentation](https://img.shields.io/static/v1?label=docs&message=master&color=informational&style=flat)](https://firelizzard.gitlab.io/ruby-dap/) + # Ruby Debug Adapter Protocol This gem provides models, parsers, and formatters for the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol). @@ -9,8 +11,20 @@ from the [DAP specification](https://microsoft.github.io/debug-adapter-protocol/specification) to Ruby classes. To regenerate the Ruby classes, set `PRETEND = false` in the file and run `echo <spec> | ruby convert.rb -` or `ruby convert.rb <spec-file>`. If the input contains multiple files, `convert.rb` expects them to be separated -with `\n\n// ---\n\n`. All of the specs can be extracted at once by running -`$('.language-typescript').toArray().map(x => x.innerText).join('\n\n// ----\n\n')` in the browser JavaScript console. +with `\n\n// ---\n\n`. All of the specs can be extracted at once by running the +following in the browser JavaScript console: + + +```javascript +$('.language-typescript').toArray().map(x => { + let t = x.innerText; + x = $(x); + let s = []; + for (x = x.prev('p, ul'); x.length; x = x.prev('p, ul')) + s.unshift(...x.text().split('\n').filter(x => x.indexOf('Values: ') != 0)); + if (!s.length) return t; + return s.map(x => '// ' + x).join('\n') + '\n' + t; +}).join('\n\n// ---\n\n') +```