Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wrap ¶
Wrap provides http.Handler middleware. It wraps another http.Handler and renders markdown it returns under the correct conditions.
The correct conditions for rendering **markdown** as **HTML** is when the nested http.Handler returns something with a `Content-Type` of `text/markdown` AND the `Accept` header in the HTTP request does NOT contain `text/markdown`.
func WrapWithTransformer ¶
Types ¶
type NoTransformationType ¶
type NoTransformationType struct{}
var NoTransformation NoTransformationType
func (NoTransformationType) TransformAndServeHTTP ¶
func (receiver NoTransformationType) TransformAndServeHTTP(rw http.ResponseWriter, req *http.Request, statusCode int, body []byte)
type Transformer ¶
type Transformer interface {
TransformAndServeHTTP(rw http.ResponseWriter, req *http.Request, statusCode int, body []byte)
}
func BasicTransformation ¶
func BasicTransformation(contentType string, before string, after string) Transformer
Click to show internal directories.
Click to hide internal directories.