vimwiki-backup / vimwiki

Automatically exported from code.google.com/p/vimwiki
1 stars 1 forks source link

Rework Diary Page #250

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Is it possible to rework the diary page? It would be great if you could get an 
instant overview, maybe even with page titles:

= Diary =

== 2011 ==

=== January ===

[[2011-01-01: New Year!]]
[[2011-02-02: Still tired]]
...

=== December ===
...
[[2011-12-30: Joe's Birthday Party]]
[[2011-12-31: New Year's Eve]]

== 2012 ==
...

Original issue reported on code.google.com by dominik.mayer on 6 Sep 2011 at 8:34

GoogleCodeExporter commented 9 years ago
This should be possible ... except for the titles.  Vimwiki does not have a 
separate title associated with each file; just the filename itself. 

The obvious place to start is in the format_links() function in 
src/autoload/vimwiki/diary.vim.

One challenge involves the grouping of diary notes by year and month.  The 
current implementation sorts notes lexicographically, based on their filenames. 
 In other words, it is agnostic about the year/month/day that is encoded by 
these names.  One could partition notes based on the common string prefix for 
each year and month, and manually convert numeric months into string names.  

Some functions that might help:

index(list, expr)
match(list, pat)
filter(list, rule)

....

Original comment by stu.andrews on 17 Sep 2011 at 9:14

GoogleCodeExporter commented 9 years ago
Would it be possible to extract a title from the first line of a file and just 
copy it behind the link:

[[2011-12-30]]: Joe's Birthday Party

The first line of 2011-12-30.wiki would be "Joe's Birthday Party".

I think it would already be a huge advantage it was possible to sort like this:

== 2011 ==

=== 2011-01 ===

...

=== 2011-12 ===

== 2012 ==

Original comment by dominik.mayer on 17 Sep 2011 at 9:44

GoogleCodeExporter commented 9 years ago
Partly implemented. Diary page is fully regenerated each time new link is
added. Old version was able to change only = Diary = part of diary file.
This one can't do it yet.

Changes are in the repo.

Original comment by habamax on 23 Nov 2011 at 7:25

GoogleCodeExporter commented 9 years ago

Original comment by habamax on 8 Dec 2011 at 7:10

GoogleCodeExporter commented 9 years ago
The days are sorted in the wrong way. It should be chronologically, January 1 
to December 31 not the other way round.

Original comment by dominik.mayer on 31 Dec 2011 at 3:28

GoogleCodeExporter commented 9 years ago
Not only days are sorted that way - months and years are too. I find it suits 
me more than chronological.

There should be an option to sort it the other way round though.

Original comment by habamax on 31 Dec 2011 at 7:22

GoogleCodeExporter commented 9 years ago
add wiki option 
  let g:vimwiki_list={'diary_sort': 'asc'}
to your wiki.

Original comment by habamax on 1 Jan 2012 at 4:37

GoogleCodeExporter commented 9 years ago
I don't know if I'm doing something wrong, but diary.wiki doesn't get updated 
anymore.

Original comment by dominik.mayer on 1 Jan 2012 at 5:15

GoogleCodeExporter commented 9 years ago
Delete diary.wiki and try again, and if it would not work, give more details on 
what version of vimwiki do you use and steps to reproduce that behaviour.

Original comment by habamax on 1 Jan 2012 at 6:11

GoogleCodeExporter commented 9 years ago
Deleting solved it. Thanks (I was using the revision 323).

Have you thought about adding the titles?

And another idea: It would be great if there was a new line between the weeks:

== 2012 ==

=== January ===
        * Sun, [[2012-01-01]]: New Year

        * Mon, [[2012-01-02]]: Another title
        * Tue, [[2012-01-03]]: Going out
        * Wed, [[2012-01-04]]: 
        * Thu, [[2012-01-05]]: 
        * Fri, [[2012-01-06]]: 
        * Sat, [[2012-01-07]]: 
        * Sun, [[2012-01-08]]: 

        * Mon, [[2012-01-09]]: New line before new week
        * Tue, [[2012-01-10]]: 
        [...]

Original comment by dominik.mayer on 1 Jan 2012 at 6:27

GoogleCodeExporter commented 9 years ago
Titles are there. First level1 header is considered as a "title".
For weeks and newline between them I would suggest to add new issue. It would 
be easier for me to find out what to do once I have time.

Original comment by habamax on 1 Jan 2012 at 6:35

GoogleCodeExporter commented 9 years ago
That's great :-). I didn't realize.

I created issues 267 and 268 for the formatting issues.

Original comment by dominik.mayer on 1 Jan 2012 at 6:50