Comments (15)
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.
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.
as reference #60
jceb said:
0. extend liborgmode/Heading to support dates
I'd say SCHEDULED, DEADLINE are the keywords
- 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 - (optional, could be implemented later) add support for linked documents to liborgmode/Document.
- 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.
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.
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.
Great. I hope I'll find some time to look at it at the weekend.
from vim-orgmode.
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.
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.
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.
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.
How can I get the bufnr of a buffer with a given name ('somefile.org')?
from vim-orgmode.
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.
I guess iterating works.
Thanks for making me a collaborator! I'll keep working on the agenda feature...
from vim-orgmode.
- 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.
I merged it into v0.4 and created a separate issue for the hyperlinks problem.
from vim-orgmode.
Related Issues (20)
- Re-number lists
- Key mappings are not added after installation HOT 4
- Maintainer HOT 2
- Willing to be maintainer HOT 4
- Links no longer visible HOT 5
- insert timestamp with current time
- AttributeError: module 'collections' has no attribute 'Iterable' in Python 3.10.1-1 HOT 4
- how to display <leader>caa result when start vim HOT 1
- E117: Unknown function: <SNR>254_ReadTodoKeywords HOT 1
- Keybindings do not work when installing using the package feature of Vim 8
- E117: Unknown function: <SNR>69_ReadTodoKeywords
- How to disable a keybinding HOT 1
- Github project description still states "UNMAINTAINED" HOT 2
- Can be this plugin forked? HOT 1
- no fold found HOT 3
- Fold plain lists sublists
- Cannot install into Vim 9 on Mac OS using built-in plugin manager HOT 1
- always fold when insert date
- Python 3.12 and `imp` HOT 3
- Can't find function names to call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-orgmode.