All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.woojiahao.MarkdownDocument.kt Maven / Gradle / Ivy

There is a newer version: 0.2.3
Show newest version
package com.github.woojiahao

import com.github.woojiahao.utility.extensions.isFileType
import java.io.File
import org.commonmark.node.Document as CommonMarkDocument

class MarkdownDocument(val file: File) {

  constructor(filePath: String) : this(File(filePath))

  init {
    with(file) {
      require(exists()) { "File path ($path) must exist" }
      require(isFile) { "File path ($path) must point to a file" }
      require(isFileType("md")) { "File ($name) must be a markdown document" }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy