{"id":18319827,"url":"https://github.com/ui5-community/ui5-cc-md","last_synced_at":"2025-04-05T22:31:38.583Z","repository":{"id":42065096,"uuid":"337512103","full_name":"ui5-community/ui5-cc-md","owner":"ui5-community","description":"ui5 custom control rendering github flavored markdown to html","archived":false,"fork":false,"pushed_at":"2023-07-28T14:41:18.000Z","size":620,"stargazers_count":8,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-21T12:59:21.348Z","etag":null,"topics":["controls","module","npm","ui5"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ui5-community.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}},"created_at":"2021-02-09T19:23:21.000Z","updated_at":"2024-07-06T08:52:50.000Z","dependencies_parsed_at":"2022-08-12T03:50:52.114Z","dependency_job_id":null,"html_url":"https://github.com/ui5-community/ui5-cc-md","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui5-community%2Fui5-cc-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui5-community%2Fui5-cc-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui5-community%2Fui5-cc-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui5-community%2Fui5-cc-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ui5-community","download_url":"https://codeload.github.com/ui5-community/ui5-cc-md/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411236,"owners_count":20934650,"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":["controls","module","npm","ui5"],"created_at":"2024-11-05T18:14:23.323Z","updated_at":"2025-04-05T22:31:37.873Z","avatar_url":"https://github.com/ui5-community.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UI5 custom control `ui5-cc-md`\n\nThis namespace contains a custom control rendering regular + github-flavored Markdown content, either provided as a string or from a file.  \nIt outputs plain HTML, ready to be included in an XML view.\n\n## Install\n\n```bash\n$\u003e yarn add ui5-cc-md\n# or\n$\u003e npm install ui5-cc-md\n```\n\n## Included controls\n\n- `Markdown`: transforms Markdown to HTML\n  - properties: (note: either `content` or `fromFile` can be used, not both)\n    - `content: \u003cString\u003e`: Markdown as raw string\n    - `fromFile: \u003cPath\u003e`: relative path to a file containing Markdwon\n  - aggregations: -\n\n## Usage\n\n1. define the dependeny in `$yourapp/package.json`\n\n   ```json\n   // it is already in \"dependencies\" after installation\n   \"ui5\": {\n     \"dependencies\": [\n       // ...\n       \"ui5-cc-md\",\n       // ...\n     ]\n   }\n   ```\n\n2. declare the namespace in your XML view and use the custom control from that namespace\n\n   ```xml\n   \u003cmvc:View ... \n           xmlns:md=\"cc.md\"\n           ...\u003e\n      \u003cmd:Markdown content=\"***markdown is nice!***\u0026#13;\u0026#10;\u0026#13;\u0026#10;if only there wasn't the CR problem in XML view string\" /\u003e\n      \u003cmd:Markdown fromFile=\"./fragment.md\" /\u003e\n      \u003cmd:Markdown content=\"{/markdownContent}\" /\u003e\n   \u003c/mvc:View\u003e\n   ```\n\n## How it works\n\n`Markdown` uses the [npm module `marked`](https://marked.js.org) for transforming content from Markdown to HTML.\n\n## Build time (in apps)\n\nUse `ui5 build --all` to produce a deployable version of your app including `ui5-cc-md` and its’ control(s).\n\nOther than that, nothing specific to note for using `ui5-cc-md` in builds in UI5 apps.\n\n## Tests\n\nThe `test` folder contains a minimal UI5 app requiring `ui5-cc-md`. \n\nFor testing manually, do:\n\n```bash\n$\u003e yarn test:manual # runs ui5 serve\n# now point a browser to http://localhost:8080\n```\n\nThe [livereload middleware](https://github.com/petermuessig/ui5-ecosystem-showcase/tree/master/packages/ui5-middleware-livereload) is included, so changes to the test app get reloaded immediately.\n\nA full automated test suite is setup with [Jest + puppeteer](https://jestjs.io/docs/en/puppeteer), starting `ui5 serve` and running all `/test/**/*.test.js` :\n\n```bash\n$\u003e cd test/ui5-app\n$\u003e yarn # for installing runtime dependencies\n$\u003e cd ..\n$\u003e yarn test\n# sample output:\n PASS  test/ui5-app/basic.test.js\n  Markdown\n    ✓ should render markdown via content property (2374 ms)\n    ✓ should render markdown via fromFile property (854 ms)\n    ✓ should render markdown via binding (672 ms)\n\nTest Suites: 1 passed, 1 total\nTests:       3 passed, 3 total\nSnapshots:   0 total\nTime:        4.512 s, estimated 5 s\nRan all test suites.\n✨  Done in 11.90s.\n```\n\n## License\n\nThis work is [dual-licensed](./LICENSE) under Apache 2.0 and the Derived Beer-ware License. The official license will be Apache 2.0, but ultimately you can choose between one of them if you use this work.\n\nWhen you like this stuff, buy [@vobu](https://twitter.com/vobu),  [@matz3](https://twitter.com/matthiaso), [@wridgeu](https://twitter.com/wridgeu) a beer or buy [@pmuessig](https://twitter.com/pmuessig) a coke when you see them.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fui5-community%2Fui5-cc-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fui5-community%2Fui5-cc-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fui5-community%2Fui5-cc-md/lists"}