If you're willing and able to use LuaLaTeX, an extension to an earlier answer given to the posting Use Markdown-style formatting for bold and italic may work for you. It doesn't call an external routine (e.g, pandoc
), though. Instead, it converts selected Markdown-type code into LaTeX-based code.
The code (a) defines a LaTeX environment named markdown
and (b) sets up a Lua function named process_simple_markdown
to handle very simple cases of markdown-type code. The Lua function is activated inside -- and only inside -- markdown
environments. Lua "captures" are used to process what's inside pairs of parentheses and brackets and pairs of triple, double, and single asterisks. The Lua function is assigned to the so-called process_input_buffer
callback; it therefore operates on the input file at a very early stage, before TeX itself does any typesetting-related work.
A strong caveat: Syntax checking is currently somewhere between rudimentary and non-existent. E.g., if you have pairs of asterisks inside a URL string, I have no idea what may happen.

% !TEX TS-program = lualatex
\documentclass{article}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref} % for "\href" macro
\usepackage{luacode,luatexbase}
%% Lua-side code
\begin{luacode}
function process_simple_markdown (line)
line = string.gsub( line, "%[(.-)%]%((.-)%)", "\\href{%2}{%1}" )
line = string.gsub( line, "%*%*%*(.-)%*%*%*", "\\textbf{\\textit{%1}}")
line = string.gsub( line, "%*%*(.-)%*%*", "\\textbf{%1}" )
line = string.gsub( line, "%*(.-)%*", "\\textit{%1}" )
return line
end
\end{luacode}
%% TeX-side code
\newcommand\markdownon{%
\directlua{luatexbase.add_to_callback( "process_input_buffer", process_simple_markdown, "process_simple_markdown" )}}
\newcommand\markdownoff{%
\directlua{luatexbase.remove_from_callback( "process_input_buffer", "process_simple_markdown" )}}
\newenvironment{markdown}{\markdownon}{\markdownoff}
\begin{document}
\begin{markdown}
This will be *processed* as [Markdown](http://daringfireball.net/projects/markdown/)!
\end{markdown}
\end{document}