Giter Site home page Giter Site logo

Implement agenda view about vim-orgmode HOT 15 CLOSED

jceb avatar jceb commented on August 9, 2024
Implement agenda view

from vim-orgmode.

Comments (15)

sotte avatar sotte commented on August 9, 2024

I'm thinking about how to implement this properly.

I'd create an agenda class that contains several documents. The user can define the documents. The nesesary information of the documents get extracted depending on the type of the agenda. The agenda info gets dumped in a new vimbuffer.

That is the rough idea. Any suggestions?

from vim-orgmode.

jceb avatar jceb commented on August 9, 2024

Sounds good to me. The agenda class should be part of liborgmode. The documents should be configurable by vim variables, similar to the TODO implementation. An imaginary orgcmd program, that implements a command line front-end to liborgmode can then override the configuration with it's own values.

Regarding the agenda buffer in vim, I recommend implementing the auto command BufReadCmd for org:agenda or something similar.

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024

as reference #60


jceb said:
0. extend liborgmode/Heading to support dates
I'd say SCHEDULED, DEADLINE are the keywords

  1. add an agenda class to liborgmode
    this class should contain all basic functionality to build an agenda
    an agenda is just a (flat) list of headings that belong to one or more documents
    this list can be sorted or filtered in various ways to allow the user to get the view port he wants
    the agenda class should not contain any highlevel UI code - all that UI stuff goes into a plugin
  2. (optional, could be implemented later) add support for linked documents to liborgmode/Document.
  3. implement/extend a plugin that does the job of displaying the agenda
    this includes a global variable that defines which org documents are included in the agenda
    it should do the job of allowing the user to narrow down the displayed headings.

Thanks for the suggestion!

0: org only needs an active date like <2011-11-22 Mon> for the agenda. SCHEDULED and DEADLINE have different semantics. Besides that I introduced active_date in the Heading and wrote some unittests.

I kinda want to split liborgmode.py. It's getting to huge. Even some classes are really big. I would introduce some factory methods, e.G. parse_heading_from_data(...) in the Heading class. That would also improve the testabillity.

I would move Heading and HeadingList in heading.py.

A OrgDate class would be helpful as well. It would simplify the Date plugin and and the agenda feature.

Is that fine with you?

from vim-orgmode.

jceb avatar jceb commented on August 9, 2024

That's fine for me. I'd recommend creating a python module "liborgmode" and putting all the separate files (heading.py & co.) in there.

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024

I started with the refactoring and have a tiny agenda running: https://github.com/sotte/vim-orgmode/tree/agenda
It's by no means ready for anything yet...but just in case you want to take a look at how everything is laid out now.

Next I'll add the OrgDate classeses I want to use for the agenda (and a few other places).

from vim-orgmode.

jceb avatar jceb commented on August 9, 2024

Great. I hope I'll find some time to look at it at the weekend.

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024

Is there any specific reason why init of Document should not be called directly? The Document as main class in liborgmode should be allowed to be instanciated directly.

I'm about to write some unittest for the agenda manager and I need a Document object with some Headings in it.

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024

I want to be able to sort a list of headings by date. For this I would implement __lt__() for Heading. This might be to specific. But for the entire Agenda it would be really helpful. Basically all views of an agenda are sorted by date.

What do you think?

from vim-orgmode.

jceb avatar jceb commented on August 9, 2024

Re: init. Of course you can instantiate Document directly. Except from test cases this is hardly ever needed because of the lack of a connection to any kind of file/buffer/... resource.

Re: lt. Go ahead an implement __lt__() for the Heading class.

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024

Ok, my branch has the basic functionality for the agenda view. I restructured quite a bit and there is some more work needed.

Current limitations:

  • Only the current document is used for the agenda view.
  • No separate syntax file yet. (Can we reuse syntax-elements from different syntax files?)
  • No selection window for agenda views. The agenda view is opened directly.
  • No functionality in the agenda view.
  • Can't jump to the corresponding position in the document. Any idea how I can achieve this?

Feel free to test. Also, if you integrate it into v0.4 we both can work on it.

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024

How can I get the bufnr of a buffer with a given name ('somefile.org')?

from vim-orgmode.

jceb avatar jceb commented on August 9, 2024

Re bufnr: I suppose there is no direct api call that will return the bufnr. You have to know the full filename of the buffer, then you can iterate over vim.buffers to find the corresponding buffer.

I reduced the plans for v0.4 to the agenda feature, so my plan is to merge all your work. Currently I'm very busy, I recommend that you continue working on your implementation till I merge it. I added you as a collaborator, so you can also merge it yourself :-)

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024

I guess iterating works.

Thanks for making me a collaborator! I'll keep working on the agenda feature...

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024
  • DONE Only the current document is used for the agenda view.
  • DONE No separate syntax file yet.
  • TODO Can we reuse syntax-elements from different syntax files? --> v0.5
  • TODO Hyperlinks don't get recognized properly
  • DONE No selection window for agenda views. The agenda view is opened directly.
    Still no selection window, but there are only two views so far and it's not really necessary. Once we have a better way to open tmp buffers we could implement it. --> v0.5
  • DONE Can't jump to the corresponding position in the document.

from vim-orgmode.

sotte avatar sotte commented on August 9, 2024

I merged it into v0.4 and created a separate issue for the hyperlinks problem.

from vim-orgmode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.