{"id":30146578,"url":"https://github.com/sillyfreak/typst-moodular","last_synced_at":"2025-08-11T09:39:40.035Z","repository":{"id":309113495,"uuid":"1019520974","full_name":"SillyFreak/typst-moodular","owner":"SillyFreak","description":"Create Moodle activity content using Typst's HTML export","archived":false,"fork":false,"pushed_at":"2025-08-09T22:09:47.000Z","size":314,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-10T00:11:19.682Z","etag":null,"topics":["typst","typst-package"],"latest_commit_sha":null,"homepage":"https://typst.app/universe/package/moodular","language":"Typst","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/SillyFreak.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-14T13:03:52.000Z","updated_at":"2025-08-09T22:09:51.000Z","dependencies_parsed_at":"2025-08-10T00:11:24.488Z","dependency_job_id":"03cdb919-84ac-49fc-bddb-c8b425e8857f","html_url":"https://github.com/SillyFreak/typst-moodular","commit_stats":null,"previous_names":["sillyfreak/typst-moodular"],"tags_count":null,"template":false,"template_full_name":"SillyFreak/typst-package-template","purl":"pkg:github/SillyFreak/typst-moodular","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-moodular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-moodular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-moodular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-moodular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SillyFreak","download_url":"https://codeload.github.com/SillyFreak/typst-moodular/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-moodular/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269864161,"owners_count":24487576,"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-08-11T02:00:10.019Z","response_time":75,"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":["typst","typst-package"],"created_at":"2025-08-11T09:39:26.119Z","updated_at":"2025-08-11T09:39:40.004Z","avatar_url":"https://github.com/SillyFreak.png","language":"Typst","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moodular\n\nUse Typst's HTML export to generate content for your Moodle courses, but preview them faithfully in Tinymist or the webapp.\n\nThis package is somewhat opinionated, as it contains features tailored towards specific Moodle plugins used at our own school:\n\n- [Components for Learning (C4L)](https://componentsforlearning.org/) ([Atto](https://moodle.org/plugins/atto_c4l)/[TinyMCE](https://moodle.org/plugins/tiny_c4l) plugin): Moodular recreates the HTML structure of C4L blocks, and also renders them for PDF export. Most but not all components are currently supported; please [open an issue](https://github.com/SillyFreak/typst-moodular/issues) if you need a specific one.\n\nThe [gallery](https://github.com/SillyFreak/typst-moodular/tree/main/gallery) has an example document rendered as PDF, HTML, and screenshots of the Moodle-rendered HTML to get an idea of what the package does.\n\n## Getting Started\n\nTo add this package to your project, use this:\n\n````typ\n#import \"@preview/moodular:0.1.0\" as moodular: c4l\n\n#show: moodular.preview()  // if you only want HTML export, and use \"regular\" mode only to preview\n// or\n#show: moodular.export()   // if you want HTML and PDF export for your document\n\n// start writing\n\n#c4l.key-concept[#lorem(20)]\n\n```py\nprint(\"Hello, world!\")  # this is an example\n```\n````\n\nIn preview, that example looks like this:\n\n\u003cimg src=\"./thumbnail.svg\"\u003e\n\nExporting to HTML (and for now, manually extracting the `\u003cbody\u003e` tag) gives you this (line breaks inserted for preview purposes):\n\n```html\n\u003cp class=\"c4l-spacer\"\u003e\u003c/p\u003e\n\u003cdiv class=\"c4lv-keyconcept\" aria-label=\"Key concept\"\u003eLorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore\nmagnam aliquam quaerat.\u003c/div\u003e\n\u003cpre class=\"language-py\"\u003e\u003ccode\u003eprint(\"Hello, world!\")  # this is an example\u003c/code\u003e\u003c/pre\u003e\n```\n\n... which is almost identical to what you get when entering the same in Moodle using the TinyMCE editor with the C4L plugin.\n\nthe `\u003cp class=\"c4l-spacer\"\u003e\u003c/p\u003e` elements that are part of the components according to the C4L Moodle plugins seem to actually have a negative effect on spacing.\nSee [this issue](https://github.com/reskit/moodle-tiny_c4l/issues/20) to track progress on this.\nBy default, Moodular does not remove the spacer to remain consistent with the official plugins, but you can change this by calling `#c4l.remove-spacer(true)` or passing the `--input moodular-remove-spacer=true` option when compiling.\n\nWith that option applied, the rendered result would look like this:\n\n\u003cimg src=\"./thumbnail-moodle-no-spacer.png\"\u003e\n\nFor comparison, you can see the version with spacer [here](./thumbnail-moodle.png).\n\n## Usage\n\nSee the [manual](docs/manual.pdf) for details.\n\n## License\n\n\u003e Copyright (C) 2025 Clemens Koza\n\u003e\n\u003e This program is free software: you can redistribute it and/or modify\n\u003e it under the terms of the GNU General Public License as published by\n\u003e the Free Software Foundation, either version 3 of the License, or\n\u003e (at your option) any later version.\n\u003e\n\u003e This program is distributed in the hope that it will be useful,\n\u003e but WITHOUT ANY WARRANTY; without even the implied warranty of\n\u003e MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\u003e GNU General Public License for more details.\n\u003e\n\u003e You should have received a copy of the GNU General Public License\n\u003e along with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n(GPL licensed Typst packages are somewhat rare, so I'll comment on that here:\nI have chosen this license as I build on top of C4L – although I don't believe that this package is strictly speaking a derivative work – and because the Moodle ecosystem uses GPL throughout.\nIn case you are unsure whether you can use this package in your project, take a look [here](https://forum.typst.app/t/lgplv3-licence-in-popular-typst-library-how-to-understand/1746).\nMost importantly: it is definitely ok to use this package to create content for your Moodle courses; the license will not affect your content in any way.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsillyfreak%2Ftypst-moodular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsillyfreak%2Ftypst-moodular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsillyfreak%2Ftypst-moodular/lists"}