\documentclass{book}
\usepackage{ifxetex,ifluatex}
\ifxetex
  \usepackage{polyglossia}
  \setmainlanguage{english}
  \usepackage{fontspec}
\else\ifluatex
  \usepackage{polyglossia}
  \setmainlanguage{english}
  \usepackage{fontspec}
\else
  \usepackage[english]{babel}
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage{lmodern}
\fi\fi
\usepackage[
  hashEnumerators,
  definitionLists,
  footnotes,
  inlineFootnotes,
  smartEllipses,
  fencedCode,
  contentBlocks
]{markdown}
\begin{document}
  \markdownInput{example.md}
  \begin{markdown}
Here are some non-ASCII characters: *ěščřžýáíé*.
  \end{markdown}
\end{document}
