{"id":34705277,"url":"https://github.com/lemachinarbo/markdowntofields","last_synced_at":"2026-04-01T16:40:33.836Z","repository":{"id":330350765,"uuid":"1119929002","full_name":"lemachinarbo/MarkdownToFields","owner":"lemachinarbo","description":"Use markdown as your source of content in ProcessWire ","archived":false,"fork":false,"pushed_at":"2026-01-22T02:37:50.000Z","size":595,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-22T16:09:10.518Z","etag":null,"topics":["processwire","processwire-modules"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemachinarbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-12-20T05:55:10.000Z","updated_at":"2026-01-22T02:39:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lemachinarbo/MarkdownToFields","commit_stats":null,"previous_names":["lemachinarbo/markdowntofields"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/lemachinarbo/MarkdownToFields","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemachinarbo%2FMarkdownToFields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemachinarbo%2FMarkdownToFields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemachinarbo%2FMarkdownToFields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemachinarbo%2FMarkdownToFields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemachinarbo","download_url":"https://codeload.github.com/lemachinarbo/MarkdownToFields/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemachinarbo%2FMarkdownToFields/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28742983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T02:46:29.005Z","status":"ssl_error","status_checked_at":"2026-01-25T02:44:29.968Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["processwire","processwire-modules"],"created_at":"2025-12-24T23:17:43.021Z","updated_at":"2026-04-01T16:40:33.830Z","avatar_url":"https://github.com/lemachinarbo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Markdown to fields\nUse markdown as your content. Structure it with simple tags, and enjoy the markdown \u003c-\u003e ProcessWire fields sync. That’s MarkdownToFields.\n\nNeed help? See:\n\n- The [Why it's so long intro](#the-long-intro)\n- The [I'm lazy resume all to me, guide](#lazy-guide)\n- The [MarkdownToFields survival guide](./docs/guide.md) (aka The Docs)\n\n## The Long intro\n\nThe basic idea of this module is that you can convert any markdown file into a “structured content source” where content can be extracted via an API-style access, e.g. `$content-\u003efield-\u003etext`. We use the [LetMeDown parser](https://github.com/lemachinarbo/LetMeDown) (what’s in a name!) to turn your file into a tree of sections, blocks, and elements.\n\nThe markdown content can be edited in the Processwire admin or in your favorite editor, and you even can sync specific parts to Processwire fields (we only support text fields at the moment).\n\nSo, basically, what you write in markdown stays in… markdown, but gets synced to some* ProcessWire fields, and vice versa. Cool, right? Unnecessarily… but cool, right?\n\nYou can also use frontmatter as page metadata. So things like `title`, `name` can get synced to their respective fields.\n\nNote: For a rich markdown editing experience, use [MarkdownToFieldsFrontEditor](https://github.com/lemachinarbo/MarkdownToFieldsFrontEditor), not this module.\n\n\n### Quick FAQ\n\n**Q: Wait, what? So you’re telling me that the whole markdown is the content, not the Procewsswire Fields, and that you only support syncing of basic text fields?**\n\n**A:** Yes.\n\n**Q: So it’s not Markdown to fields, but markdown to FIELD. Where are the repeaters, the page reference fields, the juicy ones? What’s the point?**\n\n**A:** Imagine this: you’re designing a website where each page has multiple blocks of content. Some blocks are text, some are images and text, some sliders, the whole marketing “I-want-a-page-like-an-Apple-website” package.\n\nYou start planning fields, repeaters, combos, multipliers, page references, the whole shebang. You think about how to recycle them, how to make them flexible, how to make them fit into any design. You end up with an admin page with 15 fields, some repeaters inside multipliers with page references inside. It works, it’s cool, but somehow all those fields make every edit page look like the screen of the person who helps you at the bank (whatever that means).\n\nOne day, while reading the [Latte docs](https://latte.nette.org/en/guide) I noticed this message:\n\n```\nFound a problem with this page?\nShow on GitHub (then press E to edit)\n```\n\nThe whole content of the page was text files. And I felt the darkest envy. \n\nBut from that evil envy, a question arose: Can I reduce all that PW multiple-field experience to a single field/text experience?\n\nSo there I was, writing my page in markdown like the “first” human who ever had the idea:\n\n```markdown\n---\ntitle: I wasn’t copying the Apple page\nname: about-us\n---\n\u003c!-- section:hero --\u003e\n\n# Welcome\n\u003c!-- description --\u003e\nIt all started with a pineapple…\n\n\u003c!-- slider --\u003e\n![First slider image](hero.jpg)\n![Second slider image](hero.jpg)\n\n\u003c!-- section:features --\u003e\n## Our Features\n\n\u003c!-- left --\u003e\nSome text…\n\n\u003c!-- right --\u003e\n- Feature one\n- Feature two\n```\n\n**Q: Now I get your point. But are you aware that by writing content in markdown files and skipping the “real” fields, you basically lose all the benefits of a database, right?**\n\n**A:** Oh crap… I think, er, no, I mean, er, yes, but it's all wrong. That is, I think I disagree.\n\n## Lazy guide\n\nFull docs live in [The MarkdownToFields survival guide](./docs/guide.md)\n\n### 1. Install\n\nCopy module to `site/modules/MarkdownToFields/` and install via Admin → Modules.\n\n### 2. Add the trait\n\nAdd the trait to your Page class:\n\n```php\n\u003c?php namespace ProcessWire;\n\nclass DefaultPage extends Page {\n  use MarkdownContent;\n}\n```\n\nTemplates extending this class get `$page-\u003econtent()`.\n\n### 3. Write markdown\n\nCreate a markdown file for your page.\n\nExample: `site/content/about.md`\n\n```markdown\n---\ntitle: About Us\n---\n\n\u003c!-- section:hero --\u003e\n\n\u003c!-- title --\u003e\n# Welcome\n\n\u003c!-- description --\u003e\nOur story begins in 2020…\n\n\u003c!-- team --\u003e\n![Team photo](team.jpg)\n```\n\n### 4. Use it in templates\n\nExample: `about.php`\n\n```php\n\u003c?php namespace ProcessWire;\n\n$content = $page-\u003econtent();\n\necho $content-\u003ehero-\u003etitle-\u003etext;\necho $content-\u003ehero-\u003edescription-\u003ehtml;\necho $content-\u003ehero-\u003eteam-\u003eimg-\u003eurl;\n```\n\nThat’s it.\n\n\n## Requirements\n\n- ProcessWire 3.x\n- PHP \u003e= 8.0\n\n\n## License\n\nUBC+P.\n\nUse it.\nBreak it.\nChange it.\nAnd if you make money, buy us some pizza.\n\nDeployed by [mutants.txt](mutants.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemachinarbo%2Fmarkdowntofields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemachinarbo%2Fmarkdowntofields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemachinarbo%2Fmarkdowntofields/lists"}