I am making a document containing only definitions, to do this I am using this code
\documentclass[12pt, a4paper, fleqn]{article}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Definition
\newcounter{defns}[section] \setcounter{defns}{0}
\renewcommand{\thedefns}{\arabic{section}.\arabic{defns}}
\newenvironment{defns}[2][]{%
\refstepcounter{defns}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=green!20]
{\strut Definition~\thedefns};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=green!20]
{\strut Definition~\thedefns:~#1};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=green!20,%
linewidth=2pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]\relax%
\label{#2}}{\qed\end{mdframed}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\tableofcontents
\newpage
\section{Definitions}
\begin{defns}[Ring]{defns:ring01}
Let $R$ be an Abelian group under addition in witch multiplication is...
\end{defns}
This is a reference to definition \ref{defns:ring01}
\end{document}
Everything is okay but instead of contents I need a clickable list of all the definitions.
Please help me how to do this?
\setcounter{defns}{0}
at the beginning is not necessary since\newcounter{defns}
will set it to zero