Comments (2)
Hey @ivan-lednev, thanks for providing a list of steps to do, as well as code to consume. That is really helpful!
So far I have noticed that updating the task in the file after moving it in the timeline is done with the following function
obsidian-day-planner/src/service/plan-editor.ts
Lines 134 to 148 in 2a5e8fb
which uses plain string manipulation. Moreover, as far as I can tell, mdast-util-from-markdown
is not used in the project so far.
I believe the place I should modify to the very basic case of updating a single file when moving tasks inside of it, is:
obsidian-day-planner/src/service/plan-editor.ts
Lines 85 to 95 in 2a5e8fb
I will see what I can do. I believe it will take me some time to experiment with modifying the file on the AST level. I'll share updates when I make more progress. Feel free to take over this feature if you feel like you can get it done soon
from obsidian-day-planner.
Hello, @Gelio,
To sort tasks you'll need to update src/service/plan-editor.ts
. After every write to the plan, we need to
- grab the first block under the planner heading
- parse it with
mdast-util-from-markdown
. An abstract tree is easier to manipulate than an array of lines, and we can have subtasks, so we need this - re-order top-level list items
- serialize it back to markdown and replace document contents
mdast-util-from-markdown handles Obsidian-flavored markdown well, but to convert it back, you can grab this utility that fixes some format discrepancies: src/mdast/mdast.ts
.
Let me know if you have any other questions!
from obsidian-day-planner.
Related Issues (20)
- Remove repeated notifications when editing current task
- Feature Request: Enhanced Control Over Checkboxes in Timeline View HOT 1
- Cannot move task scheduled with tasks in Week Planner
- Make unscheduled tasks section height configurable
- [Feature Request] Show the calendar events in the daily note HOT 2
- Summer time bug? HOT 2
- Thanks for this plugging. iOS is my sole device. Seems timeline won’t refresh using the refresh button. Drag and move, doesn’t happen. Also, settings tends to desert to default settings on program restart. Goes back to 24 time, all other settings revert back.
- problem with sync task query in daily notes to day planner timeline HOT 1
- ICS Calendar Link Issue
- [Feature Request] "Show end time" as Current task progress indicator option
- [Feature Request] Command to create new task that starts at current time
- [Feature Request] Ability to click links to open notes in task text HOT 1
- [Feature Request] Tasks display task duration from start time to end time
- Exceptions to recurring events Microsoft 365 still showing in timeline HOT 2
- Incompatibility between Day Planner and Journals Plugin: Blocks not appearing in planned future notes
- [Feature Request] Open today's Day Planner command opens the daily note at the Day Planner section
- Tasks found using Dataview Source, both folder -"Tasks" and tags -"#GTD", can not be dragged and dropped
- silent remote calendar failures HOT 2
- Onload Error HOT 2
- Tasks Plugin Compatibility
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 obsidian-day-planner.