{"id":51605303,"url":"https://github.com/gemmaro/ruby-mandoc","last_synced_at":"2026-07-12T01:31:47.541Z","repository":{"id":368784756,"uuid":"1286803206","full_name":"gemmaro/ruby-mandoc","owner":"gemmaro","description":"[MIRROR] mandoc binding for Ruby.  GitHub Pages: https://gemmaro.github.io/ruby-mandoc/","archived":false,"fork":false,"pushed_at":"2026-07-02T06:33:19.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-02T08:18:22.608Z","etag":null,"topics":["gem","library","man","mandoc","mdoc","parser","roff","ruby"],"latest_commit_sha":null,"homepage":"https://codeberg.org/gemmaro/ruby-mandoc","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gemmaro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-02T05:40:51.000Z","updated_at":"2026-07-02T06:33:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gemmaro/ruby-mandoc","commit_stats":null,"previous_names":["gemmaro/ruby-mandoc"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gemmaro/ruby-mandoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemmaro%2Fruby-mandoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemmaro%2Fruby-mandoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemmaro%2Fruby-mandoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemmaro%2Fruby-mandoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gemmaro","download_url":"https://codeload.github.com/gemmaro/ruby-mandoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemmaro%2Fruby-mandoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35379590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem","library","man","mandoc","mdoc","parser","roff","ruby"],"created_at":"2026-07-12T01:31:47.348Z","updated_at":"2026-07-12T01:31:47.536Z","avatar_url":"https://github.com/gemmaro.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mandoc for Ruby\n\nThis is a parser library for mdoc/man formats, which bases on roff\nformat.  This is implemented as a [mandoc][m] binding for Ruby.\n\nPlease not that libmandoc interface is [*not* particularly\nrecommended][lm] officially.  That said, as far as I consider, mandoc\nis the best for this purpose.\n\nProject links: [repository][cb], [mirror][gh]\n\n[lm]: https://mandoc.bsd.lv/libmandoc.html\n[cb]: https://codeberg.org/gemmaro/ruby-mandoc\n[gh]: https://github.com/gemmaro/ruby-mandoc\n[m]: https://mandoc.bsd.lv/\n\n## Installation\n\nInstall the gem and add to the application's `Gemfile` by executing:\n\n```bash\nbundle add mandoc\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n```bash\ngem install mandoc\n```\n\n## Usage\n\nThis gem can parse manpages in files and examine metadata, walk\nabstract syntax tree (AST), and converts into some formats.  Please\nrefer to the API document for details.\n\n```ruby\nrequire \"mandoc\"\n\nparser = Mandoc::Parser.new\n\n# \"meta\" is something like \"document\".\nmeta = parser.parse_file(path_to_mandoc_1)\nmeta.section  #=\u003e \"1\"\nmeta.title    #=\u003e \"MANDOC\"\n\nmeta.markdown #=\u003e rendered string in Markdown\n\n# Walk AST\nroot = meta.first_node\nroot.first_child.next_sibling.name #=\u003e \"Dt\"\n```\n\n## Development\n\nFirst, you have to download mandoc sources.  The `bin/download` script\ndownloads the tarball.  Then extract into, e.g. `mandoc-1.14.6/`.\n\nThen generate `config.h` file of mandoc.  Please refer to\n`bin/configure` script to do this.\n\nRun `bin/setup` to install dependencies. Then, run `rake test` to run\nthe tests. You can also run `bin/console` for an interactive prompt\nthat will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake\ninstall`. To release a new version, update the version number in\n`version.rb`, and then run `bundle exec rake release`, which will\ncreate a git tag for the version, push git commits and the created\ntag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\nOn OpenBSD, and if you are using packaged `ruby`, native compilation\ncan fail because `install` command has `-o root -g bin` flags.  You\ncan overwrite the behavior; please refer to `bin/compile` script.\n\nOn Guix, edit `CC=` line in `mandoc-1.14.6/configure` script.  For\nexample, if using GCC, change to `CC=gcc`.\n\nReferences: [my past project which uses similar mkmf strategy][re]\n\n[re]: https://github.com/gemmaro/ruby-eldc\n\n## Contributing\n\nBug reports and pull requests are welcome.\n\n## Prior Works\n\nThere are few libraries which parses manpages in mdoc/man/roff\nformats.  [man\\_parser][mp] gem is a very concise parser\nimplementation written in pure Ruby.\n\nThe ronn gem is for converting Markdown-like format into roff/HTML,\nbut not for parsing existing man pages.  The md2man gem and the\nkramdown-man also have a same idea.\n\n[mp]: https://github.com/grosser/man_parser\n\n## License\n\nThe gem archive contains some files from the mandoc sources, which is\ndistributed under the ISC license.  Please refer to the\n`mandoc-*.*.*/LICENSE` file in the archive.\n\nThis mandoc gem itself is distributed under the following license:\n\nCopyright (C) 2026  gemmaro\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemmaro%2Fruby-mandoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgemmaro%2Fruby-mandoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemmaro%2Fruby-mandoc/lists"}