{"id":16567654,"url":"https://github.com/zepinglee/lua-bibtex-parser","last_synced_at":"2025-07-01T10:34:58.985Z","repository":{"id":190788372,"uuid":"680848643","full_name":"zepinglee/lua-bibtex-parser","owner":"zepinglee","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-15T14:59:47.000Z","size":25,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T04:38:23.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zepinglee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-08-20T15:51:57.000Z","updated_at":"2024-08-29T19:05:23.000Z","dependencies_parsed_at":"2023-08-26T11:40:53.231Z","dependency_job_id":"a2794db5-6d11-480b-a517-7d10bc56d9c6","html_url":"https://github.com/zepinglee/lua-bibtex-parser","commit_stats":null,"previous_names":["zepinglee/lua-bibtex-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zepinglee/lua-bibtex-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zepinglee%2Flua-bibtex-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zepinglee%2Flua-bibtex-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zepinglee%2Flua-bibtex-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zepinglee%2Flua-bibtex-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zepinglee","download_url":"https://codeload.github.com/zepinglee/lua-bibtex-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zepinglee%2Flua-bibtex-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262944632,"owners_count":23388795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-11T21:07:09.961Z","updated_at":"2025-07-01T10:34:58.953Z","avatar_url":"https://github.com/zepinglee.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lua-bibtex-parser\n\n\nPreviously I wrote a BibTeX parser for \u003chttps://github.com/zepinglee/citeproc-lua\u003e\nand I'm planning to make it a standalone project here. This parser is aimed\nat matching the original BibTeX's syntax.\n\n\n## Improvements (TODO)\n\n- Fault-tolerant: Able to parse files with syntax errors\n- Exporting matching the original\n- Easily modifying\n- Formatting options for writing\n\n\n## BibTeX grammar\n\nThe following PEG is largely based on \u003chttps://github.com/aclements/biblib\u003e\nwith small fixes after I checked the BibTeX source code [bibtex.web](https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/bibtex.web).\n\n\n```\nbib_db = comment (command_or_entry comment)*\n\ncomment = [^@]*\n\nws = [ \\t\\n]*\n\nident = ![0-9] (![ \\t\"#%'(),={}] [\\x20-\\x7f])+\n\ncommand_or_entry = '@' ws (comment_command / preamble / string / entry)\n\ncomment_command = 'comment' \u0026[ \\t\\n{(]\n\npreamble = 'preamble' ws ( '{' ws preamble_body ws '}'\n                            / '(' ws preamble_body ws ')' )\n\npreamble_body = value\n\nstring = 'string' ws ( '{' ws string_body ws '}'\n                        / '(' ws string_body ws ')' )\n\nstring_body = ident ws '=' ws value\n\nentry = ident ws ( '{' ws key ws entry_body? ws '}'\n                    / '(' ws key_paren ws entry_body? ws ')' )\n\nkey = [^, \\t}\\n]*\n\nkey_paren = [^, \\t\\n]*\n\nentry_body = (',' ws ident ws '=' ws value ws)* ','?\n\nvalue = field_token (ws '#' ws field_token)*\n\nfield_token\n    = [0-9]+\n    / '{' balanced* '}'\n    / '\"' (!'\"' balanced)* '\"'\n    / ident\n\nbalanced\n    = '{' balanced* '}'\n    / [^{}]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzepinglee%2Flua-bibtex-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzepinglee%2Flua-bibtex-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzepinglee%2Flua-bibtex-parser/lists"}