\documentclass{article}
\usepackage{agda}

\begin{document}

\AgdaHide{
\begin{code}
module OneSpaceIndent where
\end{code}
}

\section{Syntax}
Text1

\AgdaHide{
\begin{code}
module Defs where

 postulate
\end{code}
}

Text2

\begin{code}
  Base : Set
\end{code}

Text3
\end{document}
