1 line
4.7 KiB
JavaScript
1 line
4.7 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{240:function(t,a,n){"use strict";n.r(a);var s=n(0),e=Object(s.a)({},function(){var t=this,a=t.$createElement,n=t._self._c||a;return n("div",{staticClass:"content"},[t._m(0),t._v(" "),n("LegacyWarning"),t._v(" "),n("MavenBadge",{attrs:{artifact:"image-okhttp"}}),t._v(" "),n("p",[t._v("Uses "),n("a",{attrs:{href:"https://github.com/square/okhttp",target:"_blank",rel:"noopener noreferrer"}},[t._v("okhttp library"),n("OutboundLink")],1),t._v(" as the network transport fro images. Since "),n("Badge",{attrs:{text:"3.0.0"}}),t._v(" "),n("code",[t._v("Markwon")]),t._v(" uses a system-native "),n("code",[t._v("HttpUrlConnection")]),t._v(" and does not rely on any\n3rd-party tool to download resources from network. It can answer the most common needs,\nbut if you would like to have a custom redirect policy or add an explicit caching\nof downloaded resources OkHttp might be a better option.")],1),t._v(" "),t._m(1),t._m(2),t._v(" "),t._m(3)],1)},[function(){var t=this.$createElement,a=this._self._c||t;return a("h1",{attrs:{id:"image-okhttp"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#image-okhttp","aria-hidden":"true"}},[this._v("#")]),this._v(" Image OkHttp")])},function(){var t=this,a=t.$createElement,n=t._self._c||a;return n("div",{staticClass:"language-java extra-class"},[n("pre",{pre:!0,attrs:{class:"language-java"}},[n("code",[n("span",{attrs:{class:"token keyword"}},[t._v("final")]),t._v(" Markwon markwon "),n("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" Markwon"),n("span",{attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{attrs:{class:"token function"}},[t._v("builder")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{attrs:{class:"token comment"}},[t._v("// it's required to register ImagesPlugin")]),t._v("\n "),n("span",{attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{attrs:{class:"token function"}},[t._v("usePlugin")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ImagesPlugin"),n("span",{attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{attrs:{class:"token function"}},[t._v("create")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n \n "),n("span",{attrs:{class:"token comment"}},[t._v("// will create default instance of OkHttpClient")]),t._v("\n "),n("span",{attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{attrs:{class:"token function"}},[t._v("usePlugin")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("OkHttpImagesPlugin"),n("span",{attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{attrs:{class:"token function"}},[t._v("create")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n \n "),n("span",{attrs:{class:"token comment"}},[t._v("// or accept a configured client")]),t._v("\n "),n("span",{attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{attrs:{class:"token function"}},[t._v("usePlugin")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("OkHttpImagesPlugin"),n("span",{attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{attrs:{class:"token function"}},[t._v("create")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{attrs:{class:"token class-name"}},[t._v("OkHttpClient")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{attrs:{class:"token function"}},[t._v("build")]),n("span",{attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,a=this._self._c||t;return a("h2",{attrs:{id:"proguard"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#proguard","aria-hidden":"true"}},[this._v("#")]),this._v(" Proguard")])},function(){var t=this.$createElement,a=this._self._c||t;return a("div",{staticClass:"language-proguard extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[this._v("-dontwarn okhttp3.**\n-dontwarn okio.**\n")])])])}],!1,null,null,null);e.options.__file="okhttp.md";a.default=e.exports}}]); |