News for hackers. Stuff that matters.
Re:Hypertext Emacs: You may not need org-mode by kagevf on Tuesday January 31, 2023 @09:43PM (#34605661)
Is there a way to render the org table without using a source block?

This is what I did:

- input the defun for create-summary in ielm

- Added tables like the ones in your link. NOTE: I used different numbers.

- M-x create-summary runs but it just echoes some messages.

- I put (create-summary) in my org doc, then ran C-u C-x C-e and it returns the lisp representation of the table:

  (("Team" "Hours") hline (#("Team 1" 0 6 (face org-level-1 fontified t)) 30) (#("Team 2" 0 2 (face org-level-1 fontified t) 2 3 (face org-level-1 fontified t) 3 6 (face org-level-1 fontified t)) 60) hline ("Total" 90))
- Then, I put the lisp object in a variable in source block, eval'd it and got the table:

  #+BEGIN_SRC emacs-lisp
  (setq x '(("Team" "Hours") hline (#("Team 1" 0 6 (face org-level-1 fontified t)) 30) (#("Team 2" 0 2 (face org-level-1 fontified t) 2 3 (face org-level-1 fontified t) 3 6 (face org-level-1 fontified t)) 60) hline ("Total" 90)))
  
  x
  #+END_SRC
  
  #+RESULTS:
  | Team   | Hours |
  |--------+-------|
  | Team 1 |    30 |
  | Team 2 |    60 |
  |--------+-------|
  | Total  |    90 |
    
I was wondering if there was a way to generate the table just by running a function.

Got the idea to use a source block from here: https://stackoverflow.com/questions/65950060/converting-list...

There are no comments on this comment yet.