{"id":17175068,"url":"https://github.com/grenderg/markdownview","last_synced_at":"2025-07-14T17:10:04.923Z","repository":{"id":57345689,"uuid":"149366373","full_name":"GrenderG/MarkdownView","owner":"GrenderG","description":"WebView implementation supporting Markdown rendering.","archived":false,"fork":false,"pushed_at":"2020-04-11T13:43:37.000Z","size":1126,"stargazers_count":58,"open_issues_count":5,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-22T09:51:25.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrenderG.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}},"created_at":"2018-09-19T00:00:35.000Z","updated_at":"2025-04-11T17:11:56.000Z","dependencies_parsed_at":"2022-09-17T06:31:33.293Z","dependency_job_id":null,"html_url":"https://github.com/GrenderG/MarkdownView","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/GrenderG/MarkdownView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrenderG%2FMarkdownView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrenderG%2FMarkdownView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrenderG%2FMarkdownView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrenderG%2FMarkdownView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrenderG","download_url":"https://codeload.github.com/GrenderG/MarkdownView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrenderG%2FMarkdownView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265322458,"owners_count":23746618,"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-14T23:55:38.184Z","updated_at":"2025-07-14T17:10:04.829Z","avatar_url":"https://github.com/GrenderG.png","language":"Java","readme":"[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R21LO82)\n\n# MarkdownView\n[![API](https://img.shields.io/badge/API-15%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=15) [![](https://jitpack.io/v/GrenderG/MarkdownView.svg)](https://jitpack.io/#GrenderG/MarkdownView) [![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-MarkdownView-green.svg?style=flat )]( https://android-arsenal.com/details/1/7145 )\n\nWebView implementation supporting Markdown rendering.\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\"https://raw.githubusercontent.com/GrenderG/MarkdownView/master/art/demo.gif\"\u003e\n\u003c/div\u003e\n\n## Prerequisites\n\nAdd this in your root `build.gradle` file (**not** your module `build.gradle` file):\n\n```gradle\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url \"https://jitpack.io\" }\n\t}\n}\n```\n\n## Dependency\n\nAdd this to your module's `build.gradle` file (make sure the version matches the JitPack badge above):\n\n```gradle\ndependencies {\n\t...\n\timplementation 'com.github.GrenderG:MarkdownView:0.1.2'\n}\n```\n\n## Basic usage\n\n**NOTE:** You will need to specify INTERNET permission in your project if you want to load Internet resources.\n\n\nFirst of all, all the View where you want:\n```xml\n\u003ces.dmoral.markdownview.MarkdownView\n        android:id=\"@+id/markdown_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" /\u003e\n```\n\nLoading Markdown text:\n```java\nmarkdownView.loadFromText(\"### Loading some Markdown!\\nHey there.\");\n```\n\nLoading Markdown from a File:\n```java\nmarkdownView.loadFromFile(new File(\"path/to/md/file\"));\n```\n\nLoading Markdown from Android assets:\n```java\nmarkdownView.loadFromAssets(\"path/to/file/in/assets\");\n```\n\nLoading Markdown from URL:\n```java\nmarkdownView.loadFromURL(\"https://raw.githubusercontent.com/GrenderG/MarkdownView/master/README.md\");\n```\n\n## Advanced usage\n\nMarkdownView uses `css` files to stylize everything, you can customize them too:\n```java\nmarkdownView.setCurrentConfig(new Config(\n\t\"file:///android_asset/custom_css_file.css\",\n\tConfig.CssCodeHighlight.MONOKAI_SUBLIME // This can be a custom one too, but there are already added some options.\n));\n```\n\nInternally, MarkdownView uses an `OkHttpClient` to load files from URLs, you can set a custom one if you want:\n```java\nConfig defaultConfig = Config.getDefaultConfig();\n        \ndefaultConfig.setDefaultOkHttpClient(new OkHttpClient().newBuilder().addInterceptor(\n        new Interceptor() {\n            @Override\n            public Response intercept(Chain chain) throws IOException {\n                Request request = chain.request();\n                Request authenticatedRequest = request.newBuilder()\n                        .header(\"Authorization\", \"Basic OIxhJGHpbjpvcGVuc2VzYW1l\").build();\n                return chain.proceed(authenticatedRequest);\n            }\n        }\n).build());\n\nmarkdownView.setCurrentConfig(defaultConfig);\n```\n\nYou can also set the margins of the content (in px):\n```java\nConfig defaultConfig = Config.getDefaultConfig();\n        \ndefaultConfig.setDefaultMargin(16);\n\nmarkdownView.setCurrentConfig(defaultConfig);\n```\n\nThere's also a rendering listener which will provide you info if there's an error rendering the Markdown and when it has finished rendering (near perfect timing).\n```java\nmarkdownView.setOnMarkdownRenderingListener(new MarkdownView.OnMarkdownRenderingListener() {\n        @Override\n        public void onMarkdownFinishedRendering() {\n            // Rendered!\n        }\n\n        @Override\n        public void onMarkdownRenderError() {\n\t    // Error rendering\n        }\n    });\n```\n\n## Acknowledgements\n\nThis library is **heavily** influenced by [MarkedView-for-Android\n](https://github.com/mittsuu/MarkedView-for-Android) from [@mittsuu](https://github.com/mittsuu).\n\n- [Marked](https://github.com/markedjs/marked)\n- [highlight.js](https://highlightjs.org/)\n- [jQuery](https://jquery.com/)\n- [Bootstrap (css style)](http://getbootstrap.com/)\n","funding_links":["https://ko-fi.com/R6R21LO82"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrenderg%2Fmarkdownview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrenderg%2Fmarkdownview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrenderg%2Fmarkdownview/lists"}