Added date after title in tags section of AsciiDoc export.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2019-05-24 23:53:01 +02:00
parent 08f647f86e
commit 9196585a98
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 5 additions and 4 deletions

View File

@ -141,14 +141,15 @@ void export_adoc(const vector<Database::entry> &entries, ostream &out)
<< tag.first << endl;
for (const Database::entry &entry : tag.second)
{
const string datetime = timepoint_to_string(entry.datetime);
const string day = datetime.substr(0, datetime.find('T'));
string title = entry.title;
if (title.empty())
{
title = "++" + entry.uri + "++";
}
out << endl << "* xref:dt_"
<< timepoint_to_string(entry.datetime)
<< '[' << title << ']' << endl;
out << endl << "* xref:dt_" << datetime
<< '[' << title << "] _(" << day << ")_" << endl;
}
out << endl;
}

View File

@ -66,7 +66,7 @@ SCENARIO ("The AsciiDoc export works correctly")
("== Tags\n\n"
"=== \\[\\[t_tag1\\]\\]tag1\n\n"
"\\* xref:dt_1970-01-01T\\d{2}:\\d{2}:\\d{2}"
"\\[Nice title\\]\n\n");
"\\[Nice title\\] _\\(1970-01-01\\)_\n\n");
for (const regex &re : { re_header, re_dates, re_tags })
{