{"id":14065512,"url":"https://github.com/foliant-docs/foliantcontrib.dbmldoc","last_synced_at":"2026-04-03T08:36:32.769Z","repository":{"id":92058819,"uuid":"257836371","full_name":"foliant-docs/foliantcontrib.dbmldoc","owner":"foliant-docs","description":"Documentation generator for DBML sepcification format","archived":false,"fork":false,"pushed_at":"2023-06-15T17:26:23.000Z","size":24,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-04T04:33:43.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/foliant-docs.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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}},"created_at":"2020-04-22T08:17:12.000Z","updated_at":"2024-09-10T00:50:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca60349a-e5b0-46ae-bb37-0d9c923e75b8","html_url":"https://github.com/foliant-docs/foliantcontrib.dbmldoc","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/foliant-docs/foliantcontrib.dbmldoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.dbmldoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.dbmldoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.dbmldoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.dbmldoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foliant-docs","download_url":"https://codeload.github.com/foliant-docs/foliantcontrib.dbmldoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foliant-docs%2Ffoliantcontrib.dbmldoc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267754851,"owners_count":24139435,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"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":[],"created_at":"2024-08-13T07:04:32.001Z","updated_at":"2025-12-14T19:13:53.590Z","avatar_url":"https://github.com/foliant-docs.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![](https://img.shields.io/pypi/v/foliantcontrib.dbmldoc.svg)](https://pypi.org/project/foliantcontrib.dbmldoc/)  [![](https://img.shields.io/github/v/tag/foliant-docs/foliantcontrib.dbmldoc.svg?label=GitHub)](https://github.com/foliant-docs/foliantcontrib.dbmldoc)\n\n# DBML Docs Generator for Foliant\n\nThis preprocessor generates Markdown documentation from [DBML](https://www.dbml.org/) specification files . It uses [PyDBML](https://github.com/Vanderhoof/PyDBML) for parsing DBML syntax and [Jinja2](http://jinja.pocoo.org/) templating engine for generating Markdown.\n\n## Installation\n\n```bash\n$ pip install foliantcontrib.dbmldoc\n```\n\n## Config\n\nTo enable the preprocessor, add `dbmldoc` to `preprocessors` section in the project config:\n\n```yaml\npreprocessors:\n    - dbmldoc\n```\n\nThe preprocessor has a number of options:\n\n```yaml\npreprocessors:\n    - dbmldoc:\n        spec_url: http://localhost/scheme.dbml\n        spec_path: scheme.dbml\n        doc: true\n        scheme: true\n        template: dbml.j2\n        scheme_template: scheme.j2\n\n```\n\n`spec_url`\n:    URL to DBML spec file. If it is a list — preprocessor uses the first url which works.\n\n`spec_path`\n:    Local path to DBML spec file (relative to project dir).\n\n\u003e If both url and path params are specified — preprocessor first tries to fetch spec from url, and only if that fails looks for the file on the local path.\n\n`doc`\n:   If `true` — documentation will be generated. Set to `false` if you only want to draw a scheme of the database. Default `true`\n\n`scheme`\n:   If `true` — the platuml code for database scheme will be generated. Default `true`\n\n`template`\n:   Path to jinja-template for rendering the generated documentation. Path is relative to the project directory. If no template is specified preprocessor will use default template (and put it into project dir if it was missing). Default: `dbml.j2`\n\n\u003e Note that the default template may be outdated. Please check if everything works, and if needed — update the template.\n\n`scheme_template`\n:   Path to jinja-template for generating planuml code for the database scheme. Path is relative to the project directory. If no template is specified preprocessor will use default template (and put it into project dir if it was missing). Default: `scheme.j2`\n\n## Usage\n\nAdd a `\u003cdbmldoc\u003e\u003c/dbmldoc\u003e` tag at the position in the document where the generated documentation should be inserted:\n\n```html\n# Introduction\n\nThis document contains the automatically generated documentation of our Database schema.\n\n\u003cdbmldoc\u003e\u003c/dbmldoc\u003e\n```\n\nEach time the preprocessor encounters the tag `\u003cdbmldoc\u003e\u003c/dbmldoc\u003e` it inserts the whole generated documentation text instead of it. The path or url to DBML spec file is taken from foliant.yml.\n\nYou can also override some parameters (or all of them) in the tag options:\n\n```markdown\n# Introduction\n\nIntroduction text for API documentation.\n\n\u003cdbmldoc spec_url=\"http://localhost/schema.dbml\"\n         template=\"dbml.j2\"\n         scheme=\"false\"\u003e\n\u003c/dbmldoc\u003e\n\n# Database scheme\n\nAnd here goes a visual diagram of our database:\n\n\u003cdbmldoc doc=\"false\" scheme=\"true\"\u003e\n\u003c/dbmldoc\u003e\n```\n\n\u003e Note that template path in tag is stated **relative to the markdown file**.\n\nTag parameters have the highest priority.\n\nThis way you can put your database description in one place and its diagram in the other (like in the example above). Or you can even have documentation from several different DBML spec files in one Foliant project.\n\n## Customizing output\n\nThe output markdown is generated by the [Jinja2](http://jinja.pocoo.org/) template. Inside the template all data from the parsed DBML file is available under the `data` variable. It is in fact a `PyDBMLParseResults` object, as returned by [PyDBML](https://github.com/Vanderhoof/PyDBML) (see the docs to find out which attributes are available).\n\nTo customize the output create a template which suits your needs. Then supply the path to it in the `template` parameter. Same goes for the scheme template, which is defined in the `scheme_template` parameter.\n\nIf you wish to use the default template as a starting point, build the foliant project with `dbmldoc` preprocessor turned on. After the first build the default templates will appear in your foliant project dir under the names `dbml.j2` and `scheme.j2`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.dbmldoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.dbmldoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoliant-docs%2Ffoliantcontrib.dbmldoc/lists"}