def dayone_export(dayone_folder, template=None, reverse=False, tags=None,
    exclude=None, before=None, after=None, format=None, template_dir=None, autobold=False,
    nl2br=False, filename_template=""):

    # figure out which template to use
    loader, template = _determine_inheritance(template, template_dir, format)

    # custom latex template syntax
    custom_syntax = {}
    if os.path.splitext(template)[1] == ".tex":
        custom_syntax = {'block_start_string': r'\CMD{',
                         'block_end_string': '}',
                         'variable_start_string': r'\VAR{',
                         'variable_end_string': '}',
                         }
    # define jinja environment
    env = jinja2.Environment(loader=loader, trim_blocks=True, **custom_syntax)

    # filters
    env.filters['markdown'] = filters.markdown_filter(autobold=autobold)
    env.filters['format'] = filters.format
    env.filters['escape_tex'] = filters.escape_tex
    env.filters['imgbase64'] = partial(filters.imgbase64,
      dayone_folder=dayone_folder)


    # load template
    template = env.get_template(template)

    # parse journal
    j = parse_journal(dayone_folder)

    # filter and manipulate based on options
    default_tz = j[-1]["Date"].tzinfo
    after = _convert_to_utc(after, default_tz)
    before = _convert_to_utc(before, default_tz)
    j = _filter_by_date(j, after=after, before=before)
    if tags is not None:
        j = _filter_by_tag(j, tags)
    if exclude is not None:
        j = _exclude_tags(j, exclude)
    if reverse:
        j.reverse()


    # Split into groups, possibly of length one
    # Generate a new output for each time the 'filename_template' changes.
    # Yield the resulting filename_template plus the output.
    # If the filename_template is an empty string (the default), we'll get
    # an empty grouper plus the rendering of the full list of entries.
    # This may throw an exception if the template is malformed.
    # The traceback is helpful, so I'm letting it through
    # it might be nice to clean up the error message, someday

    output_groups = defaultdict(list)
    for e in j:
        output_groups[e['Date'].strftime(filename_template)].append(e)

    today = datetime.today()
    for k in output_groups:
        yield k, template.render(journal=output_groups[k], today=today)
:param fieldname: The name of the field to search.
dataset/ETHPy150Open nathangrigg/dayone_export/dayone_export/__init__.py/dayone_export--crossover with--dataset/ETHPy150Open dokipen/whoosh/src/whoosh/query.py/TermRange.__init__