8000 Gantt View Limited to a Certain Heading Level (e.g., up to *** headings) · Issue #20 · legalnonsense/elgantt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Gantt View Limited to a Certain Heading Level (e.g., up to *** headings) #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and conta 8000 ct its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pabloaperezfernandez opened this issue Aug 15, 2021 · 1 comment

Comments

@pabloaperezfernandez
Copy link
pabloaperezfernandez commented Aug 15, 2021

I can use column to see headings levels 1 through 2 by going into column view C-c C-x C-c and typing C-u 2 S-TAB. Using a modified version of your test.org file, I can jump between columnview of all headings and column view up to level 2.

Screen Shot 2021-08-15 at 8 36 52 AM

I can then type C-u 2 S-TAB to get

Screen Shot 2021-08-15 at 8 37 51 AM

I know it should be possible because you simply use org-ql, but I am not quite sure where in you code I could make this change. Is there a way to tell El Gantt to limit itself to headings of a certain level?

@pabloaperezfernandez
Copy link
Author

Okay, I figured it out. Your packaged is well written. If you legal work is like your code, your clients are doing well.

Below, I show how to restrict to level 1 and 2 headings. It would be quite simple to modify the code to do what I want.

(defun elgantt--iterate ()
  "Iterate over all entries in `elgantt-agenda-files'."
  (if elgantt-insert-header-even-if-no-timestamp
      ;; Seems wasteful to write two separate queries, but
      ;; I do not know how to format a single org-ql query
      ;; to include or exclude timestamps depending on the value of 
      ;; the horribly named `elgantt-insert-header-even-if-no-timestamp'
      (mapc #'elgantt--insert-entry
	    (-non-nil
	     (org-ql-select elgantt-agenda-files
	       `(not (tags ,(when elgantt-skip-archives
			      org-archive-tag)))
	       :action #'elgantt--parser)))
    (mapc #'elgantt--insert-entry
	  (-non-nil
	   (org-ql-select elgantt-agenda-files
	     `(and (ts :from ,elgantt-start-date)
		   (not (tags ,(when elgantt-skip-archives
				 org-archive-tag)))
;;		   (level #'<= 2)    ;; Add this to only show headings up to level 2
		   )
	     :action #'elgantt--parser)))))```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0