# Path: engine/conf.py
# PATH_TO_HTML = PATH + "/engine/data/html/"
# 
# PATH_TO_TEMPLATE = PATH + "/themes/" + TEMPLATE + "/notes/"  # don't forget about ending /
# 
# PATH_HOMEPAGE = PATH + "/themes/" + TEMPLATE + "/homepage/head_index.html"
# 
# PATH_TO_MD = PATH + '/notes/'
# 
# PATH_TO_TEMPLATE_HTML = PATH_TO_TEMPLATE + 'head.html'


import os
import time
import re
from engine.conf import PATH_TO_HTML, PATH_TO_TEMPLATE, PATH_HOMEPAGE, PATH_TO_MD, PATH_TO_TEMPLATE_HTML  # noqa
                        else:
                            desc = lines[0]
                    else:
                        desc = ''
                    for l in f:
                        # the tag will overwrite this before
                        if l.strip().startswith('[desc:'):
                            desc = l.replace('[desc:', '').replace(']', '').strip()


                    mdfn = re.sub('.md$', '', mdfn)  # replace only .md at the very end
                    path = PATH_TO_HTML + '/' + mdfn
                    # if l.find('::')>=0:
                    #    html += '<li class="table_of_content_h2">
                    # <a style="" href="' + path + '.html">' + l + '</a></li>'
                    # else:
                    if FLASK_BASED:
                        html += '<tr><td style=""><a class="index_list_a" href="/view/' + mdfn + '.html">' \
                                 + mdfn + '</a>' + '</br><span style="font-size:10px;color:gray">' + desc + '</td>' \
                                 + '<td style="white-space: nowrap;"><small><center class="index_date">' \
                                 + time.ctime(os.stat(os.path.join(PATH_TO_MD, mdfn + '.md')).st_mtime) \
                                            + '</center></small></td>' \
                                 + '<td><small><center class="index_date">' + str(len(lines)) + '</center>' \
                                 + '</small></td></tr>'


                    else:
                        html += '<tr><td><a class="index_list_a" href="' + path + '.html">' \
                                + mdfn + '</a></td>' + '<td>' + desc + '</td>' \
                                + '<td><small><center class="index_date">' + \

# Path: engine/conf.py
# PATH_TO_HTML = PATH + "/engine/data/html/"
# 
# PATH_TO_TEMPLATE = PATH + "/themes/" + TEMPLATE + "/notes/"  # don't forget about ending /
# 
# PATH_HOMEPAGE = PATH + "/themes/" + TEMPLATE + "/homepage/head_index.html"
# 
# PATH_TO_MD = PATH + '/notes/'
# 
# PATH_TO_TEMPLATE_HTML = PATH_TO_TEMPLATE + 'head.html'


# Path: engine/make_index.py
import os
import time
import re
from engine.conf import PATH_TO_HTML, PATH_TO_TEMPLATE, PATH_HOMEPAGE, PATH_TO_MD, PATH_TO_TEMPLATE_HTML  # noqa

                        else:
                            desc = lines[0]
                    else:
                        desc = ''
                    for l in f:
                        # the tag will overwrite this before
                        if l.strip().startswith('[desc:'):
                            desc = l.replace('[desc:', '').replace(']', '').strip()


                    mdfn = re.sub('.md$', '', mdfn)  # replace only .md at the very end
                    path = PATH_TO_HTML + '/' + mdfn
                    # if l.find('::')>=0:
                    #    html += '<li class="table_of_content_h2">
                    # <a style="" href="' + path + '.html">' + l + '</a></li>'
                    # else:
                    if FLASK_BASED:
                        html += '<tr><td style=""><a class="index_list_a" href="/view/' + mdfn + '.html">' \
                                 + mdfn + '</a>' + '</br><span style="font-size:10px;color:gray">' + desc + '</td>' \
                                 + '<td style="white-space: nowrap;"><small><center class="index_date">' \
                                 + time.ctime(os.stat(os.path.join(PATH_TO_MD, mdfn + '.md')).st_mtime) \
                                            + '</center></small></td>' \
                                 + '<td><small><center class="index_date">' + str(len(lines)) + '</center>' \
                                 + '</small></td></tr>'


                    else:
                        html += '<tr><td><a class="index_list_a" href="' + path + '.html">' \
                                + mdfn + '</a></td>' + '<td>' + desc + '</td>' \
                                + '<td><small><center class="index_date">' + \

                                time.ctime(os.stat(os.path.join(PATH_TO_MD, mdfn + '.md')