Package dev.enola.common.io.resource
Class MarkdownResource
- All Implemented Interfaces:
AbstractResource,MultipartResource,ReadableButNotWritableResource,ReadableResource,Resource,WritableResource
MarkdownResource is a
MultipartResource which separates "Front Matter" (as FRONT
part, typically YAML structured data) and Markdown content (as MARKDOWN) from the base
resource.
The "front matter" is anything between 2 "---" lines at the very start of the file (if present, it's optional), and the "body" (in Markdown text) is everything that follows. Any HTML comment before the front-matter is stripped (this is useful, e.g. to ignore license headers).
This is a very common quasi de-facto standard format used by many Markdown tools. It may (TBC) originally have been introduced by Jekyll.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.enola.common.io.resource.RegexMultipartResource
RegexMultipartResource.PartsDef -
Field Summary
FieldsFields inherited from class dev.enola.common.io.resource.DelegatingReadableResource
delegateFields inherited from class dev.enola.common.io.resource.BaseResource
mediaType, uriFields inherited from interface dev.enola.common.io.resource.MultipartResource
MEDIA_TYPEFields inherited from interface dev.enola.common.io.resource.ReadableResource
LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionMarkdownResource(ReadableResource baseResource) MarkdownResource(ReadableResource baseResource, MediaType bodyMediaType) -
Method Summary
Methods inherited from class dev.enola.common.io.resource.DelegatingMultipartResource
part, partsMethods inherited from class dev.enola.common.io.resource.DelegatingReadableResource
byteSource, charSourceMethods inherited from class dev.enola.common.io.resource.BaseResource
mediaType, toString, uriMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.enola.common.io.resource.AbstractResource
mediaType, uriMethods inherited from interface dev.enola.common.io.resource.MultipartResource
mediaType, uriMethods inherited from interface dev.enola.common.io.resource.ReadableButNotWritableResource
byteSinkMethods inherited from interface dev.enola.common.io.resource.ReadableResource
byteSource, changeToken, charSource, isDifferent, isDifferentMethods inherited from interface dev.enola.common.io.resource.WritableResource
charSink
-
Field Details
-
FIRST_COMMENT
- See Also:
-
FRONT
- See Also:
-
MARKDOWN
- See Also:
-
-
Constructor Details
-
MarkdownResource
- Throws:
IOException
-
MarkdownResource
- Throws:
IOException
-
-
Method Details
-
frontMatter
-
markdown
-