{"action":"created","issue":{"url":"https://api.github.com/repos/gizak/termui/issues/22","labels_url":"https://api.github.com/repos/gizak/termui/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/gizak/termui/issues/22/comments","events_url":"https://api.github.com/repos/gizak/termui/issues/22/events","html_url":"https://github.com/gizak/termui/pull/22","id":66491376,"number":22,"title":"Colored list #4","user":{"login":"Matt3o12","id":1218474,"avatar_url":"https://avatars.githubusercontent.com/u/1218474?v=3","gravatar_id":"","url":"https://api.github.com/users/Matt3o12","html_url":"https://github.com/Matt3o12","followers_url":"https://api.github.com/users/Matt3o12/followers","following_url":"https://api.github.com/users/Matt3o12/following{/other_user}","gists_url":"https://api.github.com/users/Matt3o12/gists{/gist_id}","starred_url":"https://api.github.com/users/Matt3o12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matt3o12/subscriptions","organizations_url":"https://api.github.com/users/Matt3o12/orgs","repos_url":"https://api.github.com/users/Matt3o12/repos","events_url":"https://api.github.com/users/Matt3o12/events{/privacy}","received_events_url":"https://api.github.com/users/Matt3o12/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-05T22:50:33Z","updated_at":"2015-04-22T08:07:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/gizak/termui/pulls/22","html_url":"https://github.com/gizak/termui/pull/22","diff_url":"https://github.com/gizak/termui/pull/22.diff","patch_url":"https://github.com/gizak/termui/pull/22.patch"},"body":"## Colored lists #4 ##\r\n\r\n**Don't merge, yet!**\r\n*The development has not quite finished, yet. This is just a preview.*\r\n\r\n![screen shot 2015-04-06 at 12 15 21 am](https://cloud.githubusercontent.com/assets/1218474/6998927/1756cf40-dbf2-11e4-994a-30c6f4e50e97.png)\r\n\r\n\r\nSo, that's what I've done so far:\r\n - I added the Markdown-flavored renderer (`MarkdownTextRenderer`) and the Noop renderer (`NoopRenderer`) as well as abstract interfaces and factories for these two.\r\n - I implemented these into the list.\r\n - I wrote a lot of unit tests so nothing will (hopefully) break.\r\n\r\nWhat needs to be done:\r\n - Fixing the regex (I don't know how to do that correctly. I'd appreciate someone's help.)\r\n - ~~Adding a ASCII escape code renderer.~~ (Done in a3f1384).\r\n - Tests under real work scenarios.\r\n - ~~Writing docs on how to implement it~~ (See: https://github.com/Matt3o12/termui/wiki/Color-Renderers)\r\n - ~~Refactoring the code (I need some advice from a native speaker here)[2] :)~~ (if you have any feedback, please give it now. Nothing is in the master branch, yet).\r\n - ~~Adding the renderers to other `Bufferer`-components?~~ Added in e9e3e40 (`Par` only).\r\n\r\n--- \r\n\r\n**How do I use/test the new text renderer?** \r\nJust do: `myList.RendererFactory = termui.MarkdownTextRendererFactory{}` :)\r\n\r\n**Are these changes backwards compatible?**\r\nShort: yes, at least when you used `NewList()` instead of `List{}` as you're supposed to.\r\n\r\nThese changes add a new field to the List: RendererFactory, which generates the `TextRenderer`s. `List` uses this field for generating the appropriate (colorful) output. If you didn't use the list constructor (`NewList()`), the compiler will yield an error because of a missing field.  \r\nIf you use the constructor, the constructor will set the field to `NoopRendererFactory` which will not generate any formatted output (as the name states: `No Operation`).\r\n\r\n--\r\n\r\nIf you have any question or feedback, just leave comment. \r\n\r\n---\r\n\r\n[1]: The [current regex](https://github.com/Matt3o12/termui/blob/colored-list/textRender.go#L22) implementation for finding text sequences that need formatting, doesn't work properly. It will not format: `[[ERROR]](red,bold) foo` correctly, which should normalize to: `[ERROR] foo`. Here is the current regex in action with example it should find (https://regex101.com/r/fC0gD1/1). Currently only one expression fails. \r\nIf you know a regex that will work, please let me know!\r\n\r\n[2]: Everything that formats a text is called `TextRenderer`. In my dictionary I couldn't find Renderer and I wonder if that is a word, which makes sense. If you find that this word fits properly, let me know. If it doesn't, could you suggest a better one?"},"comment":{"url":"https://api.github.com/repos/gizak/termui/issues/comments/95068806","html_url":"https://github.com/gizak/termui/pull/22#issuecomment-95068806","issue_url":"https://api.github.com/repos/gizak/termui/issues/22","id":95068806,"user":{"login":"gizak","id":2100512,"avatar_url":"https://avatars.githubusercontent.com/u/2100512?v=3","gravatar_id":"","url":"https://api.github.com/users/gizak","html_url":"https://github.com/gizak","followers_url":"https://api.github.com/users/gizak/followers","following_url":"https://api.github.com/users/gizak/following{/other_user}","gists_url":"https://api.github.com/users/gizak/gists{/gist_id}","starred_url":"https://api.github.com/users/gizak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gizak/subscriptions","organizations_url":"https://api.github.com/users/gizak/orgs","repos_url":"https://api.github.com/users/gizak/repos","events_url":"https://api.github.com/users/gizak/events{/privacy}","received_events_url":"https://api.github.com/users/gizak/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T08:07:39Z","updated_at":"2015-04-22T08:07:39Z","body":"Hi @Matt3o12, this is merged onto another branch `refactoring`, and I will use your code as a basic underlying text processing.\r\n\r\nThere is a lot of work need to be done for refactoring, but I think (hopefully) the branch will merge onto `master` soon."}}